Land #7713, scriptkittie fix for SessionLogging

lands a fix for loggers not handling a nil message
Fix for #7687
bug/bundler_fix
David Maloney 2016-12-15 14:42:40 -06:00
commit ca1cc11d9f
No known key found for this signature in database
GPG Key ID: DEDBA9DC3A913DB2
2 changed files with 2 additions and 0 deletions

View File

@ -12,6 +12,7 @@ module Sinks
class TimestampFlatfile < Flatfile
def log(sev, src, level, msg, from) # :nodoc:
return unless msg.present?
msg = msg.chop.gsub(/\x1b\[[0-9;]*[mG]/,'').gsub(/[\x01-\x02]/, " ")
fd.write("[#{get_current_timestamp}] #{msg}\n")
fd.flush

View File

@ -272,6 +272,7 @@ module Shell
#
def print_error(msg='')
return if (output.nil?)
return if (msg.nil?)
self.on_print_proc.call(msg) if self.on_print_proc
# Errors are not subject to disabled output