Skip to content

Commit

Permalink
TECH-12593: add blank line
Browse files Browse the repository at this point in the history
  • Loading branch information
ColinDKelley committed Aug 31, 2023
1 parent 2203516 commit e0f49aa
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 9 deletions.
1 change: 1 addition & 0 deletions lib/contextual_logger.rb
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,7 @@ def normalize_message(message)

module LoggerMixin
include Context

delegate :register_secret, :register_secret_regex, to: :redactor

def global_context
Expand Down
23 changes: 14 additions & 9 deletions spec/lib/contextual_logger/context_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -19,20 +19,25 @@ class ContextualLoggerContextSpecContainer
it 'can be set with current_context=, separately per Fiber/Thread' do
instance.current_context = context

Thread.new do
instance.current_context = context2
expect(instance.current_context({})).to eq(context2)
end.value
thread =
Thread.new do
instance.current_context = context2
expect(instance.current_context({})).to eq(context2)
end

Fiber.new do
instance.current_context = context3
expect(instance.current_context({})).to eq(context3)
end.resume
fiber =
Fiber.new do
instance.current_context = context3
expect(instance.current_context({})).to eq(context3)
end

fiber.resume
thread.join

expect(instance.current_context({})).to eq(context)
end

it 'the current_context= values are separately per containing instance' do
it 'the current_context= values are separate per containing instance' do
instance.current_context = context
instance2 = ContextualLoggerContextSpecContainer.new
instance2.current_context = context2
Expand Down

0 comments on commit e0f49aa

Please sign in to comment.