Module: UnitF::Log
- Defined in:
- lib/unitf/log.rb
Class Method Summary collapse
- .debug(message) ⇒ Object
- .error(message) ⇒ Object
- .fatal(message) ⇒ Object
- .info(message) ⇒ Object
- .logger ⇒ Object
- .to_console ⇒ Object
- .to_file(file, max_files = 3, max_size = 1024000) ⇒ Object
- .warn(message) ⇒ Object
Class Method Details
.debug(message) ⇒ Object
20 21 22 |
# File 'lib/unitf/log.rb', line 20 def debug() logger.debug() end |
.error(message) ⇒ Object
32 33 34 |
# File 'lib/unitf/log.rb', line 32 def error() logger.error() end |
.fatal(message) ⇒ Object
36 37 38 |
# File 'lib/unitf/log.rb', line 36 def fatal() logger.fatal() end |
.info(message) ⇒ Object
24 25 26 |
# File 'lib/unitf/log.rb', line 24 def info() logger.info() end |
.logger ⇒ Object
6 7 8 |
# File 'lib/unitf/log.rb', line 6 def logger @logger ||= UnitF::Logging::Logger.new end |
.to_console ⇒ Object
10 11 12 |
# File 'lib/unitf/log.rb', line 10 def to_console logger.add_writer(UnitF::Logging::ConsoleWriter.new) end |
.to_file(file, max_files = 3, max_size = 1024000) ⇒ Object
14 15 16 17 18 |
# File 'lib/unitf/log.rb', line 14 def to_file(file, max_files = 3, max_size = 1024000) logger.add_writer(UnitF::Logging::FileWriter.new(file, max_files: max_files, max_size: max_size)) rescue Errno::ENOENT => e logger.warn("Unble to create FileWriter for #{file}") end |
.warn(message) ⇒ Object
28 29 30 |
# File 'lib/unitf/log.rb', line 28 def warn() logger.warn() end |