Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Need a way to disable logging #241

Closed
sshock opened this issue Jan 7, 2019 · 5 comments · Fixed by #242
Closed

Need a way to disable logging #241

sshock opened this issue Jan 7, 2019 · 5 comments · Fixed by #242

Comments

@sshock
Copy link
Contributor

sshock commented Jan 7, 2019

Is there any way to disable logging other than commenting it out and creating my own build?

@imurchie
Copy link
Contributor

imurchie commented Jan 7, 2019

The Appium server has a flag, --log-level, which can be set higher to get less logging. See the documentation here: http://appium.io/docs/en/writing-running-appium/server-args/

@sshock
Copy link
Contributor Author

sshock commented Jan 7, 2019

I'm talking about the logging from io.appium.uiautomator2.server app that runs on the android device (that shows up in logcat on the device), not the logging from appium server (node program).

@sshock
Copy link
Contributor Author

sshock commented Jan 7, 2019

I think if the io.appium.uiautomator2.utils.Logger were updated to first check android.util.Log.isLoggable() before each call to Log.x, then I would be able to control the logging via setprop or with /data/local.prop as described here:

https://developer.android.com/reference/android/util/Log#isLoggable(java.lang.String,%20int)

@mykola-mokhnach
Copy link
Contributor

@sshock Feel free to add a PR. This should be a simple change

@sshock
Copy link
Contributor Author

sshock commented Jan 8, 2019

@mykola-mokhnach Sounds good. I will see if I get around to it sometime this week ;)

Note that the default level is INFO, so if I understand correctly, after making this change VERBOSE and DEBUG will no longer be logged by default, and if someone wants those they will need to use setprop and/or specify in /data/local.prop. So we may want to consider ways to raise awareness about this so people aren't totally caught off guard.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants