I'm writing an SDK and I'd like to have a bunch of logs in there that can be turned on/off by the user of the SDK.
Currently I have this in my index.ts:
winston.configure({
level: (process.env.DEBUG || process.env.VUE_APP_DEBUG) ? 'debug' : 'info',
format: winston.format.combine(
winston.format.json(),
winston.format.prettyPrint(),
winston.format.colorize({ all: true }),
),
transports: [
new winston.transports.Console(),
],
});
I was hoping that just by installing the package with npm and having a DEBUG or VUE_APP_DEBUG variable in the .env file of the user, the logger would turn on/off.
Alas this doesn't work:) What's the right way to do it?