Skip to content

Conversation

@arv
Copy link
Contributor

@arv arv commented Apr 17, 2025

This allows specializing what parameters debug, info, warn and error can take.

For example:

type MyLogContext = LogContext<[string, number]>;

Would only allow error to be called with a [string, number] tuple.

declare const lc: MyLogContext;
lc.error('foo', 42); // ok
lc.error('foo', 'bar'); // error
lc.error('foo'); // error
lc.error(); // error

Also a few chores...

  • Change to vitest
  • Update deps

This allows specializing what parameters debug, info, warn and error
can take.

For example:

```ts
type MyLogContext = LogContext<[string, number]>;
```

Would only allow `error` to be called with a [string, number] tuple.

```ts
declare const lc: MyLogContext;
lc.error('foo', 42); // ok
lc.error('foo', 'bar'); // error
lc.error('foo'); // error
lc.error(); // error
```

Also a few chores...

- Change to vitest
- Update deps
@arv arv requested a review from grgbkr April 17, 2025 10:42
@arv arv enabled auto-merge (rebase) April 17, 2025 10:42
@arv arv merged commit 7948a4b into main Apr 17, 2025
2 checks passed
@arv arv deleted the arv/TEMP branch April 17, 2025 10:48
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants