Module: Lita::Logger

Defined in:
lib/lita/logger.rb

Overview

Creates a Logger with the proper configuration.

Class Method Summary collapse

Class Method Details

.get_logger(level, formatter = Lita.config.robot.log_formatter) ⇒ ::Logger

Creates a new Logger outputting to standard error with the given severity level and a custom format.

Parameters:

  • level (Symbol, String)

    The name of the log level to use.

Returns:

  • (::Logger)

    The Logger object.


9
10
11
12
13
14
# File 'lib/lita/logger.rb', line 9

def get_logger(level, formatter = Lita.config.robot.log_formatter)
  logger = ::Logger.new(STDERR)
  logger.level = get_level_constant(level)
  logger.formatter = formatter
  logger
end