Skip to content

Commit

Permalink
docs: enhance the ya.dbg() and ya.err() debugging functions
Browse files Browse the repository at this point in the history
  • Loading branch information
sxyazi committed Mar 22, 2024
1 parent 6d91b95 commit 80a5c75
Showing 1 changed file with 14 additions and 4 deletions.
18 changes: 14 additions & 4 deletions docs/plugins/utils.md
Original file line number Diff line number Diff line change
Expand Up @@ -167,19 +167,29 @@ ya.notify {
}
```

### `dbg(msg)`
### `dbg(msg, ...)`

Append messages to [the log file](/docs/plugins/overview#logging) at the debug level:

- `msg` - Required, the message to be logged, which is a string
- `msg` - Required, the message to be logged.

```lua
ya.dbg("Hello", "World!") -- Multiple arguments are supported
ya.dbg({ foo = "bar", baz = 123, qux = true }) -- Any type of data is supported
```

Note that if you use a release build of Yazi, the log level is "error" instead of "debug", so you'll need to use [`ya.err`](#errmsg).

### `err(msg)`
### `err(msg, ...)`

Append messages to [the log file](/docs/plugins/overview#logging) at the error level:

- `msg` - Required, the message to be logged, which is a string
- `msg` - Required, the message to be logged.

```lua
ya.err("Hello", "World!") -- Multiple arguments are supported
ya.err({ foo = "bar", baz = 123, qux = true }) -- Any type of data is supported
```

### `sync(fn)`

Expand Down

0 comments on commit 80a5c75

Please sign in to comment.