Skip to content

Commit

Permalink
small updates
Browse files Browse the repository at this point in the history
  • Loading branch information
pi0 committed Jun 8, 2024
1 parent d745fe3 commit 24d31b1
Showing 1 changed file with 9 additions and 11 deletions.
20 changes: 9 additions & 11 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -225,17 +225,6 @@ Log types are exposed as `consola.[type](...)` and each is a preset of styles an

A list of all available built-in types is [available here](./src/constants.ts).

## Raw output

Objects sent to reporter by logging them could lead to unexcepted output when object is close to internal object structure ([see how consola consider object as non-conflictual](https://github.com/unjs/consola/blob/ce2b368f43813aa95e54d6124425b1c6badc087e/src/utils/log.ts#L5)).
To enforce the object to be interpreted, you can use the `raw` method chained to any log type.

See [examples/raw.ts](./examples/raw.ts).

> [!NOTE]
> As his usage is mostly for an advanced usage of consola and for debugging, the `raw` method could be change in future

## Creating a new instance

Consola has a global instance and is recommended to use everywhere.
Expand Down Expand Up @@ -313,6 +302,15 @@ import {
const { stripAnsi } = require("consola/utils");
```

## Raw logging methods

In rare conditions, Objects sent to the reporter could lead to unexpected output when object is close to internal object structure having both `message` and `args` props. To enforce the object to be interpreted as pure object, you can use the `raw` method chained to any log type.

See [examples/raw.ts](./examples/raw.ts).

> [!NOTE]
> As his usage is mostly for an advanced usage of consola and for debugging, the `raw` method could be change in future.
## License

MIT
Expand Down

0 comments on commit 24d31b1

Please sign in to comment.