Empresas
Empregos
  • Sobre nós
  • Soluções
    • Publicação de vagas
      Publique sua vaga e receba candidatos qualificados em 48h.
    • Avaliações de candidatos
      Mais de 500 testes técnicos e psicológicos, mais anti-fraude.
    • Headhunting
      Busca executiva personalizada do início ao fim.
    • Folha de Pagamento + EOR
      Dispersão de folha e EOR em mais de 15 países da LATAM.
  • Preços
  • Empregos

0

252
Visualizações
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 à pergunta
Encontrar trabalhos remotos

Descubra a nova forma de encontrar um emprego!

melhores empregos
Principais categorias de trabalho
Empresas
Postar vaga Preços Comercial
Jurídico
Termos e Condições Política de privacidade
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomende algumas ofertas para mim
Preciso de ajuda