Class: Ribit::RibitLoggerImpl

Inherits:
Object
  • Object
show all
Defined in:
lib/ribit/ribitlogger.rb

Instance Method Summary collapse

Constructor Details

#initialize(loggerName) ⇒ RibitLoggerImpl

Returns a new instance of RibitLoggerImpl.



76
77
78
79
80
81
82
83
84
85
86
# File 'lib/ribit/ribitlogger.rb', line 76

def initialize( loggerName )
  @name = loggerName.to_s

  # we add Ribit:: if not yet there
  if not /^Ribit::/.match( @name )
    @name = 'Ribit::' + @name
  end
  
  @logger = Log4r::Logger.new( @name )
  RibitLoggerConfig.configure( @logger )
end

Instance Method Details

#debug(msg) ⇒ Object



89
90
91
# File 'lib/ribit/ribitlogger.rb', line 89

def debug( msg )
  @logger.debug( buildMsg( msg ) )
end

#debug?Boolean

Returns:

  • (Boolean)


114
115
116
# File 'lib/ribit/ribitlogger.rb', line 114

def debug?
  @logger.debug?
end

#error(msg) ⇒ Object



104
105
106
# File 'lib/ribit/ribitlogger.rb', line 104

def error( msg )
  @logger.error( buildMsg( msg ) )
end

#fatal(msg) ⇒ Object



109
110
111
# File 'lib/ribit/ribitlogger.rb', line 109

def fatal( msg )
  @logger.fatal( buildMsg( msg ) )
end

#info(msg) ⇒ Object



94
95
96
# File 'lib/ribit/ribitlogger.rb', line 94

def info( msg )
  @logger.info( buildMsg( msg ) )
end

#warn(msg) ⇒ Object



99
100
101
# File 'lib/ribit/ribitlogger.rb', line 99

def warn( msg )
  @logger.warn( buildMsg( msg ) )
end