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

150
Views
Implementing a MessageTemplate to String

I'm working on an angular project in which the HTML is embedded in a device.. not a traditional web browser of a computer. Anyway I need to send a logging mechanism to a host device that is acting as a server of sorts.

I got the service running and it is working. I can send messages back and forth. I need to do a structured logging and was wondering if there are existing packages already available instead of writing my own.

So something like this:

JAVASCRIPT:

export class LogEvent
{
    constructor(logLevel: any, messageTemplate: string , exception? : any , args? : any[])
    {
        this.Level = logLevel;
        this.MessageTemplate = messageTemplate;
        this.Exception = exception;
        if (args) this.Properties = [... args];
    }
    toString() : string {
        //this is what i Need.. to convert props into strings embeded into the 
        //MessageTemplate
    }
}
var someValue = 1234;
var msgT = "A message {someValue}";
var event = LogEvent(verbose, msgT, null, someValue);
var str = event.toString()
// expected str to be 'A message 1234'

the npm pacakage @messageformat/parser will parse the messageTemplate but i havent seen a method to actually create the message with the values inserted into the message template.

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!