apparatus / mu

A message based router for building distributed systems
MIT License
26 stars 1 forks source link

don't JSON.stringify log objects #24

Closed davidmarkclements closed 8 years ago

davidmarkclements commented 8 years ago

I'm seeing this a lot:

    mu.log.debug('node: ' + muid + ' <- ' + JSON.stringify(msg))

That's going to JSON.stringify every time, even if the logging level is above debug

Instead let pino deal with it

    mu.log.debug('node: %s <- %j', muid, msg)

This way the object will only be (safely) stringified if logging is on

mcollina commented 8 years ago

This is already fixed in https://github.com/apparatus/mu/pull/21

davidmarkclements commented 8 years ago

ah sorry, thought that was already merged when I wrote this - good for posterity though