From 185e544aa532812060ce24336cf23d0443414fdd Mon Sep 17 00:00:00 2001 From: gretzkiy Date: Sat, 23 Nov 2024 13:35:44 +0300 Subject: [PATCH 1/2] feat(prelude/global): pass error details to the logger --- CHANGELOG.md | 6 ++++++ src/core/prelude/CHANGELOG.md | 6 ++++++ src/core/prelude/global/index.ts | 6 +++--- ts-definitions/prelude/global.d.ts | 3 ++- 4 files changed, 17 insertions(+), 4 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index cdf2372e2..9a16f7e9f 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -11,6 +11,12 @@ Changelog _Note: Gaps between patch versions are faulty, broken or test releases._ +## v4.0.0-alpha.50 (2024-11-26) + +#### :rocket: New Feature + +* `stderr` can now accept error details and pass them to the logger `core/prelude/global` + ## v4.0.0-alpha.49 (2024-10-31) #### :bug: Bug Fix diff --git a/src/core/prelude/CHANGELOG.md b/src/core/prelude/CHANGELOG.md index e5cceb1ed..ce56e19e7 100644 --- a/src/core/prelude/CHANGELOG.md +++ b/src/core/prelude/CHANGELOG.md @@ -9,6 +9,12 @@ Changelog > - :house: [Internal] > - :nail_care: [Polish] +## v4.0.0-alpha.50 (2024-11-26) + +#### :rocket: New Feature + +* `stderr` can now accept error details and pass them to the logger + ## v4.0.0-alpha.49 (2024-10-31) #### :bug: Bug Fix diff --git a/src/core/prelude/global/index.ts b/src/core/prelude/global/index.ts index cdb899564..0d564d7bd 100644 --- a/src/core/prelude/global/index.ts +++ b/src/core/prelude/global/index.ts @@ -14,13 +14,13 @@ import { errorsToIgnore } from 'core/prelude/global/const'; extend(globalThis, 'Any', (obj) => obj); /** @see stderr */ -extend(globalThis, 'stderr', (err) => { +extend(globalThis, 'stderr', (err, ...details: unknown[]) => { if (err instanceof Object) { if (errorsToIgnore[err.type] === true) { - log.info('stderr', err); + log.info('stderr', err, ...details); return; } - log.error('stderr', err); + log.error('stderr', err, ...details); } }); diff --git a/ts-definitions/prelude/global.d.ts b/ts-definitions/prelude/global.d.ts index 83b544ead..90067d509 100644 --- a/ts-definitions/prelude/global.d.ts +++ b/ts-definitions/prelude/global.d.ts @@ -47,8 +47,9 @@ declare function Any(obj: any): any; /** * STDERR wrapper * @param err + * @param details */ -declare function stderr(err: any): void; +declare function stderr(err: any, ...details: unknown[]): void; type i18n = (key: string | TemplateStringsArray, params?: I18nParams) => string; From 68a41ff08604889682e4b6cea3d2e4d920566cce Mon Sep 17 00:00:00 2001 From: gretzkiy Date: Tue, 26 Nov 2024 12:31:33 +0300 Subject: [PATCH 2/2] 4.0.0-alpha.50 --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index 7b7c62666..29b281f51 100644 --- a/package.json +++ b/package.json @@ -5,7 +5,7 @@ "main": "lib/core/index.js", "typings": "index.d.ts", "license": "MIT", - "version": "4.0.0-alpha.49", + "version": "4.0.0-alpha.50", "author": "kobezzza (https://github.com/kobezzza)", "repository": { "type": "git",