Parent

Loggability::Logger::ObjectNameProxy

Proxy for the Logger that injects the name of the object it wraps as the ‘progname’ of each log message.

Attributes

logger[R]

The Loggability::Logger this proxy is for.

progname[R]

The progname of the object the proxy is for.

Public Class Methods

new( logger, object ) click to toggle source

Create a proxy for the given logger that will inject the name of the specified object into the ‘progname’ of each log message.

# File lib/loggability/logger.rb, line 62
def initialize( logger, object )
        @logger = logger
        @progname = make_progname( object )
end

Public Instance Methods

debug( msg=nil, &block ) click to toggle source

Delegate debug messages

# File lib/loggability/logger.rb, line 79
def debug( msg=nil, &block )
        @logger.add( Logger::DEBUG, msg, @progname, &block )
end
error( msg=nil, &block ) click to toggle source

Delegate error messages

# File lib/loggability/logger.rb, line 94
def error( msg=nil, &block )
        @logger.add( Logger::ERROR, msg, @progname, &block )
end
fatal( msg=nil, &block ) click to toggle source

Delegate fatal messages

# File lib/loggability/logger.rb, line 99
def fatal( msg=nil, &block )
        @logger.add( Logger::FATAL, msg, @progname, &block )
end
info( msg=nil, &block ) click to toggle source

Delegate info messages

# File lib/loggability/logger.rb, line 84
def info( msg=nil, &block )
        @logger.add( Logger::INFO, msg, @progname, &block )
end
inspect() click to toggle source

Return a human-readable string representation of the object, suitable for debugging.

# File lib/loggability/logger.rb, line 105
def inspect
        return "#<%p:%#016x for %s>" % [ self.class, self.object_id * 2, @progname ]
end
warn( msg=nil, &block ) click to toggle source

Delegate warn messages

# File lib/loggability/logger.rb, line 89
def warn( msg=nil, &block )
        @logger.add( Logger::WARN, msg, @progname, &block )
end

[Validate]

Generated with the Darkfish Rdoc Generator 2.