Class: Twiglet::Formatter
- Inherits:
-
Logger::Formatter
- Object
- Logger::Formatter
- Twiglet::Formatter
- Defined in:
- lib/twiglet/formatter.rb
Instance Method Summary collapse
- #call(severity, _time, _progname, msg) ⇒ Object
-
#initialize(service_name, validator:, default_properties: {}, context_provider: nil, context_providers: [], now: -> { Time.now.utc }) ⇒ Formatter
constructor
A new instance of Formatter.
Constructor Details
#initialize(service_name, validator:, default_properties: {}, context_provider: nil, context_providers: [], now: -> { Time.now.utc }) ⇒ Formatter
Returns a new instance of Formatter.
9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 |
# File 'lib/twiglet/formatter.rb', line 9 def initialize( service_name, validator:, default_properties: {}, context_provider: nil, context_providers: [], now: -> { Time.now.utc } ) @service_name = service_name @now = now @default_properties = default_properties @context_providers = context_provider ? [context_provider] : context_providers @validator = validator super() end |