cache-memory
Version:
Node module for in memory caching
25 lines • 686 B
JavaScript
;
Object.defineProperty(exports, "__esModule", { value: true });
exports.log = void 0;
const debug = require('debug')('cache-memory');
/**
* Logs a debug message
* @param message to log
* @param loggingObj Object to log details about
*/
const log = (message, loggingObj) => {
if (!debug.enabled)
return;
if (loggingObj !== undefined && typeof loggingObj === 'object') {
let toLog = message;
Object.keys(loggingObj).forEach(key => {
toLog += `, ${key}: ${JSON.stringify(loggingObj[key])}`;
});
debug(toLog);
}
else {
debug(message);
}
};
exports.log = log;
//# sourceMappingURL=logger.js.map