class Logger

def initialize(logdev, shift_age = 0, shift_size = 1048576, level: DEBUG,


The default is to swallow all exceptions raised.
be reraised if there is an error when writing to the log device.
- +reraise_write_errors+: An array of exception classes, which will
See {Periodic Rotation}[rdoc-ref:Logger@Periodic+Rotation].
for periodic log file rotation; default is '%Y%m%d'.
- +shift_period_suffix+: sets the format for the filename suffix
default is +false+.
- +binmode+: sets whether the logger writes in binary mode;
See #datetime_format=.
default is +nil+.
- +datetime_format+: sets the format for entry timestamp;
See {formatter=}[Logger.html#attribute-i-formatter].
- +formatter+: sets the entry formatter; default is +nil+.

Logger.new('t.log', progname: 'mung')

See {Program Name}[rdoc-ref:Logger@Program+Name]:
- +progname+: sets the default program name; default is +nil+.

Logger.new('t.log', level: Logger::ERROR)

See {Log Level}[rdoc-ref:Logger@Log+Level]:
- +level+: sets the log level; default value is Logger::DEBUG.

The keyword options are:

Logger.new($stdout)
Logger.new('t.log')

Examples:

- +nil+ or +File::NULL+: no entries are to be written.
entries are to be written to the given stream.
- An IO stream (typically +$stdout+, +$stderr+. or an open file):
new entries are appended.
to the file at that path; if the file at that path exists,
- A string filepath: entries are to be written

Argument +logdev+ must be one of:

Logger.new('t.log') # => #

returns a new logger with all default options:
With the single argument +logdev+,

Logger.new(logdev, shift_age = 0, shift_size = 1048576, **options)
:call-seq:
def initialize(logdev, shift_age = 0, shift_size = 1048576, level: DEBUG,
               progname: nil, formatter: nil, datetime_format: nil,
               binmode: false, shift_period_suffix: '%Y%m%d',
               reraise_write_errors: [])
  self.level = level
  self.progname = progname
  @default_formatter = Formatter.new
  self.datetime_format = datetime_format
  self.formatter = formatter
  @logdev = nil
  @level_override = {}
  if logdev && logdev != File::NULL
    @logdev = LogDevice.new(logdev, shift_age: shift_age,
      shift_size: shift_size,
      shift_period_suffix: shift_period_suffix,
      binmode: binmode,
      reraise_write_errors: reraise_write_errors)
  end
end