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.


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

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

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