From b668228eab3bcfe5f9708d8d95c009a880d7bd2f Mon Sep 17 00:00:00 2001 From: ColorFilter Date: Sat, 6 Apr 2024 20:32:58 +0900 Subject: [PATCH] =?UTF-8?q?=F0=9F=93=9D=20(logger.ts):=20improve=20error?= =?UTF-8?q?=20message=20formatting=20by=20replacing=20":=20"=20with=20"-"?= =?UTF-8?q?=20and=20adding=20square?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/config/logger.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/config/logger.ts b/src/config/logger.ts index 6df7736..d6e1a62 100644 --- a/src/config/logger.ts +++ b/src/config/logger.ts @@ -15,7 +15,7 @@ const ignorePrivate = format((info) => (info.private ? false : info)); const formatStackTrace = (stack: string, limit = 3) => { const [errorMessage, ...restLines] = stack.split('\n'); return [ - errorMessage.replace(': ', '-'), + errorMessage.replace(/(\w+):/g, '[$1]'), // "Error: This is ..." -> "[Error] This is ..." ...restLines.slice(0, limit).map((line) => `-> ${line}`), ].join('\n'); };