Adding custom colored logging

This commit is contained in:
Fabian Stamm
2019-11-17 16:03:58 +01:00
parent ca41468dc1
commit 965c85a275
6 changed files with 202 additions and 169 deletions

View File

@ -1,4 +1,4 @@
import { Logging, LoggingBase } from ".";
import { Logging, LoggingBase, Colors, withColor } from ".";
Logging.log("test")
Logging.log("i", "am", { a: "an" }, 1000);
@ -8,6 +8,9 @@ Logging.errorMessage("i", "am", "an", "error");
Logging.log("\x1b[31m\x1b[31m\x1b[31m\x1b[31m\x1b[31m\x1b[31m TEST \x1b[31m\x1b[31m\x1b[31m")
Logging.log(withColor(Colors.MAGENTA, "This text should be magenta!"), "This not!")
Logging.log(withColor(Colors.MAGENTA, { somekey: "Some value" }))
let err = new Error()
if (typeof err.stack !== "string") console.log("Stacktrace invalid", err.stack)