import {log} from "@slavshik/log";
// levels: 1 - fatal, 2 - info, 3 - error, 4 - warn, 5 - debug, 6 - trace (default is 2)
log.setLevel(6); // the larger the number, the higher the verbosity
// simple logging
log.trace("trace message");
log.debug("debug message");
log.info("info message");
log.error("error message");
log.warn("warn message");
log.fatal("fatal message");
// passing params
log.debug("debug message with array:", [1, 2, 3, 4], {a: 1, b: 2});
log.debug("debug message with object:", {a: 1, b: 2});
log.debug("debug message with number:", Math.random());
// using scopes
const scopedLog = log.scope("scope");
scopedLog.debug("debug message");
-
Notifications
You must be signed in to change notification settings - Fork 0
slavshik/log
Folders and files
Name | Name | Last commit message | Last commit date | |
---|---|---|---|---|
Repository files navigation
About
Tiny log with styling for the browser console.
Resources
Stars
Watchers
Forks
Packages 0
No packages published