Class: Rex::Logging::Sinks::TimestampFlatfile
- Defined in:
- lib/rex/logging/sinks/timestamp_flatfile.rb
Overview
This class implements the LogSink interface and backs it against a file on disk with a Timestamp.
Instance Attribute Summary
Attributes inherited from Flatfile
Instance Method Summary collapse
-
#log(sev, src, level, msg) ⇒ Object
:nodoc:.
Methods inherited from Flatfile
Methods included from LogSink
#cleanup, #get_current_timestamp
Constructor Details
This class inherits a constructor from Rex::Logging::Sinks::Flatfile
Instance Method Details
#log(sev, src, level, msg) ⇒ Object
:nodoc:
14 15 16 17 18 19 |
# File 'lib/rex/logging/sinks/timestamp_flatfile.rb', line 14 def log(sev, src, level, msg) # :nodoc: return unless msg.present? msg = msg.gsub(/\x1b\[[0-9;]*[mG]/,'').gsub(/[\x01-\x02]/, ' ').gsub(/\s+$/,'') fd.write("[#{}] #{msg}\n") fd.flush end |