Debux
Easy-to-use library for debugging your code
NOTE! This library is still in development and may not work as expected!
Support
You can contact us on our Discord server
Usage
calling debux()
will always return the same instance on debux that was initialized within the same process!
const debux = require("debux");
const debug = debux();
debug.log("This is a log");
Different methods
debug.log("this is a log", {
process: "process",
class: "className",
function: "function",
event: "event"
});
debug.error("this is an error", {
process: "process",
class: "className",
function: "function",
event: "event"
});
debug.warn("this is a warning", {
process: "process",
class: "className",
function: "function",
event: "event"
});
debug.info("this is info", {
process: "process",
class: "className",
function: "function",
event: "event"
});
debug.logs()
Options
log
debux.log(string | null, Options?)
logs a simple informative log
error
debux.error(string, Options?)
logs an error
warn
debux.warn(string, Options?)
logs a warning
info
debux.info(string, Options?)
logs information about code
interface Options {
process?: string;
class?: string;
function?: string;
event?: string;
}
interface constructOptions {
maxCacheSize?: number;
logLevel?: level;
includeMilliseconds?: boolean;
logFile?: PathLike;
}
export enum level {
nothing = 0,
error = 1,
warning = 2,
info = 3,
all = 4
}
Copyright (c) 2022 MatteZ02