Module: Support::Logging::ClassMethods

Defined in:
lib/logging.rb

Instance Method Summary collapse

Instance Method Details

#configure_logger(log = STDOUT) ⇒ Object



29
30
31
32
33
34
35
36
37
38
39
40
41
# File 'lib/logging.rb', line 29

def configure_logger(log= STDOUT)
     if log.is_a? Logger
		@logger = log
	else
		@logger = Logger.new log
     end
     @logger.level = Logger::INFO
     @logger.formatter = proc do |severity, datetime, progname, msg|
		#	"#{datetime.strftime("%d.%m.(%X)")}#{"%5s" % severity}->#{msg}\n"
			"#{"%1s" % severity[0]}: #{msg}\n"
		end
     @logger.debug "------------------------------ start logging ----------------------------"
end

#loggerObject



21
22
23
# File 'lib/logging.rb', line 21

def logger
	@logger
end

#logger=(logger) ⇒ Object



25
26
27
# File 'lib/logging.rb', line 25

def logger=(logger)
	@logger = logger
end