logmessage-cls-hooked
Version:
A LogRoot Method Decorator that uses cls-hooked to handle and propagate log message details between different methods deeper in the callstack, removing the need to propagate a paremeter just for logging purposes
11 lines (10 loc) • 446 B
TypeScript
import { TValidValues } from "./constants";
/**
* Adds a new value to a key to the current active log context
* If the value already holds a array, it appends a new item
* If the value is not yet a array, it's converted into one
* If the value has never been sets, it's get initialized
* @param {string} key
* @param {string | number | boolean | Date} value
*/
export declare const appendOnLog: (key: string, value: TValidValues) => void;