Class: Brogger

Inherits:
Logger
  • Object
show all
Defined in:
lib/brogger.rb,
lib/brogger/null.rb,
lib/brogger/version.rb,
lib/brogger/timestamp_formatter.rb

Defined Under Namespace

Classes: Null, TimestampFormatter

Constant Summary collapse

LEVEL_MAPPING =

Low-level information for developers

{ debug: DEBUG,     # Low-level information for developers
  error: ERROR,     # A handleable error condition
  fatal: FATAL,     # An unhandleable error that results in a program crash
  info: INFO,       # Generic (useful) information about system operation
  unknown: UNKNOWN, # An unknown message that should always be logged
  warn: WARN        # A warning
}
VERSION =
"0.1.0"

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initializeBrogger

Returns a new instance of Brogger.



16
17
18
19
# File 'lib/brogger.rb', line 16

def initialize(*)
  super
  self.formatter = TimestampFormatter.new
end

Class Method Details

.versionObject



4
# File 'lib/brogger/version.rb', line 4

def self.version; VERSION; end

Instance Method Details

#level=(l) ⇒ Object



22
23
24
# File 'lib/brogger.rb', line 22

def level=(l)
  super (l.is_a?(Symbol) ? level_mapping.fetch(l, UNKNOWN) : l)
end