diff --git a/src/log.cr b/src/log.cr index d9596f934eff..4b80e7bd89e4 100644 --- a/src/log.cr +++ b/src/log.cr @@ -54,7 +54,7 @@ # end # ``` # -# A `Log` will emit the messages to the `Log::Backends` attached to it as long as +# A `Log` will emit the messages to the `Log::Backend`s attached to it as long as # the configured severity filter `level` permits it. # # Logs can also be created from a type directly. For the type `DB::Pool` the source `db.pool` will be used. diff --git a/src/log/context.cr b/src/log/context.cr index 253d5e8d55f2..9cd7d9abe996 100644 --- a/src/log/context.cr +++ b/src/log/context.cr @@ -1,6 +1,6 @@ # Immutable structured context information for logging. # -# See `Log.context`, `Log.context=`, `Log::Context#clear`, `Log::Context#set`, `Log::Context#using`. +# See `Log.context`, `Log.context=`, `Log::Context#clear`, `Log::Context#set`, `Log.with_context`. class Log::Context Crystal.datum types: {bool: Bool, i: Int32, i64: Int64, f: Float32, f64: Float64, s: String, time: Time}, hash_key_type: String, immutable: true diff --git a/src/log/main.cr b/src/log/main.cr index 8b4c7dd848e3..1a609399b3df 100644 --- a/src/log/main.cr +++ b/src/log/main.cr @@ -130,11 +130,11 @@ class Log end # :ditto: - def set(values : NamedTuple) forall V + def set(values : NamedTuple) extend_fiber_context(Fiber.current, Log::Context.new(values)) end - private def extend_fiber_context(fiber : Fiber, values : Context) forall V + private def extend_fiber_context(fiber : Fiber, values : Context) context = fiber.logging_context fiber.logging_context = context.merge(values) end