class Main::Logger

because active_record fubars the hell out of Logger ;-(

Public Class Methods

new(*a, &b) click to toggle source
Calls superclass method
# File lib/main/logger.rb, line 4
def self.new *a, &b
  super(*a, &b).instance_eval{ @default_formatter = @formatter = Formatter.new; self }
end
off(*a, &b) click to toggle source
# File lib/main/logger.rb, line 36
def self.off *a, &b
  new(*a, &b).instance_eval{ turn :off; self }
end
on(*a, &b) click to toggle source
# File lib/main/logger.rb, line 28
def self.on *a, &b
  new(*a, &b).instance_eval{ turn :on; self }
end

Public Instance Methods

device() click to toggle source
# File lib/main/logger.rb, line 11
def device
  @logdev.instance_eval{ @dev }
end
format_message(severity, datetime, progname, msg) click to toggle source
# File lib/main/logger.rb, line 7
def format_message(severity, datetime, progname, msg)
  (@formatter || @default_formatter).call(severity, datetime, progname, msg)
end
off() click to toggle source
# File lib/main/logger.rb, line 32
def off
  turn :off
end
on() click to toggle source
# File lib/main/logger.rb, line 24
def on
  turn :on
end
tty?() click to toggle source
# File lib/main/logger.rb, line 15
def tty?
  device.respond_to?('tty?') and device.tty?
end
turn(which) click to toggle source
# File lib/main/logger.rb, line 19
def turn which
  @logdev.extend OnOff unless OnOff === @logdev
  @logdev.turn which
end