In Files

  • ruby-3.1.2/ext/syslog/lib/syslog/logger.rb

Parent

Methods

Files

Class/Module Index [+]

Quicksearch

Syslog::Logger::Formatter

Default formatter for log messages.

Public Instance Methods

call(severity, time, progname, msg) click to toggle source
 
               # File ruby-3.1.2/ext/syslog/lib/syslog/logger.rb, line 51
def call severity, time, progname, msg
  clean msg
end
            

Private Instance Methods

clean(message) click to toggle source

Clean up messages so they're nice and pretty.

 
               # File ruby-3.1.2/ext/syslog/lib/syslog/logger.rb, line 60
def clean message
  message = message.to_s.strip
  message.gsub!(/\e\[[0-9;]*m/, '') # remove useless ansi color codes
  return message
end