banner

Custom formatted Console Logs and Anti-Crash system for your Discord bot!

version collaborators downloads licence

Installation

To install this package simply run:

npm i term-logger@latest
-

Usage

Usage only for Console Logs

const { Logger } = require("term-logger");
-
-//Defaul Logs
-Logger.error(`Example log text!`);
-Logger.debug(`Example log text!`);
-Logger.info(`Example log text!`);
-Logger.warn(`Example log text!`);
-Logger.critical(`Example log text!`);
-
-//Discord Logs
-Logger.ready(`Example log text!`);
-Logger.command(`Example log text!`);
-Logger.event(`Example log text!`);
-Logger.database(`Example log text!`);
-Logger.shard(`Example log text!`);
-Logger.cluster(`Example log text!`);
-Logger.lang("Example log text!");
-

Usage for Colors

const { Colors } = require("term-logger");
-
-Colors.grey("message");
-Colors.red("message");
-Colors.green("message");
-Colors.yellow("message");
-Colors.blue("message");
-Colors.purple("message");
-Colors.cyan("message");
-Colors.white("message");
-

Usage only for Anti-Crash

const { Client } = require("discord.js");
-const { TermLogger } = require("term-logger");
-
-const client = new Client({
-  intents: [...],
-});
-
-// You can enable/disable system logs (Use only Boolean)
-const noCrash = new TermLogger(client, {
-  enableAntiCrash: true,
-  systemMessages: true,
-});
-
-client.login("YOUR_BOT_TOKEN");
-

Documentation

Package Options

Constructor

new TermLogger(client);
-
ParameterTypeDescription
enableAntiCrashBooleanEnable or disable AntiCrash system
systemMessagesBooleanEnable or disable system messages

Logger Options

MethodDescription
Logger.error("message")Logs an error message
Logger.debug("message")Logs a debug message
Logger.info("message")Logs an information message
Logger.warn("message")Logs a warning message
Logger.critical("message")Logs a critical message
Logger.ready("message")Logs a message indicating that the app is ready
Logger.command("message")Logs a message that the command was executed
Logger.event("message")Logs a message that the event has been loaded
Logger.database("message")Logs a message related to database operations
Logger.shard("message")Logs a message related to shards
Logger.cluster("message")Logs a message related to clusters
Logger.lang("message")Logs a message related to language

Message must always be either a STRING or DATA!

Colors Options

Colors
Grey
Red
Green
Yellow
Blue
Purple
Cyan
White

Do you have any issues?

If you have any issues don't hesitate to report it via Github Issues.

Support

If you need help or assistance please either ask in my Discord Server and if you have an idea what to add to term-logger let us know on support.

Sponsor Us

Do you use Term-Logger and are you satisfied? You can support us with a one-time donation to help us improve our work: Donate here.

Discord Banner

Developed by @deemdev with ❤️