Class: Bauxite::Loggers::NullLogger
- Inherits:
-
Object
- Object
- Bauxite::Loggers::NullLogger
- Defined in:
- lib/bauxite/core/logger.rb
Overview
Test logger class.
Test loggers handle test output format.
The default logger does not provide any output logging.
This default behavior can be overriden in a custom logger passed to the Context constructor (see Context::new). By convention, custom loggers are defined in the ‘loggers/’ directory.
Direct Known Subclasses
Instance Method Summary collapse
-
#debug_prompt ⇒ Object
Returns the prompt shown by the debug console (see Context#debug).
-
#finalize(ctx) ⇒ Object
Completes the log execution.
-
#initialize(options) ⇒ NullLogger
constructor
Constructs a new null logger instance.
-
#log(s, type = :info) ⇒ Object
Logs the specified string.
-
#log_cmd(action) ⇒ Object
Executes the given block in a logging context.
-
#progress(value) ⇒ Object
Updates the progress of the current action.
Constructor Details
#initialize(options) ⇒ NullLogger
Constructs a new null logger instance.
44 45 46 |
# File 'lib/bauxite/core/logger.rb', line 44 def initialize() = end |
Instance Method Details
#debug_prompt ⇒ Object
Returns the prompt shown by the debug console (see Context#debug).
For example:
log.debug_prompt
# => returns the debug prompt
68 69 70 |
# File 'lib/bauxite/core/logger.rb', line 68 def debug_prompt 'debug> ' end |
#finalize(ctx) ⇒ Object
Completes the log execution.
87 88 |
# File 'lib/bauxite/core/logger.rb', line 87 def finalize(ctx) end |
#log(s, type = :info) ⇒ Object
Logs the specified string.
type, if specified, should be one of :error, :warning, :info (default), :debug.
81 82 83 |
# File 'lib/bauxite/core/logger.rb', line 81 def log(s, type = :info) print s end |
#log_cmd(action) ⇒ Object
Executes the given block in a logging context.
This default implementation does not provide any logging capabilities.
For example:
log.log_cmd('echo', 'Hello World!') do
puts 'Hello World!'
end
# => echoes 'Hello World!'
59 60 61 |
# File 'lib/bauxite/core/logger.rb', line 59 def log_cmd(action) yield end |
#progress(value) ⇒ Object
Updates the progress of the current action.
73 74 |
# File 'lib/bauxite/core/logger.rb', line 73 def progress(value) end |