We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Logging modifies the original hash passed into it.
irb(main):001:0> require 'twiglet/logger' => true irb(main):002:0> require_relative '../app/logging' => true irb(main):003:0> logger = Logging.logger => #<Twiglet::Logger:0x000000012b22c118 @service_name="abc", @args={}, @validator=#<Twiglet::Validator:0x000000012b227f50 @schema={"type"=>"object", "required"=>["message"], "properties"=>{"m... irb(main):004:0> hash = { "message": "hi" } => {:message=>"hi"} irb(main):005:0> hash => {:message=>"hi"} irb(main):006:0> hash["foo"] = "bar" => "bar" irb(main):007:0> hash => {:message=>"hi", "foo"=>"bar"} irb(main):008:0> logger.warn hash {"ecs":{"version":"1.5.0"},"@timestamp":"2022-10-11T15:20:11.354Z","service":{"name":"abc"},"log":{"level":"warn"},"message":"hi","foo":"bar"} => true irb(main):009:0> hash => {:message=>"hi", :foo=>"bar"} irb(main):010:0>
So that Twiglet doesn't modify things passed to it as no one would expect a logger to have such a side effect.
Replicate the code from the "What" section above. Try and see why it causes that. Fix it.
The text was updated successfully, but these errors were encountered:
No branches or pull requests
What
Logging modifies the original hash passed into it.
Why
So that Twiglet doesn't modify things passed to it as no one would expect a logger to have such a side effect.
How
Replicate the code from the "What" section above. Try and see why it causes that. Fix it.
ACs
The text was updated successfully, but these errors were encountered: