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

Add more log information #272

Closed
jaguililla opened this issue Feb 16, 2020 · 4 comments
Closed

Add more log information #272

jaguililla opened this issue Feb 16, 2020 · 4 comments
Assignees

Comments

@jaguililla
Copy link
Member

jaguililla commented Feb 16, 2020

This is going to be an ongoing task.

If you find some part of the code without enough logging information, feel free to make the PR and reference this issue. However, the issue won't be closed as stated before.

Take care of the level assigned to the log statements:

  • error some error stopped the correct processing of the request or the process.
  • warn something failed and was ignored (it wasn't a big deal to stop request or process), but it could be an issue later or with other data.
  • info only for really useful information that is not written very often.
  • debug for information with useful information to diagnose problems or failures (that could be used to diagnose client code bugs).
  • trace for low level details that are logged very often (information that could be used to fix this library's bugs).

Rules of thumb:

  • Prefer to group related information in a single log statement rather than using many of them.
  • Do not log re-thrown exceptions. If this is done, chances are that this exception is logged twice (making diagnosis harder). All not handled exceptions are logged at entry points (main or request handlers), there is no need to log them in every catch, or where they are thrown.
  • Catching an exception doesn't mean it is an error or warning. Assign categories based on the rules above.
  • Generally is a good idea to log the places where the program makes a decision (adding the information that lead to the program flow selection). I.e.: "User not deleted (not found in the data store)".
  • If some condition leads to default return values, it is a good place to put a logging statement to add more information about it. I.e.: HTTP Request timeout (), returning empty array.

This will make users be able to understand and solve problems of the toolkit much faster.

Thank you for making this library a bit better :)

@jaguililla jaguililla added this to the 2.0.0 milestone Feb 16, 2020
mrpascal1 added a commit to mrpascal1/hexagon that referenced this issue Mar 19, 2020
mrpascal1 added a commit to mrpascal1/hexagon that referenced this issue Mar 20, 2020
@WageeshaEB WageeshaEB mentioned this issue Mar 18, 2021
6 tasks
@jaguililla jaguililla added the good first issue Earn your wings at the OSS community label Mar 19, 2021
@Rishavgupta12345
Copy link
Contributor

can i work on this issue

@jaguililla
Copy link
Member Author

Sure! you can proceed... You can make PRs per class with loggers added. I would prefer several small PRs rather than a big one.

Please, keep in mind that the goal is not to have all classes with a lot of logging information, but to add only the bare minimum information for a programmer to know what is going on (just review the task description for all details ;)

As the TODO task and the documentation task, this one won't have an assigned person as potentially many people could be working on it.

@pk97
Copy link

pk97 commented Oct 3, 2021

Hi, I would like to contribute here!

@jaguililla
Copy link
Member Author

Great @pk97 !!! As there is going to be many changes for v2. It is safe to improve logging of the Hexagon Core module. However, as v1 could be in use some time after v2 release, logs can also be added to other modules.

Remember to add log statements only if the provided useful information (to avoid log flood, that makes reasoning about the code harder) and follow the guidelines in the issue's description.

Thanks for your interest in the project! 🙂

@jaguililla jaguililla removed this from the 2.0.0 milestone Feb 24, 2022
@jaguililla jaguililla pinned this issue Dec 19, 2022
@jaguililla jaguililla self-assigned this Oct 29, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Archived in project
Development

No branches or pull requests

3 participants