1.0.6 • Published 3 years ago

@mysticaldragon/logger v1.0.6

Weekly downloads
-
License
MIT
Repository
github
Last release
3 years ago

@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.

  • Beautiful logs with timestamp and classes
  • 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.");