Files
metasploit-gs/lib/rex/logging/log_sink.rb
T
HD Moore 475df9c08b Added the stderr log sink
git-svn-id: file:///home/svn/framework3/trunk@3895 4d416f70-5f16-0410-b530-b9f4589650da
2006-09-16 05:50:10 +00:00

43 lines
776 B
Ruby

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'