Class: Logdash::Logger

Inherits:
Object
  • Object
show all
Defined in:
lib/logdash/logger.rb

Constant Summary collapse

LOG_LEVEL_COLORS =
{
  Logdash::Types::LogLevel::ERROR => [231, 0, 11],
  Logdash::Types::LogLevel::WARN => [254, 154, 0],
  Logdash::Types::LogLevel::INFO => [21, 93, 252],
  Logdash::Types::LogLevel::HTTP => [0, 166, 166],
  Logdash::Types::LogLevel::VERBOSE => [0, 166, 0],
  Logdash::Types::LogLevel::DEBUG => [0, 166, 62],
  Logdash::Types::LogLevel::SILLY => [80, 80, 80]
}.freeze

Instance Method Summary collapse

Constructor Details

#initialize(log_sync: nil, prefix_proc: nil, on_log_proc: nil) ⇒ Logger

Returns a new instance of Logger.



30
31
32
33
34
# File 'lib/logdash/logger.rb', line 30

def initialize(log_sync: nil, prefix_proc: nil, on_log_proc: nil)
  @log_sync = log_sync
  @prefix_proc = prefix_proc || default_prefix_proc
  @on_log_proc = on_log_proc
end