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

131
Vistas
condition inside winston format

I want to create a html file using winston, where the text is colored according to information level (red for errors, blue for info, etc.) I wanted to add something like this: winston.format.printf( info => <div style="color: ${info.level} === error ? 'red' : 'green';">${info.timestamp} ${info.level}: ${info.message}<\div>, ),);

But of course it just prints the condition into the html like this:

2022-03-08T13:48:47.162Z info: this is info message 2022-03-08T13:48:47.164Z error: this is error message

so what I actually need is to plant the javascript condition into the html. Can this be done?

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