orhanobut / logger

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

DiskLogAdapter do not work #256

Open junerver opened 3 years ago

junerver commented 3 years ago

Please try to fill all questions below before submitting an issue.

i init logger like this :

class App : Application() {
    override fun onCreate() {
        super.onCreate()
        val formatStrategy: FormatStrategy = PrettyFormatStrategy.newBuilder()
            .methodCount(3) // (Optional) How many method line to show. Default 2
            .tag("custom")
            .build()
        Logger.addLogAdapter(object:AndroidLogAdapter(formatStrategy){
            override fun isLoggable(priority: Int, tag: String?): Boolean {
                return BuildConfig.DEBUG
            }
        })
        val csvformatstrategy: FormatStrategy = CsvFormatStrategy.newBuilder()
            .tag("custom")
            .build()

        Logger.addLogAdapter(DiskLogAdapter(csvformatstrategy))
    }
}

and I have authorized read and write permissions,but it do not work, There is no logger folder in the external storage file directory

lupaulus commented 3 years ago

Check my fork I added support for Disklog with SDK 30 -> Repo