Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/markzhai/logger
Logger is a logging tool helps unify release log and debug log, with some little advanced usage
https://github.com/markzhai/logger
Last synced: about 1 month ago
JSON representation
Logger is a logging tool helps unify release log and debug log, with some little advanced usage
- Host: GitHub
- URL: https://github.com/markzhai/logger
- Owner: markzhai
- License: apache-2.0
- Created: 2015-08-18T05:55:44.000Z (over 9 years ago)
- Default Branch: master
- Last Pushed: 2015-08-18T07:33:21.000Z (over 9 years ago)
- Last Synced: 2024-04-09T21:38:11.376Z (9 months ago)
- Language: Java
- Size: 363 KB
- Stars: 3
- Watchers: 3
- Forks: 2
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# Logger
Logger is a logging tool helps unify release log and debug log, with some little advanced usage.## Usage
- output to file and logcat with one call.
- hide debug and release difference to developers.
- composition over inheritance, easy to composite own logger.
- directly log EXCEPTION / ARRAY / MAP / COLLECTION / OBJECT.## HOW-TO
Logger is easy to use.
```java
public class SampleApplication extends Application {
@Override
public void onCreate() {
super.onCreate();
if (BuildConfig.DEBUG) {
Logger.init(this, ReleaseLogger.getInstance());
} else {
Logger.init(this, ReleaseLogger.getInstance());
}
}
}
```init it in Application, and use Logger to log whatever you want.
```java
Logger.d(TAG, "123");
Logger.d(TAG, this);
Logger.e(TAG, "123", new NullPointerException());
```You can customize your own DebugLogger and ReleaseLogger by changing the internal composition implementation.