Skip to content

Commit

Permalink
🚧 WIP
Browse files Browse the repository at this point in the history
  • Loading branch information
maraisr committed Jun 1, 2024
1 parent 6304464 commit f541b24
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions readme.md
Original file line number Diff line number Diff line change
Expand Up @@ -41,15 +41,17 @@ _Avaliable on [jsr](https://jsr.io/@mr/log), [NPM](https://npmjs.com/package/dia
import { diary } from 'diary';
import { pretty } from 'diary/output.console';

let user = { name: 'marais', type: 'admin' };

// 1️⃣ create a diary
let log = diary(pretty);

// 2️⃣ log something
log('info', '{name} is now {type}', { name: 'marais', type: 'admin' });
log('info', '{name} is now {type}', user);
// ~> ℹ info marais is now admin

// 💡 log message as completely typesafe
log('debug', '{name} was created {at}', { name: 'marais' });
log('debug', '{name} was created {at}', user);
// ^? Error: 'at' is not defined
```

Expand Down

0 comments on commit f541b24

Please sign in to comment.