class Object

Copyright ©, 2013 Peter Wood See the license.txt for details of the licensing of the code in this file.

Public Class Methods

log() click to toggle source

This method provides a class level accessor to obtain a logger. Unless a name is specified the logger returned is the default one.

# File lib/logjam/object.rb, line 15
def self.log
  LogJam.get_logger
end
log=(logger) click to toggle source
# File lib/logjam/object.rb, line 19
def self.log=(logger)
  LogJam.get_logger.logger = logger
end
set_logger_name(name, context={}) click to toggle source

This method allows a class to specify the name of the logger that it uses once, generally within the class definition.

Parameters

name

The name of the logger used by the class.

context

A Hash of additional parameters that are specific to the class to which LogJam is being applied.

# File lib/logjam/object.rb, line 30
def self.set_logger_name(name, context={})
  LogJam.apply(self, name, context)
end

Public Instance Methods

log() click to toggle source

This method provides an instance level accessor to obtain a logger. Unless a name is specified the logger returned is the default one.

# File lib/logjam/object.rb, line 9
def log
  LogJam.get_logger
end