Class: Makit::Logging::PlainFormatter Deprecated
- Inherits:
-
Logger::Formatter
- Object
- Logger::Formatter
- Makit::Logging::PlainFormatter
- 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::FileSink instead.
Plain text log formatter that strips ANSI color codes
This formatter removes color codes from log messages and provides clean, plain text output suitable for file logging or systems that don’t support color output.
Instance Method Summary collapse
-
#call(severity, time, _progname, msg) ⇒ String
Format a log message as plain text.
Instance Method Details
#call(severity, time, _progname, msg) ⇒ String
Format a log message as plain text
142 143 144 145 146 147 |
# File 'lib/makit/logging.rb', line 142 def call(severity, time, _progname, msg) warn "Makit::Logging::PlainFormatter is deprecated and will be removed in version 0.2.0. Use Makit::Logging::Logger with Makit::Logging::Sinks::FileSink instead." stripped_msg = msg.gsub(ANSI_COLOR_REGEX, "") # Remove ANSI color codes = time.strftime("%Y-%m-%d %H:%M:%S") "[#{}] #{severity}: #{stripped_msg}\n" end |