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

Next Major: revisit logging #2122

Open
benoit74 opened this issue Dec 27, 2024 · 1 comment
Open

Next Major: revisit logging #2122

benoit74 opened this issue Dec 27, 2024 · 1 comment

Comments

@benoit74
Copy link
Contributor

I think that we should enhance two things regarding logging in mwoffliner, but they are breaking changes.

First, we should prefer to use "standard" log levels. Currently we use 'info', 'log', 'warn', 'error', 'quiet'.

Based on code usage, I would say that:

  • info means verbose logs about details
  • log means general messages showing scraper progress
  • warn means a non-fatal problem occurred
  • error means a fatal problem occurred
  • quiet is a fictitious level allowing to disable all logging

The info and log levels are very astonishing when compared to general IT practices. I don't get when someone would want to use the quiet level since we always need to know about errors since they are fatal. If error log level is too verbose, then it needs to be fixed.

I think we should move to more standard levels, replacing info with debug (or verbose) and log with info.

I don't feel like making a distinction between debug and verbose (which exists in many Node.JS logging framework) is needed, I've always found the distinction too blurry and leading to too much back and forth, 4 log levels is sufficient from my PoV.

I also think (this is the second enhancement) that we should move to a standard logging framework (either the standard one or a popular one). I see no reason to have our own logging framework like we do today with the very limited Logger.ts class. This is code to maintain and code limiting the capabilities of the scrapper in terms of logs

@audiodude
Copy link
Member

Cleaning up which messages and when they are triggered (like I said here) is a great idea, but I don't see the need to change the names of the levels with the current "home rolled" logging.

IMO the best solution is to move to a standard logging solution and use their levels, which are likely to be close to the ones you've proposed.

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

No branches or pull requests

2 participants