From 0ab9153e407cafd07af8b77b63e25c8d21b474c0 Mon Sep 17 00:00:00 2001 From: Ali Mihandoost Date: Mon, 14 Nov 2022 10:34:03 +0330 Subject: [PATCH 1/3] fix(logger): message format in node --- packages/core/logger/src/logger.ts | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/packages/core/logger/src/logger.ts b/packages/core/logger/src/logger.ts index d153f48db..34cb0b9eb 100644 --- a/packages/core/logger/src/logger.ts +++ b/packages/core/logger/src/logger.ts @@ -129,12 +129,12 @@ export const createLogger = ( scope, accident: isBrowser - ? console.warn.bind(console, '%c%s%c.%s "%s" => Accident: "%s" (%s)!', styleScope, scope, style.reset) - : console.warn.bind(console, `${styleScope}⚠️ %s\x1b[33m.%s "%s" =>${style.reset}`, scope), + ? console.warn.bind(console, '%c%s%c.%s() "%s" => Accident: "%s" (%s)!', styleScope, scope, style.reset) + : console.warn.bind(console, `${styleScope}⚠️ %s\x1b[33m.%s() "%s" =>${style.reset}`, scope), error: isBrowser - ? console.error.bind(console, '%c%s%c.%s "%s" =>', styleScope, scope, style.reset) - : console.error.bind(console, `${styleScope}❌ %s\x1b[31m.%s "%s" =>\x1b[0;2m`, scope), + ? console.error.bind(console, '%c%s%c.%s() "%s" =>', styleScope, scope, style.reset) + : console.error.bind(console, `${styleScope}❌ %s\x1b[31m.%s() "%s" =>\x1b[0;2m`, scope), }; if (!debug) { @@ -163,7 +163,7 @@ export const createLogger = ( incident: isBrowser ? console.log.bind(console, '%c%s%c.%s() => Incident: "%s" (%s)!', styleScope, scope, style.reset) - : console.log.bind(console, `${styleScope}🔸 %s${style.reset}.%s() => Incident: "%s" (%s)!\x1b[0;2m`, scope), + : console.log.bind(console, `${styleScope}⚠️ %s${style.reset}.%s() => Incident: "%s" (%s)!\x1b[0;2m`, scope), logOther: console.debug.bind(console, keySection, styleScope, scope, style.reset), }; From 1a35ac4bbb9aae4280ea99b8383459cf44de0baa Mon Sep 17 00:00:00 2001 From: Ali Mihandoost Date: Sat, 19 Nov 2022 15:29:33 +0330 Subject: [PATCH 2/3] feat(logger): better log in browser and node --- packages/core/logger/src/logger.ts | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/packages/core/logger/src/logger.ts b/packages/core/logger/src/logger.ts index 34cb0b9eb..a103c21be 100644 --- a/packages/core/logger/src/logger.ts +++ b/packages/core/logger/src/logger.ts @@ -129,12 +129,12 @@ export const createLogger = ( scope, accident: isBrowser - ? console.warn.bind(console, '%c%s%c.%s() "%s" => Accident: "%s" (%s)!', styleScope, scope, style.reset) - : console.warn.bind(console, `${styleScope}⚠️ %s\x1b[33m.%s() "%s" =>${style.reset}`, scope), + ? console.warn.bind(console, '%c%s%c.%s() Accident `%s` %s!', styleScope, scope, style.reset) + : console.warn.bind(console, `${styleScope}⚠️\n%s\x1b[33m.%s() Accident \`%s\` %s!${style.reset}`, scope), error: isBrowser - ? console.error.bind(console, '%c%s%c.%s() "%s" =>', styleScope, scope, style.reset) - : console.error.bind(console, `${styleScope}❌ %s\x1b[31m.%s() "%s" =>\x1b[0;2m`, scope), + ? console.error.bind(console, '%c%s%c.%s() Error `%s`\n', styleScope, scope, style.reset) + : console.error.bind(console, `${styleScope}❌\n%s\x1b[31m.%s() Error \`%s\`${style.reset}\n`, scope), }; if (!debug) { @@ -159,11 +159,11 @@ export const createLogger = ( logMethodArgs: console.debug.bind(console, keySection + '.%s(%o);', styleScope, scope, style.reset), - logMethodFull: console.debug.bind(console, keySection + '.%s(%o); // %o', styleScope, scope, style.reset), + logMethodFull: console.debug.bind(console, keySection + '.%s(%o) => %o', styleScope, scope, style.reset), incident: isBrowser - ? console.log.bind(console, '%c%s%c.%s() => Incident: "%s" (%s)!', styleScope, scope, style.reset) - : console.log.bind(console, `${styleScope}⚠️ %s${style.reset}.%s() => Incident: "%s" (%s)!\x1b[0;2m`, scope), + ? console.log.bind(console, '%c%s%c.%s() Incident `%s` %s!', styleScope, scope, 'color: orange;') + : console.log.bind(console, `${styleScope}🚸\n%s${style.reset}.%s() Incident \`%s\` %s!${style.reset}`, scope), logOther: console.debug.bind(console, keySection, styleScope, scope, style.reset), }; From cf465fe2dba08c246e7afd830bbf31ba6a3c1b8f Mon Sep 17 00:00:00 2001 From: Ali Mihandoost Date: Sat, 19 Nov 2022 15:29:57 +0330 Subject: [PATCH 3/3] chore(vscode): add noncallable to cSpell.words --- .vscode/settings.json | 1 + 1 file changed, 1 insertion(+) diff --git a/.vscode/settings.json b/.vscode/settings.json index 3beeaab44..ed1f6a103 100644 --- a/.vscode/settings.json +++ b/.vscode/settings.json @@ -27,6 +27,7 @@ "mihandoost", "nanoserver", "nanoservice", + "noncallable", "preconnect", "preload", "roundot",