Skip to content

Commit

Permalink
Tidy up some leftovers of crystal-lang#8847
Browse files Browse the repository at this point in the history
  • Loading branch information
bcardiff committed Mar 30, 2020
1 parent d37e10d commit e04383e
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 4 deletions.
2 changes: 1 addition & 1 deletion src/log.cr
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down
2 changes: 1 addition & 1 deletion src/log/context.cr
Original file line number Diff line number Diff line change
@@ -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

Expand Down
4 changes: 2 additions & 2 deletions src/log/main.cr
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit e04383e

Please sign in to comment.