com.orhanobut.logger.FormatStrategy Java Examples

The following examples show how to use com.orhanobut.logger.FormatStrategy. You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example #1
Source File: AppLogger.java    From v9porn with MIT License 6 votes vote down vote up
public static void initLogger() {
    FormatStrategy formatStrategy = PrettyFormatStrategy.newBuilder()
            // (Optional) Whether to show thread info or not. Default true
            .showThreadInfo(false)
            // (Optional) How many method line to show. Default 2
            .methodCount(0)
            // (Optional) Hides internal method calls up to offset. Default 5
            .methodOffset(5)
            // .logStrategy(customLog) // (Optional) Changes the log strategy to print out. Default LogCat
            // .tag("My custom tag")   // (Optional) Global tag for every log. Default PRETTY_LOGGER
            .build();

    Logger.addLogAdapter(new AndroidLogAdapter(formatStrategy) {
        @Override
        public boolean isLoggable(int priority, String tag) {
            return BuildConfig.DEBUG;
        }
    });
}
 
Example #2
Source File: AppLogger.java    From v9porn with MIT License 6 votes vote down vote up
public static void initLogger() {
    FormatStrategy formatStrategy = PrettyFormatStrategy.newBuilder()
            // (Optional) Whether to show thread info or not. Default true
            .showThreadInfo(false)
            // (Optional) How many method line to show. Default 2
            .methodCount(0)
            // (Optional) Hides internal method calls up to offset. Default 5
            .methodOffset(5)
            // .logStrategy(customLog) // (Optional) Changes the log strategy to print out. Default LogCat
            // .tag("My custom tag")   // (Optional) Global tag for every log. Default PRETTY_LOGGER
            .build();

    Logger.addLogAdapter(new AndroidLogAdapter(formatStrategy) {
        @Override
        public boolean isLoggable(int priority, String tag) {
            return BuildConfig.DEBUG;
        }
    });
}