Releases: elvishew/xLog
Releases · elvishew/xLog
1.5.0
1.4.1
1.4.0
- Support object formatting for Bundle and Intent object by default.
Sample code
XLog.i(bundle); // Print a bundle details XLog.i(intent); // Print a intent details
- Support compressing log files to a zip file
Usage
LogUtils.compress(String folderPath, String zipFilePath)
- Support logging with specific log level via
log(int logLevel, …)
APIs #18
Sample code
XLog.log(LogLevel.DEBUG, "sample message") // Print a DEBUG level log XLog.log(7, "sample message") // Print a level 7 log, which is higher than LogLevel.ERROR(6)
- Support print stack trace with specific origin via
st(String stackTraceOrigin, int depth)
#17
Sample code
XLog.st("LogWrapper", 5);
1.3.0
- Support interceptors when logging, see
Interceptor
andLogNotification.Builder.addInterceptor(Interceptor)
- Add
NeverBackupStrategy
for file logging - Add blacklist and whitelist tags filter, see
BlacklistTagsFilterInterceptor
andWhitelistTagsFilterInterceptor
. Besides, you can easily define a filter interceptor extendingAbstractFilterInterceptor
- Use
Flattener
instead of, andLogFlattener
DefaultFlattener
instead ofDefaultLogFlattener
- Add
PatternFlattener
andClassicFlattener
-
PatternFlattener
flatten the log using the format specified by pattern
Supported parameters:Parameter Represents {d} Date in default date format "yyyy-MM-dd HH:mm:ss.SSS" {d format} Date in specific date format {l} Short name of log level. e.g: V/D/I {L} Long name of log level. e.g: VERBOSE/DEBUG/INFO {t} Tag of log {m} Message of log Imagine there is a log, with
LogLevel.DEBUG
level,my_tag
tag andSimple message
message, the flattened log would be as below.Pattern Flattened log {d} {l}/{t}: {m} 2016-11-30 13:00:00.000 D/my_tag: Simple message {d yyyy-MM-dd HH:mm:ss.SSS} {l}/{t}: {m} 2016-11-30 13:00:00.000 D/my_tag: Simple message {d yyyy/MM/dd HH:mm:ss} {l}|{t}: {m} 2016/11/30 13:00:00 D|my_tag: Simple message {d yy/MM/dd HH:mm:ss} {l}|{t}: {m} 16/11/30 13:00:00 D|my_tag: Simple message {d MM/dd HH:mm} {l}-{t}-{m} 11/30 13:00 D-my_tag-Simple message -
ClassicFlattener
flatten the log using the pattern{d} {l}/{t}: {m}
-
- Print logs to file more efficiently (#8)
- Logger-based log level control, see
LogNotification.Builder.logLevel(int logLevel)
- Refactor initialization methods of
XLog
- Added
XLog.init()
XLog.init(LogConfiguration)
XLog.init(Printer...)
XLog.init(LogConfiguration, Printer...)
- Deprecated
init(int, LogConfiguration)
init(int, LogConfiguration, Printer...)
- Added
- Use
ConsolePrinter
instead ofSystemPrinter
1.2.1
1.2.0
- Add LogUtils for convenience
- Repackage to hide internal classes
- Add sample app
1.1.0
- Change LogFlattener.flatten(int logLevel, String tag, String message) return type from String to CharSequence for better customization
- Support logging any object, see
- XLog.addObjectFormatter(Class objectClass, ObjectFormatter<? super T> objectFormatter)
- LogConfiguration.Builder.addObjectFormatter(Class objectClass, ObjectFormatter<? super T> objectFormatter)
- XLog.v(Object object)
- XLog.d(Object object)
- XLog.i(Object object)
- XLog.w(Object object)
- XLog.e(Object object)