moleculerjs / moleculer

:rocket: Progressive microservices framework for Node.js
https://moleculer.services/
MIT License
6.16k stars 586 forks source link

BrokerOptions typescript definition does not contain logFormatter property #1249

Open koldoon opened 1 year ago

koldoon commented 1 year ago

In typescript project I can't setup logFormatter. According to documentation:

const broker = new ServiceBroker({ 
    logFormatter(level, args, bindings) {
        return level.toUpperCase() + " " + bindings.nodeID + ": " + args.join(" ");
    }
});

Typescript says:

TS2345: Argument of type
{   logFormatter(level: any, args: any, bindings: any): string; }
is not assignable to parameter of type  BrokerOptions 
Object literal may only specify known properties, and  logFormatter  does not exist in type  BrokerOptions
icebob commented 1 year ago

the logFormatter is not a broker options, it's a Logger options as formatter. Maybe you see older version of Moleculer.