You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
A new logging utility that supports color-coded log levels with the types INFO, DEBUG, WARN, and ERROR. Each log type will be associated with a specific color to improve visibility and help distinguish between the log types in the terminal. Additionally, we will introduce formatting methods that allow for customization of log messages, providing users with flexibility in how logs are displayed.
Color-Coding:
INFO: Blue
DEBUG: Green
WARN: Yellow
ERROR: Red
Use Case
Development Debugging
Monitoring
Testing
Proposed Solution
Define ANSI Escape Codes for Colors:
The color codes follow the ANSI escape sequence format.
For example:
\033[34m for blue
\033[32m for green
\033[33m for yellow
\033[31m for red
To reset colors back to default, you can use \033[0m.
Logger Structure:
Implement a basic logger with log levels and formatting.
Custom Formatter:
A method that applies colors to logs based on their level.
Additional Context
N/A
Pseudo Code
logger:=NewLogger() // Create new logger instancelogger.SetLevel(INFO) // Set minimum log level to INFOlogger.Info("This is an info message")
logger.Debug("This is a debug message")
logger.Warn("This is a warning message")
logger.Error("This is an error message")
// output should be like following:
[2024-11-1915:04:05] [INFO] MyApp: Thisisaninformationalmessage.
The text was updated successfully, but these errors were encountered:
@shahzadhaider1 are you working on this? You are assigned to couple of other issues as well, if you do not have much bandwidth, can you assign this to @Turtel216?
Feature Description
A new logging utility that supports color-coded log levels with the types INFO, DEBUG, WARN, and ERROR. Each log type will be associated with a specific color to improve visibility and help distinguish between the log types in the terminal. Additionally, we will introduce formatting methods that allow for customization of log messages, providing users with flexibility in how logs are displayed.
Color-Coding:
Use Case
Proposed Solution
Define ANSI Escape Codes for Colors:
The color codes follow the ANSI escape sequence format.
For example:
To reset colors back to default, you can use \033[0m.
Logger Structure:
Implement a basic logger with log levels and formatting.
Custom Formatter:
A method that applies colors to logs based on their level.
Additional Context
N/A
Pseudo Code
The text was updated successfully, but these errors were encountered: