Skip to content

Commit

Permalink
docs: fixing minor documentation errors
Browse files Browse the repository at this point in the history
Updates supported versions of bun and deno. Fixes example in setup page. Changes header for
structured logging under Configuration.
  • Loading branch information
Andrew Stacy committed Sep 12, 2024
1 parent 8093941 commit 620a3f7
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 5 deletions.
2 changes: 1 addition & 1 deletion docs/getting-started/configuration.md
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,7 @@ import logger from './logger';
logger.info('Logging from the index.');
```

## Set the Output Format
## Structured Logging (JSON)

Now that we have our active log level configured, we decide that what's best for our application is
to generate logs as structured data, also known as JSON logs.
Expand Down
4 changes: 2 additions & 2 deletions docs/getting-started/installation.md
Original file line number Diff line number Diff line change
Expand Up @@ -20,8 +20,8 @@ yarn add adze
| Dependency | Supported Versions | Notes |
| ---------- | ------------------ | ---------------------------------------- |
| node | >= 18.18.0 | When running Adze in a Node environment. |
| bun | ??? | When running in a Bun environment. |
| deno | ??? | When running in a Deno environment. |
| bun | >= 1.1.x | When running in a Bun environment. |
| deno | >= 1.46.x | When running in a Deno environment. |
| typescript | >= 5.5.x | When using Adze with TypeScript |

## TypeScript Configuration
Expand Down
11 changes: 9 additions & 2 deletions docs/getting-started/setup.md
Original file line number Diff line number Diff line change
Expand Up @@ -22,15 +22,22 @@ Here you may have noticed the presence of the `setup` function that we are impor
is used to create a global log store and to apply global configuration to all adze logs.

Now that we have imported our dependencies, let's create and export a shared logger that has
emoji's enabled and outputs timestamps with every log.
emoji's enabled and outputs timestamps with every log. We'll also attach some meta data globally to
all loggers using the [setup function](../reference/global-store.md#setup-function). We'll go more
in-depth on why we we're doing this [later](./capture-data.md).

```typescript
// ./src/logger.ts
import adze, { setup } from 'adze';

setup({
meta: {
hello: 'world!',
},
});

const logger = adze.withEmoji.timestamp.seal();
export default logger;
set;
```

The interesting thing about the code above is that we are calling the `seal` method instead of a
Expand Down

0 comments on commit 620a3f7

Please sign in to comment.