Sha256: 3c03cee24ae4ef7abd796bed2d88f9e4e65da60a6c046edf857b63970f9554d5

Contents?: true

Size: 424 Bytes

Versions: 5

Compression:

Stored size: 424 Bytes

Contents

# -*- coding: binary -*-
module Rex
module Logging
module Sinks

###
#
# This class implements the LogSink interface and backs it against a
# file on disk with a Timestamp.
#
###
class TimestampFlatfile < Flatfile

  def log(sev, src, level, msg, from) # :nodoc:
    msg = msg.chop.gsub(/\x1b\[[0-9;]*[mG]/,'').gsub(/[\x01-\x02]/, " ")
    fd.write("[#{get_current_timestamp}] #{msg}\n")
    fd.flush
  end
end

end end end

Version data entries

5 entries across 5 versions & 1 rubygems

Version Path
rex-2.0.13 lib/rex/logging/sinks/timestamp_flatfile.rb
rex-2.0.12 lib/rex/logging/sinks/timestamp_flatfile.rb
rex-2.0.11 lib/rex/logging/sinks/timestamp_flatfile.rb
rex-2.0.10 lib/rex/logging/sinks/timestamp_flatfile.rb
rex-2.0.9 lib/rex/logging/sinks/timestamp_flatfile.rb