Class: Wurk::Logger
- Inherits:
-
Logger
- Object
- Logger
- Wurk::Logger
- Defined in:
- lib/wurk/logger.rb
Overview
Wurk’s stdlib-compatible ::Logger subclass. The point of subclassing (rather than configuring a vanilla ::Logger) is to ship default formatters that read the thread-local Wurk::Context so every line carries jid/bid/tags/elapsed without callers threading the hash through.
Formatter selection at boot:
- ENV["DYNO"] set → Formatters::WithoutTimestamp (Heroku already prefixes)
- otherwise → Formatters::Pretty
Switch to Formatters::JSON manually for log aggregators that want NDJSON.
Spec: docs/target/sidekiq-free.md §29.
Defined Under Namespace
Modules: Formatters
Instance Method Summary collapse
-
#initialize ⇒ Logger
constructor
A new instance of Logger.
Constructor Details
#initialize ⇒ Logger
Returns a new instance of Logger.
70 71 72 73 |
# File 'lib/wurk/logger.rb', line 70 def initialize(*, **) super self.formatter = default_formatter end |