mirror of
https://github.com/denoland/deno.git
synced 2025-01-22 06:09:25 -05:00
docs(std/log): update example (#7157)
This commit is contained in:
parent
6b95b25000
commit
81811e80e1
1 changed files with 6 additions and 2 deletions
|
@ -282,8 +282,12 @@ the message.
|
||||||
logger.debug(() => `this is expensive: ${expensiveFn(5)}`);
|
logger.debug(() => `this is expensive: ${expensiveFn(5)}`);
|
||||||
```
|
```
|
||||||
|
|
||||||
NOTE: When using lazy log evaluation, `undefined` will be returned if the
|
> NOTE: When using lazy log evaluation, `undefined` will be returned if the
|
||||||
resolver function is not called because the logger won't log it. E.g.
|
> resolver function is not called because the logger won't log it. It is an
|
||||||
|
> antipattern use lazy evaluation with inline logging because the return value
|
||||||
|
> depends on the current log level.
|
||||||
|
|
||||||
|
Example:
|
||||||
|
|
||||||
```ts
|
```ts
|
||||||
await log.setup({
|
await log.setup({
|
||||||
|
|
Loading…
Add table
Reference in a new issue