Class: Slf4r::LoggerFacade4RubyLogger

Inherits:
Object
  • Object
show all
Defined in:
lib/slf4r/ruby_logger.rb

Constant Summary collapse

@@file =
STDOUT
@@datetime_format =
"%Y-%m-%d %H:%M:%S "

Class Method Summary collapse

Class Method Details

.datetime_format=(format) ⇒ Object



24
25
26
# File 'lib/slf4r/ruby_logger.rb', line 24

def self.datetime_format=(format)
  @@datetime_format = format
end

.file=(file) ⇒ Object



28
29
30
# File 'lib/slf4r/ruby_logger.rb', line 28

def self.file=(file)
  @@file = file
end

.level=(level) ⇒ Object



19
20
21
22
# File 'lib/slf4r/ruby_logger.rb', line 19

def self.level=(level)
  @@level = level.instance_of?(Fixnum) ? level :
    ::Logger.const_get(level.to_s.upcase)
end

.new_logger_facade(name) ⇒ Object



10
11
12
13
14
15
16
17
# File 'lib/slf4r/ruby_logger.rb', line 10

def self.new_logger_facade(name)
  @name = name
  @logger = ::Logger.new(@@file)
  @@level = ::Logger::DEBUG unless self.class_variable_defined?(:@@level)
  @logger.level = @@level
  @logger.datetime_format = @@datetime_format
  @logger
end