You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
When logging an object with the human formatter, I see that the output is different in nested object keys and values, vs. root ones:
keys are quoted in nested objects, and not quoted in the root
string are not quoted if they're values of root fields
empty arrays are not logged if they're values of root fields
importlogfrom'bristol';log.addTarget('console').withFormatter('human');constobject={rootString: 'key name not quoted, string should be quoted',nested: {string: 'string is quoted, and so is the key',array: [],// empty array correctly logged},array: [],// nothing logged};log.info('Unquoted strings',object);
Output:
[2019-05-26 00:30:47] INFO: Inconsistent output (file:///.../bristol.mjs:13)
rootString: key name not quoted, string should be quoted
nested:
{
"string": "string is quoted, and so is the key",
"array": []
}
array:
The text was updated successfully, but these errors were encountered:
dandv
changed the title
Inconsistent string quoting with the human formatter
Inconsistent nested field logging with the human formatter
May 26, 2019
When logging an object with the human formatter, I see that the output is different in nested object keys and values, vs. root ones:
Output:
The text was updated successfully, but these errors were encountered: