2.0.0
-
LogAdapter functionality is changed. Log adapter decides when to log with
isLoggableand how to log with format strategy. You can create your custom adapter and add to Logger. Logger now accepts multiple log adapters. -
Initialization changed. Old style is not supported any longer. Use the following style with log adapters. This approach allows you to add multiple adapters and each adapter contains different logic.
Logger.addLogAdapter(new AndroidLogAdapter());
-
FormatStrategy added. With format strategy, you can have different output format such as normal pretty look or csv. You can also add your custom format.
-
Settings is removed. Format settings are associated with format strategy. Use the built-in functions to change the appearance or behavior.
FormatStrategy formatStrategy = PrettyFormatStrategy.newBuilder()
.showThreadInfo(false) // (Optional) Whether to show thread info or not. Default true
.methodCount(0) // (Optional) How many method line to show. Default 2
.methodOffset(7) // (Optional) Hides internal method calls up to offset. Default 5
.logStrategy(customLog) // (Optional) Changes the log strategy to print out. Default LogCat
.tag("My custom tag") // (Optional) Custom tag for each log. Default PRETTY_LOGGER
.build();
Logger.addLogAdapter(new AndroidLogAdapter(formatStrategy));
