Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

251
Views
JS: optional logger as part of the SDK that can be turned on/off

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?

about 4 years ago · Juan Pablo Isaza
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!