Sha256: f3cc990042ad7e9c69eafea45c79bac2de7214e11a6f6cf73f51f6452ec923b7

Contents?: true

Size: 801 Bytes

Versions: 2

Compression:

Stored size: 801 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'

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
librex-0.0.68 lib/rex/logging/log_sink.rb
librex-0.0.66 lib/rex/logging/log_sink.rb