Class: CASClient::Logger

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

Overview

Customized logger for the client. This is useful if you’re trying to do logging in Rails, since Rails’ clean_logger.rb pretty much completely breaks the base Logger class.

Defined Under Namespace

Classes: Formatter

Instance Method Summary collapse

Constructor Details

#initialize(logdev, shift_age = 0, shift_size = 1048576) ⇒ Logger

Returns a new instance of Logger.



23
24
25
26
# File 'lib/casclient.rb', line 23

def initialize(logdev, shift_age = 0, shift_size = 1048576)
  @default_formatter = Formatter.new
  super
end

Instance Method Details

#breakObject



32
33
34
# File 'lib/casclient.rb', line 32

def break
  self << $/
end

#format_message(severity, datetime, progrname, msg) ⇒ Object



28
29
30
# File 'lib/casclient.rb', line 28

def format_message(severity, datetime, progrname, msg)
  (@formatter || @default_formatter).call(severity, datetime, progname, msg)
end