module Gallus::Logging

Internal: Programmers are lazy, why to initialize logger manually in language like Ruby, when you can use handy one-liner include to have logger available for your class. Example:

class Foo
  include Gallus::Logging

  def initialize
    log.debug("Initializing!")
  end
end

Gallus::Log.configure('Foo') do |log|
  log.level = :DEBUG
  log.output << Gallus::Output::Stdout.new(Gallus::Format::SimpleConsole.new)
end

Foo.new # => "DEBUG: Initializing!"

Public Class Methods

included(klass) click to toggle source
# File lib/gallus/logging.rb, line 21
def self.included(klass)
  klass.extend(ClassMethods)
end

Public Instance Methods

log() click to toggle source
# File lib/gallus/logging.rb, line 25
def log
  self.class.log
end