Occasionally I forget (i.e., when interactive) to set log_formatter(formatter_json). When this happens, any log messages that use named arguments will be blank. For instance,
log_info(quux="foo", a=pi)
# INFO [2023-11-18 19:50:26]
where the initial intent was to have this:
log_formatter(formatter_json)
log_info(quux="foo", a=pi)
# INFO [2023-11-18 19:50:54] {"quux":"foo","a":3.1416}
I'm fine with the fact that part of the reason is that I forgot the formatter, but it would be nice if formatter_glue did not drop named arguments. I suggest the names can be dropped, and pasted together (with a space). Something like:
log_formatter(formatter_glue)
log_info(quux="foo", a=pi)
# INFO [2023-11-18 19:52:12] foo 3.14159265358979
Edit ... as I'm thinking about this, the purpose and layout of glue is rather simple, where unnamed objects are strings to format, and named objects are variables to use for substitution ... so I think the paste-ing above should only be done when none of ... are unnamed ... or perhaps just assume the first or first character or similar.
Bottom line, having it completely drop the message is perhaps not good. Thoughts?
Occasionally I forget (i.e., when interactive) to set
log_formatter(formatter_json). When this happens, any log messages that use named arguments will be blank. For instance,where the initial intent was to have this:
I'm fine with the fact that part of the reason is that I forgot the formatter, but it would be nice if
formatter_gluedid not drop named arguments. I suggest the names can be dropped, and pasted together (with a space). Something like:Edit ... as I'm thinking about this, the purpose and layout of
glueis rather simple, where unnamed objects are strings to format, and named objects are variables to use for substitution ... so I think thepaste-ing above should only be done when none of...are unnamed ... or perhaps just assume the first or first character or similar.Bottom line, having it completely drop the message is perhaps not good. Thoughts?