Sha256: 6204037c93a8448345441d7763eb6a6b4c6e69cbba7665779a16aeec3463fd47

Contents?: true

Size: 912 Bytes

Versions: 6

Compression:

Stored size: 912 Bytes

Contents

# = Logger
#
# A simple wrapper arround the Ruby logger. Mainly for compatibility
# purposes.
#
# code:
# * George Moschovitis  <gm@navel.gr>
#
# (c) 2004 Navel, all rights reserved.
# $Id: logger.rb 161 2004-11-18 10:51:51Z gmosx $

require "logger"

# = Logger
#
# A simple wrapper arround the Ruby logger. Mainly for compatibility
# purposes.
#
class Logger
	alias_method :devel, :debug
	alias_method :fine, :debug
	
	def detach
	end
	
	# Used for debuging, remove this in release code.
	#
	def d(str)
		self << "#{str}\n"
	end

	# Inspect an object. Used for debugging, remove this in release
	# code.
	#
	def i(obj)
		self << "Inspect #{obj.inspect()}\n"
	end

	private
		
	# the default Ruby logger has a hardwired silly format.
	# we use some Ruby magic to fix it!
	remove_const "Format"

	Format = "%5s: %s\n"

	def format_message(severity, timestamp, msg, progname)
		Format % [severity, msg]
	end
end

Version data entries

6 entries across 6 versions & 2 rubygems

Version Path
nitro-0.6.0 lib/glue/logger.rb
nitro-0.7.0 lib/glue/logger.rb
nitro-0.5.0 lib/glue/logger.rb
og-0.6.0 lib/glue/logger.rb
og-0.5.0 lib/glue/logger.rb
og-0.7.0 lib/glue/logger.rb