class

Logger::Application

v1_9_1_378 - Show latest stable - Superclass: Object

Description

Application – Add logging support to your application.

Usage

  1. Define your application class as a sub-class of this class.

  2. Override ‘run’ method in your class to do many things.

  3. Instantiate it and invoke ‘start’.

Example

class FooApp < Application
  def initialize(foo_app, application_specific, arguments)
    super('FooApp') # Name of the application.
  end

  def run
    ...
    log(WARN, 'warning', 'my_method1')
    ...
    @log.error('my_method2') { 'Error!' }
    ...
  end
end

status = FooApp.new(....).start

Included modules

  • Logger::Severity

Attributes

[R]appname

Files

  • lib/logger.rb