Open otaviof opened 2 years ago
Here are some of the ideas on what such a logging component should have:
1) Logging Levels: Implement different logging levels, such as INFO, WARNING, ERROR, and DEBUG. This will allow us to control the verbosity of the logs based on user needs.
2) Output Control: Define where the log messages should be directed, like the console, a file, or a remote server. This gives us flexibility in managing logs, especially in production scenarios.
3) Message Formatting: Provide the ability to format log messages with timestamps, log levels, and any other relevant context information. This should be customizable to fit our application's needs.
4) Color Coding: Consider adding color coding for different log levels. For example, errors can be shown in red to make them stand out.
5) Log Rotation: Implement log rotation to prevent log files from becoming too large. This is particularly important when writing logs to files.
6) Log Filters: Allow users to filter logs based on criteria like log level, keywords, or modules. This helps users focus on specific aspects of the application.
7) Error Handling: Define how the logging component should behave when it encounters an error (e.g., when it cannot write to a file).
These are the ideas that I can think , please guide if anything is missing or anything is wrong!!
From Refinement, this is a relevant item, but there is no milestone attached at the moment.
/assign
The command-line needs to print out information and errors for all sub-commands and we would benefit to have a single component responsible for this task. Right now we have a mixture of
log
andfmt.Printf
going on, so we should come up with a new component which will be employed by all others that need to interact with the user.Please share here your thoughts, and your ideas of what a logging component like this would have to have.