macro call: info!(test = 1, test = 2, "Test message");
gives next message: {"timestamp":"2022-09-23T09:05:40.716435Z","level":"INFO","message":"Test message","test":1,"test":2,"target":"test"}
What I want is to make any macro call for any LEVEL in any place to produce additional fields:
so the same call: info!(test = 1, test = 2, "Test message");
will produce next message: {"timestamp":"2022-09-23T09:05:40.716435Z","level":"INFO","message":"Test message","test":1,"test":2,"target":"test", "global_field_0": "global_field_value_0", "global_field_1": "global_field_value_1"}.
Hi, sorry for late reply. I've just implemented trait FormatEvent from tracing_subscriber and use my implementation with tracing_subscriber::fmt::layer(). So I can add/remove/rename fields.
If I use span from main function those additional fields will be recorded in current_span or in a span_list and I need them to be on the same level as all other fields in event.