Closed e9x closed 1 year ago
Based on #26 except with an easier API.
Implementing an option feels annoying and it may be easier for users to determine the type of log based on an argument. However, I do understand why an object may be preferred.
Maybe the type for the logger can be made more explicit like:
export type Logger = typeof defaultLogger
export type Logger = ( type: "log" | "info" | "warn" | "error", ...data: any[] ) => void
And maybe a "name" field can be added so the user can filter through the type of log.
All the above can be easily implemented using this groundwork.
To elaborate on the name field:
Each transformer gets it's own context (or some proxy to the main context) with the transformer's name as a [TAG].
[transformers/stringdecoder] Found variable reference
Based on #26 except with an easier API.
Implementing an option feels annoying and it may be easier for users to determine the type of log based on an argument. However, I do understand why an object may be preferred.
Maybe the type for the logger can be made more explicit like:
And maybe a "name" field can be added so the user can filter through the type of log.
All the above can be easily implemented using this groundwork.