Open paarthenon opened 2 years ago
I think it would be a good idea to leverage the existing social chain. In the line logger, the order of the items matters, but in the object logger presence will be used to determine whether or not to log that aspect.
Because daslog can accept appender factories, it's actually super easy to create a logger that expects an object instead. But this isn't clearly laid out anywhere and it would be best to create something that satisfies the use case of 90% of people who want structured logging.
So, to that end,
(message: string, Record<string, any>) => void
data({...})
that can be tossed in anywhere in a log message to render those items. They will show as an object in the case of the line logger or we will log them as distinct fields if using the data logger.