orhanobut / logger

✔️ Simple, pretty and powerful logger for android
Apache License 2.0
13.78k stars 2.14k forks source link

How to add AppVersion to logcat #226

Open hoi-nx opened 5 years ago

hoi-nx commented 5 years ago

I want to add appversion to logcat? how to do that?

tangchao0106 commented 5 years ago

I want to add appversion to logcat? how to do that?

Fi5t commented 5 years ago
        PrettyFormatStrategy.newBuilder()
            .logStrategy(logStrategy)
            .methodCount(0)
            .showThreadInfo(false)
            .methodOffset(2)
            .tag("${context.getString(R.string.app_name)}_${BuildConfig.VERSION_NAME}") // Magic ;)
            .build()
tangchao0106 commented 5 years ago
PrettyFormatStrategy.newBuilder()
        .logStrategy(logStrategy)
        .methodCount(0)
        .showThreadInfo(false)
        .methodOffset(2)
        .tag("tag-"+BuildConfig.VERSION_NAME) 
        .build()