shipwright-io / cli

A CLI for building container images on Kubernetes!
https://shipwright.io
Apache License 2.0
16 stars 26 forks source link

Centralized Logging #90

Open otaviof opened 2 years ago

otaviof commented 2 years ago

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.

shubhamch71 commented 10 months 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!!

qu1queee commented 7 months ago

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

Adarsh-jaiss commented 3 months ago

/assign