https://github.com/lkorth/mailable-log
An opinionated logger for Android with built in email support
https://github.com/lkorth/mailable-log
android debugging library log
Last synced: 2 months ago
JSON representation
An opinionated logger for Android with built in email support
- Host: GitHub
- URL: https://github.com/lkorth/mailable-log
- Owner: lkorth
- License: mit
- Created: 2014-11-21T16:25:11.000Z (over 10 years ago)
- Default Branch: master
- Last Pushed: 2017-06-20T15:29:47.000Z (almost 8 years ago)
- Last Synced: 2025-03-20T17:55:15.095Z (2 months ago)
- Topics: android, debugging, library, log
- Language: Java
- Size: 65.4 KB
- Stars: 3
- Watchers: 2
- Forks: 0
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
mailable-log
============## Getting Started
Add mailable-log as a dependency:
```groovy
dependencies {
compile 'com.lukekorth:mailable_log:0.1.6'
}
```Add the provider inside the application tag in your `AndroidManifest`:
```xml
```
For those using Gradle `${applicationId}` can be left alone, however Maven users should replace
`${applicationId}` with the app's package name.## Usage
### Initializing
Initialization should be done as soon as possible, preferably in `Application#onCreate`.
```java
MailableLog.init(context, BuildConfig.DEBUG);
```### Logging
Use `LoggerFactory` to get a logger instance. Logs can be written at several different levels.
```java
Logger logger = LoggerFactory.getLogger(TAG);
logger.error("message");
```### Emailing the log
`MailableLog#buildEmailIntent` must not be called on the main thread.
```java
MailableLog.buildEmailIntent(context, "[email protected]", "Email Subject", "file-name.log", prependedStringInLog);
```### Clearing the log
To clear the existing log:
```java
MailableLog.clearLog(context);
```## License
mailable-log is open source and available under the MIT license. See the [LICENSE](LICENSE) file for more info.