ddstats-server/libs/utils/log.js

14 lines
448 B
JavaScript
Raw Normal View History

2021-10-06 20:36:20 +02:00
/**
* This function creates a custom logging method that adds a prefix evrytime used.
* This is so that you can see what component has done what.
* Example:
* The database-component would log with the prefix 'database'
*
* @param {string} prefix The prefix for the logging-function.
* @returns {function} The created log function.
*/
2021-09-29 20:29:06 +02:00
export default function initLog(prefix) {
return string => console.log(`${prefix} >>> ${string}`)
2021-10-31 21:24:55 +01:00
}