Class: Pione::Log::DelegatableLogger
Overview
DelegatableLogger delegates logging functions to another logger.
Instance Attribute Summary
Attributes inherited from BasicLogger
#level
Instance Method Summary
collapse
-
#debug(msg, pos = caller(1).first, pid = Process.pid) ⇒ Object
-
#error(msg, pos = caller(1).first, pid = Process.pid) ⇒ Object
-
#fatal(msg, pos = caller(1).first, pid = Process.pid) ⇒ Object
-
#info(msg, pos = caller(1).first, pid = Process.pid) ⇒ Object
-
#initialize(logger) ⇒ DelegatableLogger
constructor
A new instance of DelegatableLogger.
-
#terminate ⇒ Object
-
#warn(msg, pos = caller(1).first, pid = Process.pid) ⇒ Object
#level, #level=, of, #queued?, register
Constructor Details
Returns a new instance of DelegatableLogger.
123
124
125
126
127
|
# File 'lib/pione/log/system-log.rb', line 123
def initialize(logger)
super()
@logger = logger
end
|
Instance Method Details
#debug(msg, pos = caller(1).first, pid = Process.pid) ⇒ Object
145
146
147
|
# File 'lib/pione/log/system-log.rb', line 145
def debug(msg, pos=caller(1).first, pid=Process.pid)
send_message(:debug, msg, pos, pid) {@logger.debug(msg, pos, pid)}
end
|
#error(msg, pos = caller(1).first, pid = Process.pid) ⇒ Object
133
134
135
|
# File 'lib/pione/log/system-log.rb', line 133
def error(msg, pos=caller(1).first, pid=Process.pid)
send_message(:error, msg, pos, pid) {@logger.error(msg, pos, pid)}
end
|
#fatal(msg, pos = caller(1).first, pid = Process.pid) ⇒ Object
129
130
131
|
# File 'lib/pione/log/system-log.rb', line 129
def fatal(msg, pos=caller(1).first, pid=Process.pid)
send_message(:fatal, msg, pos, pid) {@logger.fatal(msg, pos, pid)}
end
|
#info(msg, pos = caller(1).first, pid = Process.pid) ⇒ Object
141
142
143
|
# File 'lib/pione/log/system-log.rb', line 141
def info(msg, pos=caller(1).first, pid=Process.pid)
send_message(:info, msg, pos, pid) {@logger.info(msg, pos, pid)}
end
|
#terminate ⇒ Object
149
150
151
|
# File 'lib/pione/log/system-log.rb', line 149
def terminate
@logger = nil
end
|
#warn(msg, pos = caller(1).first, pid = Process.pid) ⇒ Object
137
138
139
|
# File 'lib/pione/log/system-log.rb', line 137
def warn(msg, pos=caller(1).first, pid=Process.pid)
send_message(:warn, msg, pos, pid) {@logger.warn(msg, pos, pid)}
end
|