@mysticaldragon/logger
TypeScript icon, indicating that this package has built-in type declarations

1.0.6 • Public • Published

@mysticaldragon/logger

Beautiful logs without making a mess. Organize your logs by class names, hide the logs you won't need and send the important data to specific log files.

  • [x] Beautiful logs with timestamp and classes
  • [x] Pipe logs to files based on classes
const { log } = require('@mysticaldragon/logger');

log("MAIN", "Hello world!");	

Hello World!

Show, hide and pipe logs to files based on filters

const Logger = require('@mysticaldragon/logger');
const { log } = new Logger({
	enabled: boolean, // Is logging activated? (Default, true)
	hidden: [{ class: "HIDDEN_LOG" }] // Hide logs based on class, Wildcard: * (Default, [])
	pipe: [{ // Store logs in file
		path: "logs/main.log", // File to write
		filter: { class: "MAIN" }
	}]
})

Logger.log("HIDDEN_LOG", "This message won't be shown.");
Logger.log("MAIN", "This log will be written at logs/main.log.");

Readme

Keywords

none

Package Sidebar

Install

npm i @mysticaldragon/logger

Weekly Downloads

0

Version

1.0.6

License

MIT

Unpacked Size

26.7 kB

Total Files

23

Last publish

Collaborators

  • mysticaldragon98