Class: GreenLog::Entry
- Inherits:
-
Object
- Object
- GreenLog::Entry
- Defined in:
- lib/green_log/entry.rb
Overview
Represents a structured log entry.
Defined Under Namespace
Classes: Builder
Class Method Summary collapse
Instance Method Summary collapse
Class Method Details
.build(severity, *args, &block) ⇒ Object
27 28 29 |
# File 'lib/green_log/entry.rb', line 27 def build(severity, *args, &block) Builder.new(severity).build(*args, &block) end |
.with(**args) ⇒ Object
16 17 18 19 20 21 22 23 24 25 |
# File 'lib/green_log/entry.rb', line 16 def with(**args) args[:severity] = Severity.resolve( args.fetch(:severity, Severity::INFO), ) args[:message] ||= nil args[:context] = args.fetch(:context, {}).to_loggable_value args[:data] = args.fetch(:data, {}).to_loggable_value args[:exception] ||= nil super(**args) end |
Instance Method Details
#in_context(extra_context) ⇒ Object
33 34 35 |
# File 'lib/green_log/entry.rb', line 33 def in_context(extra_context) with(context: extra_context.integrate(context).to_loggable_value) end |