Sha256: 36320ff61579b003e0ce538b9c2b2ea5b9a1fa1c03d212b1775ac86d541f9a33

Contents?: true

Size: 866 Bytes

Versions: 5

Compression:

Stored size: 866 Bytes

Contents

# -*- coding: binary -*-
require 'rex/constants'

module Rex
module Logging

###
#
# This abstract interface is what must be implemented by any class
# that would like to register as a log sink on a given LogDispatcher
# instance, such as the Framework object.
#
###
module LogSink

  def cleanup
  end

  #
  # This method must be implemented by any derived log sink classes and is
  # intended to take the supplied parameters and persist them to an arbitrary
  # medium.
  #
  def log(sev, src, level, msg, from)
    raise NotImplementedError
  end

protected

  #
  # This method returns the current timestamp in MM/DD/YYYY HH:Mi:SS format.
  #
  def get_current_timestamp
    return Time.now.strftime("%m/%d/%Y %H:%M:%S")
  end

end

end
end

require 'rex/logging/sinks/flatfile'
require 'rex/logging/sinks/stderr'
require 'rex/logging/sinks/timestamp_flatfile'

Version data entries

5 entries across 5 versions & 1 rubygems

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