2005-07-09 21:18:49 +00:00
|
|
|
require 'rex/constants'
|
2005-06-04 08:15:10 +00:00
|
|
|
|
|
|
|
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
|
|
|
|
|
2005-11-15 05:22:13 +00:00
|
|
|
#
|
|
|
|
# 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.
|
|
|
|
#
|
2005-06-04 08:15:10 +00:00
|
|
|
def log(sev, src, level, msg, from)
|
|
|
|
raise NotImplementedError
|
|
|
|
end
|
|
|
|
|
|
|
|
protected
|
|
|
|
|
2005-11-15 05:22:13 +00:00
|
|
|
#
|
|
|
|
# This method returns the current timestamp in MM/DD/YYYY HH:Mi:SS format.
|
|
|
|
#
|
2005-06-04 08:15:10 +00:00
|
|
|
def get_current_timestamp
|
|
|
|
return Time.now.strftime("%m/%d/%Y %H:%M:%S")
|
|
|
|
end
|
|
|
|
|
|
|
|
end
|
|
|
|
|
|
|
|
end
|
|
|
|
end
|
|
|
|
|
2005-07-09 21:18:49 +00:00
|
|
|
require 'rex/logging/sinks/flatfile'
|
2006-09-16 05:50:10 +00:00
|
|
|
require 'rex/logging/sinks/stderr'
|