1
0
Fork 0
mirror of https://github.com/denoland/deno.git synced 2025-01-21 21:50:00 -05:00

docs(std/log): update example (#7157)

This commit is contained in:
Matthew Adams 2020-08-27 02:03:49 -07:00 committed by GitHub
parent 6b95b25000
commit 81811e80e1
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -282,8 +282,12 @@ the message.
logger.debug(() => `this is expensive: ${expensiveFn(5)}`);
```
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.
> NOTE: When using lazy log evaluation, `undefined` will be returned if the
> 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
await log.setup({