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

130
Views
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
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!