Add log docs

pull/80/head
Mattia Iavarone 8 years ago
parent 0f0eadf55d
commit 1e49f023ba
  1. 21
      README.md

@ -60,6 +60,7 @@ See below for a [list of what was done](#roadmap) and [licensing info](#contribu
- [Other APIs](#other-apis)
- [Permissions Behavior](#permissions-behavior)
- [Manifest file](#manifest-file)
- [Logging](#logging)
- [Roadmap](#roadmap)
- [Device-specific issues](#device-specific-issues)
@ -491,6 +492,26 @@ The library manifest file is not strict and only asks for camera permissions. Th
If you don't request this feature, you can use `CameraUtils.hasCameras()` to detect if current device has cameras, and then start the camera view.
## Logging
`CameraView` will log a lot of interesting events related to the camera lifecycle. These are important
to identify bugs. The default logger will simply use Android `Log` methods posting to logcat.
You can attach and detach external loggers using `CameraLogger.registerLogger()`:
```java
CameraLogger.registerLogger(new Logger() {
@Override
public void log(@LogLevel int level, String tag, String message, @Nullable Throwable throwable) {
// For example...
Crashlytics.log(message);
}
});
```
Make sure you enable the logger using `CameraLogger.setLogLevel(@LogLevel int)`. The default will only
log error events.
## Roadmap
This is what was done since the library was forked. I have kept the original structure, but practically all the code was changed.

Loading…
Cancel
Save