Default formatter for log messages.
Instance Methods
ext/syslog/lib/syslog/logger.rb
View on GitHub
# File tmp/rubies/ruby-3.0.5/ext/syslog/lib/syslog/logger.rb, line 51
def call severity, time, progname, msg
clean msg
end
No documentation available
ext/syslog/lib/syslog/logger.rb
View on GitHub
# File tmp/rubies/ruby-3.0.5/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
Clean up messages so they’re nice and pretty.