cli icon indicating copy to clipboard operation
cli copied to clipboard

Centralized Logging

Open otaviof opened this issue 3 years ago • 3 comments

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 and fmt.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.

otaviof avatar Jan 19 '22 08:01 otaviof

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!!

shubhamch71 avatar Nov 01 '23 19:11 shubhamch71

From Refinement, this is a relevant item, but there is no milestone attached at the moment.

qu1queee avatar Jan 11 '24 15:01 qu1queee

/assign

Adarsh-jaiss avatar May 23 '24 13:05 Adarsh-jaiss