diff --git a/src/core/utils/logger.ts b/src/core/utils/logger.ts index 06d2c13..d6e1ca1 100644 --- a/src/core/utils/logger.ts +++ b/src/core/utils/logger.ts @@ -27,9 +27,10 @@ export class Logger { }, format(level, name, timestamp) { const [, , , caller] = callsites(); - const stack = caller.toString(); - const from = caller.getFunctionName() || stack.substring(0, stack.indexOf(".")); - return `${chalk.gray(`${timestamp}`)} ${COLORS[level.toUpperCase()](level)} ${chalk.yellow.bold(from)}:`; + const file = caller.toString(); + const func = caller.getFunctionName(); + const fn = func ? ` ${file.substring(0, file.indexOf("(")).trim()}:` : ""; + return `${chalk.gray(timestamp)} ${COLORS[level.toUpperCase()](level)}${chalk.magenta(fn)}`; } }); }