From ee046dfb5f98b044800f74e948b1c56389c59885 Mon Sep 17 00:00:00 2001 From: Dzianis Dashkevich Date: Wed, 20 Sep 2023 12:48:43 -0400 Subject: [PATCH] feat: add createNewLogger method --- src/js/utils/create-logger.js | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/src/js/utils/create-logger.js b/src/js/utils/create-logger.js index 80edfc8ab4..9fb260a95d 100644 --- a/src/js/utils/create-logger.js +++ b/src/js/utils/create-logger.js @@ -134,6 +134,21 @@ export default function createLogger(name, delimiter = ':', styles = '') { return createLogger(resultName, resultDelimiter, resultStyles); }; + /** + * Create a new logger. + * + * @param {string} newName + * The name for the new logger + * @param {string} [newDelimiter] + * Optional delimiter + * @param {string} [newStyles] + * Optional styles + * @return {Object} + */ + log.createNewLogger = (newName, newDelimiter, newStyles) => { + return createLogger(newName, newDelimiter, newStyles); + }; + /** * Enumeration of available logging levels, where the keys are the level names * and the values are `|`-separated strings containing logging methods allowed