add a nil catch to timestamp file sink

an additional nil guard is needed here just to be sure
This commit is contained in:
David Maloney
2016-12-15 14:41:49 -06:00
parent 27ba8f00df
commit e7eece60d8
@@ -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