Skip to content

Commit 24379f9

Browse files
committed
Fixed timestamped logger cutting off last character (fixes rapid7#8597)
1 parent 2617ae7 commit 24379f9

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

lib/rex/logging/sinks/timestamp_flatfile.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ class TimestampFlatfile < Flatfile
1313

1414
def log(sev, src, level, msg, from) # :nodoc:
1515
return unless msg.present?
16-
msg = msg.chop.gsub(/\x1b\[[0-9;]*[mG]/,'').gsub(/[\x01-\x02]/, " ")
16+
msg = msg.gsub(/\x1b\[[0-9;]*[mG]/,'').gsub(/[\x01-\x02]/, ' ').gsub(/\s+$/,'')
1717
fd.write("[#{get_current_timestamp}] #{msg}\n")
1818
fd.flush
1919
end

0 commit comments

Comments
 (0)