------------program1.ts
consumerGroup.on('message',function(msgc){
uuid=uuid();
program2.func2(uuid,msgc);
});
------Program2.ts
function func2(uuid,msgc){
logger.log(uuid,msgc);
program3.func3(uuid,msgc);
}
-----------program3.ts
function func(uuid,msgc){
logger.log(uuid,msgc);
}
I have to implement UUID in the logger for each message read from the consumer in an existing project. I came up similar to the above code approach but there are lots of sub-functions and I would have to do it for each and every function/logger call.
Is there any better way to do it?
question from:https://stackoverflow.com/questions/65625737/how-to-add-uuid-in-logger-better-way