Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
6 changes: 6 additions & 0 deletions src/core/prelude/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
6 changes: 3 additions & 3 deletions src/core/prelude/global/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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);
}
});
3 changes: 2 additions & 1 deletion ts-definitions/prelude/global.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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;

Expand Down