Module: Console::Interface
Overview
The public logger interface.
Class Method Summary collapse
-
.local ⇒ Object
Create a new (thread local) logger instance.
Instance Method Summary collapse
-
#call ⇒ Object
Emit a log message with arbitrary arguments and options.
-
#debug ⇒ Object
Emit a debug log message.
-
#error ⇒ Object
Emit an error log message.
-
#fatal ⇒ Object
Emit a fatal log message.
-
#info ⇒ Object
Emit an informational log message.
-
#logger ⇒ Object
Get the current logger instance.
-
#logger=(instance) ⇒ Object
Set the current logger instance.
-
#warn ⇒ Object
Emit a warning log message.
Class Method Details
.local ⇒ Object
Create a new (thread local) logger instance.
15 16 17 |
# File 'lib/console/interface.rb', line 15 def self.local Config::DEFAULT.make_logger end |
Instance Method Details
#call ⇒ Object
Emit a log message with arbitrary arguments and options.
57 58 59 |
# File 'lib/console/interface.rb', line 57 def call(...) Interface.instance.call(...) end |
#debug ⇒ Object
Emit a debug log message.
32 33 34 |
# File 'lib/console/interface.rb', line 32 def debug(...) Interface.instance.debug(...) end |
#error ⇒ Object
Emit an error log message.
47 48 49 |
# File 'lib/console/interface.rb', line 47 def error(...) Interface.instance.error(...) end |
#fatal ⇒ Object
Emit a fatal log message.
52 53 54 |
# File 'lib/console/interface.rb', line 52 def fatal(...) Interface.instance.fatal(...) end |
#info ⇒ Object
Emit an informational log message.
37 38 39 |
# File 'lib/console/interface.rb', line 37 def info(...) Interface.instance.info(...) end |
#logger ⇒ Object
Get the current logger instance.
20 21 22 |
# File 'lib/console/interface.rb', line 20 def logger Interface.instance end |
#logger=(instance) ⇒ Object
Set the current logger instance.
The current logger instance is assigned per-fiber.
27 28 29 |
# File 'lib/console/interface.rb', line 27 def logger= instance Interface.instance= instance end |
#warn ⇒ Object
Emit a warning log message.
42 43 44 |
# File 'lib/console/interface.rb', line 42 def warn(...) Interface.instance.warn(...) end |