Land #8601, make session logging more useful, don't lose characters
commit
c3090a4f9c
|
@ -214,8 +214,9 @@ module Session
|
|||
|
||||
dstr = sprintf("%.4d%.2d%.2d", dt.year, dt.mon, dt.mday)
|
||||
rhost = session_host.gsub(':', '_')
|
||||
sname = name.to_s.gsub(/\W+/,'_')
|
||||
|
||||
"#{dstr}_#{rhost}_#{type}"
|
||||
"#{dstr}_#{sname}_#{rhost}_#{type}"
|
||||
end
|
||||
|
||||
#
|
||||
|
|
|
@ -13,7 +13,7 @@ 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]/, " ")
|
||||
msg = msg.gsub(/\x1b\[[0-9;]*[mG]/,'').gsub(/[\x01-\x02]/, ' ').gsub(/\s+$/,'')
|
||||
fd.write("[#{get_current_timestamp}] #{msg}\n")
|
||||
fd.flush
|
||||
end
|
||||
|
|
Loading…
Reference in New Issue