W3cubDocs

/Ruby 2.4

class Syslog::Logger::Formatter

Parent:
Object

Default formatter for log messages.

Public Instance Methods

call(severity, time, progname, msg) Show source
# File ext/syslog/lib/syslog/logger.rb, line 50
def call severity, time, progname, msg
  clean msg
end

Private Instance Methods

clean(message) Show source

Clean up messages so they're nice and pretty.

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

Ruby Core © 1993–2017 Yukihiro Matsumoto
Licensed under the Ruby License.
Ruby Standard Library © contributors
Licensed under their own licenses.