Skip to content
Ayfri edited this page Jan 22, 2021 · 4 revisions

Logger is a class in the utils folder to help you logging things. It has multiple static methods that you can use :

Name Description Color
comment(message, color = 'comment') Let you log something with the showed type COMMENT, theses only logs if the static field logComments is set to true. grey : #6e6f77
error(message, color = 'error') Let you log something with the showed type ERROR. red :#b52825
event(message, color = 'event') Let you log something with the showed type EVENT. #43804e
info(message, color = 'info') Let you log something with the showed type INFO. blue : #2582ff
log(message, type = 'log', color = 'log') Let you log something with the showed type LOG, you can change the color. default :#cccccc
test(message, color = 'test') Let you log something with the showed type TEST. white : #ffffff
warn(message, color = 'warn') Let you log something with the showed type WARN. yellow : #eeee23
setColor(color = 'default', text = '') Let you change the color after the function or the color of the text only. color

Example

const {Logger} = require('advanced-command-handler');
Logger.error(`${Logger.setColor('orange', 'Command')} is not allowed.`, 'PermissionError');

Give the following result in the console (screen made on WebStorm).

Every number is yellow by default.

Colors

Colors are set out in a static public object in the class, so you can change them.

These are the current colors :

colors = {
	red: '#b52825',
	orange: '#e76a1f',
	gold: '#deae17',
	yellow: '#eeee23',
	green: '#3ecc2d',
	teal: '#11cc93',
	blue: '#2582ff',
	indigo: '#524cd9',
	violet: '#7d31cc',
	magenta: '#b154cf',
	pink: '#d070a0',
	brown: '#502f1e',
	black: '#000000',
	grey: '#6e6f77',
	white: '#ffffff',
	default: '#cccccc',
};

Table of Content

Home

The basics

Core objects

Commands & Events

Utilities

Additional Information

Clone this wiki locally