Class: Wright::Logger

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

Overview

Default logger for Wright.

Defined Under Namespace

Classes: Formatter

Instance Method Summary collapse

Constructor Details

#initialize(logdev = $stdout) ⇒ Logger

Initializes a Logger.

Enables log colorization if the log device is a TTY and colorization was not disabled before initialization.

Parameters:

  • logdev (IO) (defaults to: $stdout)

    the log device used by the Logger.



58
59
60
61
62
63
64
# File 'lib/wright/logger.rb', line 58

def initialize(logdev = $stdout)
  super
  Wright::Config[:log] ||= {}
  return if Wright::Config[:log].key?(:colorize)

  Wright::Config[:log][:colorize] = logdev.tty?
end