Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Removing ActionbarSherlock logs when BuildConfig.DEBUG

I have noticed that the library ActionBarSherlock display a lot of debug informations in my application, simply because there is a lot of lines like this:

if (BuildConfig.DEBUG)
   Log.d(TAG, "[onCreatePanelMenu] featureId: " + featureId + ", menu: " + menu);

Fortunately, the log is displayed only on my debug device. Thanks to the if statement.
The big problem is that I would like to remove all the log on the debug device to focus on my code.

I know 2 solutions to avoid that:

  1. Delete/edit all the logs in the library
  2. Filter the logcat in Eclipse.

Is there a simpler way to achieve this and to "fake" the library by telling it we are not on a debug device? I really would like to avoid the 2 above solutions.

like image 777
Waza_Be Avatar asked May 27 '13 09:05

Waza_Be


People also ask

How do you clear the Debug log?

The trick is, whenever there's a Debug.log it seems to open the log file, write something like 10 lines to it (call stack for the Debug.log), then close it. On certain devices (like iPhone) this is a slow process that can cause framerate issues, and I wouldn't be surprised if the file can get large enough to start affecting memory as well.

Does disabling the player log disable the debug system?

You can provide your own loggers using the debug API, and those loggers will still work when the player log is disabled. The player log is the output log that is generated automatically by Unity, and disabling it will probably not disable the rest of the Debug system (unless maybe they detect there are no available loggers).

Should I enable debug logging on the configmgr client?

If you have PowerShell 3.0+ dependent commands in your script, and you run it on a PowerShell 2.0 host, you will have errors in your compliance data that are not very easy to track down without enabling debug logging on the ConfigMgr client.

How long are system debug logs retained?

System debug logs are retained for 24 hours. Monitoring debug logs are retained for seven days. If you generate more than 1,000 MB of debug logs in a 15-minute window, your trace flags are disabled.


1 Answers

Open your ActionBarSherlock project
Open to the file /gen/com/actionbarsherlock/BuildConfig.java
And set DEBUG = false

like image 191
valerio Avatar answered Oct 26 '22 17:10

valerio