How do I specify the parent caller as the path to log out when `src` is enabled?
a3957273 opened this issue · 1 comments
a3957273 commented
We use a helper function to log messages to both our server log, as well as a log that clients can see. It's essentially:
function our_log(data: any, message: string) {
// log using bunyan
log.info({ requestId, ...data }, message)
// log to client
database.append_log_to_client(message)
}
This works well, but breaks when we set src: true
in our Bunyan configuration. Suddenly, all log lines think they're coming from our_log
, instead of the callee function. Is there a way to tell Bunyan to log the src as being x
stack frames higher up the call stack?