summaryrefslogtreecommitdiff
path: root/logging
diff options
context:
space:
mode:
authorRyan Dahl <ry@tinyclouds.org>2019-01-01 22:46:17 -0500
committerRyan Dahl <ry@tinyclouds.org>2019-01-02 13:45:42 -0500
commit6a783ea179de1321ae7fd0586967476e72984c63 (patch)
treecafa2e3716ee3dcfa88354e4a7190cab7e436613 /logging
parent6545e5bde9454e9ae7ab61b0f4ee95db8a15e43c (diff)
Add testing module
Original: https://github.com/denoland/deno_std/commit/61fdae51a7cc50874b9674c40b1aef3fbf012494
Diffstat (limited to 'logging')
-rw-r--r--logging/README.md26
-rw-r--r--logging/test.ts3
2 files changed, 14 insertions, 15 deletions
diff --git a/logging/README.md b/logging/README.md
index 4d7e95474..1d88cb070 100644
--- a/logging/README.md
+++ b/logging/README.md
@@ -12,27 +12,27 @@ log.critical("500 Internal server error");
// configure as needed
await log.setup({
- handlers: {
- console: new log.handlers.ConsoleHandler("DEBUG"),
- file: new log.handlers.FileHandler("WARNING", "./log.txt"),
- },
+ handlers: {
+ console: new log.handlers.ConsoleHandler("DEBUG"),
+ file: new log.handlers.FileHandler("WARNING", "./log.txt")
+ },
- loggers: {
- default: {
- level: "DEBUG",
- handlers: ["console", "file"],
- }
+ loggers: {
+ default: {
+ level: "DEBUG",
+ handlers: ["console", "file"]
}
+ }
});
// get configured logger
const logger = log.getLogger("default");
-logger.debug("fizz") // <- logs to `console`, because `file` handler requires 'WARNING' level
-logger.warning("buzz") // <- logs to both `console` and `file` handlers
+logger.debug("fizz"); // <- logs to `console`, because `file` handler requires 'WARNING' level
+logger.warning("buzz"); // <- logs to both `console` and `file` handlers
// 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
// so no message is logged
const unknownLogger = log.getLogger("mystery");
-unknownLogger.info("foobar") // no-op
-``` \ No newline at end of file
+unknownLogger.info("foobar"); // no-op
+```
diff --git a/logging/test.ts b/logging/test.ts
index 4808b5944..b96a046dd 100644
--- a/logging/test.ts
+++ b/logging/test.ts
@@ -1,6 +1,5 @@
import { remove, open, readAll } from "deno";
-import { assertEqual, test } from "https://deno.land/x/testing/testing.ts";
-
+import { assertEqual, test } from "../testing/mod.ts";
import * as log from "index.ts";
import { FileHandler } from "./handlers.ts";