logger icon indicating copy to clipboard operation
logger copied to clipboard

I want make it like you

Open luhuanxml opened this issue 6 years ago • 1 comments

I want to make one log util like you. It's yours image It's mine image I don't know why like this. How to make it like yours.

luhuanxml avatar Jul 05 '18 13:07 luhuanxml

See #202 @zuoni1018 gived a solution. It works for me. But his text style seems to be some problem and I fix it:

    private void initLogger() {
        LogStrategy logStrategy = new LogStrategy() {
            private String[] prefix = {". ", " ."};
            private int index = 0;

            @Override
            public void log(int priority, @Nullable String tag, @NonNull String message) {
                index = index ^ 1;
                Log.println(priority, prefix[index] + tag, message);
            }
        };
        FormatStrategy formatStrategy = PrettyFormatStrategy.newBuilder()
                .logStrategy(logStrategy)
                .showThreadInfo(false) // Optional
                .methodCount(1) // Optional
                .methodOffset(7)
                .build();
        Logger.addLogAdapter(new AndroidLogAdapter(formatStrategy));
    }

ichenhe avatar Jul 14 '18 06:07 ichenhe