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

Thorough and Appropriate Log Statements #65

Open
U8NWXD opened this issue Jul 27, 2018 · 2 comments
Open

Thorough and Appropriate Log Statements #65

U8NWXD opened this issue Jul 27, 2018 · 2 comments

Comments

@U8NWXD
Copy link
Member

U8NWXD commented Jul 27, 2018

  1. More thorough logging to aid debugging later. This will be especially important during beta testing where we may only have logs to figure out what went wrong.
  2. Choose appropriate log levels. Suggesion: https://stackoverflow.com/questions/25457858/android-log-levels

ERROR – something terribly wrong had happened, that must be investigated immediately. No system can tolerate items logged on this level. Example: NPE, database unavailable, mission critical use case cannot be continued.

WARN – the process might be continued, but take extra caution. Example: “Application running in development mode” or “Administration console is not secured with a password”. The application can tolerate warning messages, but they should always be justified and examined.

INFO – Important business process has finished. In ideal world, administrator or advanced user should be able to understand INFO messages and quickly find out what the application is doing. For example if an application is all about booking airplane tickets, there should be only one INFO statement per each ticket saying “[Who] booked ticket from [Where] to [Where]“. Other definition of INFO message: each action that changes the state of the application significantly (database update, external system request).

DEBUG – Developers stuff.

VERBOSE – Very detailed information, intended only for development. You might keep trace messages for a short period of time after deployment on production environment, but treat these log statements as temporary, that should or might be turned-off eventually. The distinction between DEBUG and VERBOSE is the most difficult, but if you put logging statement and remove it after the feature has been developed and tested, it should probably be on VERBOSE level.

@DrewGregory
Copy link
Contributor

"Make sure you deactivate logging and disable the debugging option before you build your application for release"

https://developer.android.com/studio/publish/preparing

@DrewGregory
Copy link
Contributor

DrewGregory commented Aug 7, 2018

Since they can be useful for development, we can keep them in a special branch.

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

No branches or pull requests

2 participants