Module: Philiprehberger::StructuredLogger
- Defined in:
- lib/philiprehberger/structured_logger.rb,
lib/philiprehberger/structured_logger/logger.rb,
lib/philiprehberger/structured_logger/version.rb,
lib/philiprehberger/structured_logger/formatter.rb,
lib/philiprehberger/structured_logger/async_writer.rb
Defined Under Namespace
Modules: OutputBuilder Classes: AsyncWriter, Formatter, Logger, TextFormatter
Constant Summary collapse
- VERSION =
'0.4.0'
Class Method Summary collapse
Class Method Details
.resolve_formatter(formatter) ⇒ Object
51 52 53 54 55 56 57 58 59 60 61 |
# File 'lib/philiprehberger/structured_logger/formatter.rb', line 51 def self.resolve_formatter(formatter) case formatter when nil, :json then Formatter.new when :text then TextFormatter.new when Proc then formatter else raise ArgumentError, 'Invalid formatter' unless formatter.respond_to?(:call) formatter end end |