mirror of
https://github.com/denoland/deno.git
synced 2025-01-11 00:21:05 -05:00
adjust docs for std/log (#4984)
This commit is contained in:
parent
2337fca277
commit
17cf2ecdac
1 changed files with 3 additions and 3 deletions
|
@ -19,7 +19,7 @@ await log.setup({
|
||||||
handlers: {
|
handlers: {
|
||||||
console: new log.handlers.ConsoleHandler("DEBUG"),
|
console: new log.handlers.ConsoleHandler("DEBUG"),
|
||||||
|
|
||||||
file: new log.handlers.FileHandler(log.LogLevels.DEBUG, {
|
file: new log.handlers.FileHandler("WARNING", {
|
||||||
filename: "./log.txt",
|
filename: "./log.txt",
|
||||||
// you can change format of output message using any keys in `LogRecord`
|
// you can change format of output message using any keys in `LogRecord`
|
||||||
formatter: "{levelName} {msg}",
|
formatter: "{levelName} {msg}",
|
||||||
|
@ -34,7 +34,7 @@ await log.setup({
|
||||||
},
|
},
|
||||||
|
|
||||||
tasks: {
|
tasks: {
|
||||||
level: log.LogLevels.ERROR,
|
level: "ERROR",
|
||||||
handlers: ["console"],
|
handlers: ["console"],
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
|
@ -55,7 +55,7 @@ logger.error("buzz"); // log to `console`
|
||||||
// if you try to use a logger that hasn't been configured
|
// if you try to use a logger that hasn't been configured
|
||||||
// you're good to go, it gets created automatically with level set to 0
|
// you're good to go, it gets created automatically with level set to 0
|
||||||
// so no message is logged
|
// so no message is logged
|
||||||
unknownLogger = log.getLogger("mystery");
|
const unknownLogger = log.getLogger("mystery");
|
||||||
unknownLogger.info("foobar"); // no-op
|
unknownLogger.info("foobar"); // no-op
|
||||||
```
|
```
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue