Class: Makit::Logging::ColorFormatter Deprecated
- Inherits:
-
Logger::Formatter
- Object
- Logger::Formatter
- Makit::Logging::ColorFormatter
- Defined in:
- lib/makit/logging.rb
Overview
Deprecated.
This class is deprecated and will be removed in version 0.2.0. Use Makit::Logging::Logger with Makit::Logging::Sinks::Console instead.
Colored log formatter for terminal output
This formatter adds appropriate colors to different log levels to improve readability in terminal environments. Colors are: DEBUG (light blue), INFO (green), WARN (yellow), ERROR (red), FATAL (bold red)
Instance Method Summary collapse
-
#call(severity, time, _progname, msg) ⇒ String
Format a log message with colors.
Instance Method Details
#call(severity, time, _progname, msg) ⇒ String
Format a log message with colors
153 154 155 156 157 158 |
# File 'lib/makit/logging.rb', line 153 def call(severity, time, _progname, msg) warn "Makit::Logging::ColorFormatter is deprecated and will be removed in version 0.2.0. Use Makit::Logging::Logger with Makit::Logging::Sinks::Console instead." = time.strftime("%Y-%m-%d %H:%M:%S") colored_severity = colorize_severity(severity) "[#{}] #{colored_severity}: #{msg}\n" end |