Class: Wright::Logger

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

Overview

Public: Default logger for Wright.

Defined Under Namespace

Classes: Formatter

Instance Method Summary collapse

Constructor Details

#initialize(logdev = $stdout) ⇒ Logger

Public: Initialize a Logger.

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

logdev - The log device used by the Logger.



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

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

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