Conversation
smusali
left a comment
There was a problem hiding this comment.
I think we should be able to provide the option to the customers to add properties one-by-one or group-by-group; so, in that case, having the followings would be nice:
addProperty(key, value)addProperties({ ... }) // key-value pairsremoveProperty(key)removeProperties([ ... ]) // list of keys - if undefined, delete all
I think, we should discuss this further.
Sounds good. But I think this additional optimization should be a separate PR not in this one anyway. |
Agree but you still have to rename the properties :) |
Add methods that would add and remove an ambient meta property to a logger. The ambient meta can be either a string or an object. If it is an object, it has to be json parseable and it will be parsed two levels deep and the rest will be stringified. (One of the levels is reserved for the 'ambientMeta' field)
If a logger which has an ambient meta sends a log message in a string representation, then that message will be transformed into an object: {message: {passed log line}, ambinetMeta: meta}.
If a logger which has an ambient meta sends a log message in an object representation, then this object will have an additional field - 'ambientMeta'.
Note: Addressing #29