Empresas
Empleos
  • Sobre nosotros
  • Soluciones
    • Publicación de vacantes
      Publica tu vacante y recibe candidatos calificados en 48h.
    • Evaluación de candidatos
      500+ pruebas técnicas y psicológicas, más anti-fraude.
    • Headhunting
      Búsqueda ejecutiva a la medida de principio a fin.
    • Nómina + EOR
      Dispersión de nómina y EOR en más de 15 países de LATAM.
  • Precios
  • Empleos

0

253
Vistas
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
Responde la pregunta
Encuentra empleos remotos

¡Descubre la nueva forma de encontrar empleo!

Top de empleos
Top categorías de empleo
Empresas
Publicar vacante Precios Comercial
Legal
Términos y condiciones Política de privacidad
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomiéndame algunas ofertas
Necesito ayuda