简体   繁体   中英

WorkManager: Hide logs in the logcat

I'm making an SDK which uses workManager to handle the background tasks. The thing is, I want my sdk to show the useful logcats I specify. But when I run a workManager task I get debug logs about SUCCESS, RETRY, etc of the workManager.

Worker result SUCCESS for Work [ id=44a0ed5d-69c5-4318-84eb-69680d1c3647, tags={ TaskPerformer, my_task } ]

Is there anyway to hide these logs since they are not useful for the developer who uses the library?

I'd use setMinimumLoggingLevel(android.util.Log.ASSERT) .

It's may be kind of a hack since there's no "disable logging" in WorkManager's API AFAIK, but it'll get the job.

From the docs: https://developer.android.com/topic/libraries/architecture/workmanager/how-to/debugging

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM