Module: Thrifty::Logger

Defined in:
lib/thrifty/logger.rb,
lib/thrifty/logger/app.rb,
lib/thrifty/logger/entry.rb,
lib/thrifty/logger/context.rb,
lib/thrifty/logger/appenders/io_appender.rb,
lib/thrifty/logger/formatters/logfmt_formatter.rb,
lib/thrifty/logger/formatters/simple_formatter.rb,
lib/thrifty/logger/exception_handlers/stderr_exception_handler.rb

Defined Under Namespace

Classes: App, Context, Entry, ExceptionEntry, IoAppender, LogfmtFormatter, SimpleFormatter, StderrExceptionHanlder

Constant Summary collapse

TRACE =
0
DEBUG =
1
INFO =
2
WARN =
3
ERROR =
4
FATAL =
5
LEVELS =
['TRACE', 'DEBUG', 'INFO', 'WARN', 'ERROR', 'FATAL'].freeze

Class Method Summary collapse

Instance Method Summary collapse

Class Method Details

.get_logger(scope, context = nil) ⇒ Object



11
12
13
14
# File 'lib/thrifty/logger.rb', line 11

def self.get_logger(scope, context = nil)
  App.instance.start unless App.instance.started?
  Context.new(App.instance, scope.to_s, context)
end

.stopObject



16
17
18
# File 'lib/thrifty/logger.rb', line 16

def self.stop
  App.instance.stop
end

Instance Method Details

#io_appender(*args) ⇒ Object



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

def io_appender(*args)
  IoAppender.new(*args)
end

#logfmt_formatterObject



20
21
22
# File 'lib/thrifty/logger.rb', line 20

def logfmt_formatter
  LogfmtFormatter.new
end

#simple_formatterObject



24
25
26
# File 'lib/thrifty/logger.rb', line 24

def simple_formatter
  SimpleFormatter.new
end