rt0-logger 2.1.5
Install from the command line:
Learn more about npm packages
$ npm install @raythurnvoid/rt0-logger@2.1.5
Install via package.json:
"@raythurnvoid/rt0-logger": "2.1.5"
About this version
- Create a
log.ts
file:
import { buildLogger } from "@raythurnevoid/rt0-logger/browser.js";
import type { Config } from "@raythurnevoid/rt0-logger/types.js";
const config: Config = {
logLevel: "debug",
};
export const Log = buildLogger(() => config);
export type Log = InstanceType<typeof Log>;
- Use your new logger:
import { Log } from "./log.js";
const log = new Log("path/to/module.ts");
log.info(`Hello World}`);
log.i(`Hello World}`);
Results:
[path/to/module.ts] [INFO] Hello World
[path/to/module.ts] [INFO] Hello World
Check the GitHub homepage for the complete documentation.