Skip to content

Commit

Permalink
Added more logging methods + custom log message
Browse files Browse the repository at this point in the history
  • Loading branch information
TrueBoxGuy committed Sep 2, 2017
1 parent 6a705ca commit f5b4ca1
Showing 1 changed file with 31 additions and 1 deletion.
32 changes: 31 additions & 1 deletion classes/TrueLogger.js
Original file line number Diff line number Diff line change
Expand Up @@ -32,14 +32,44 @@ class TrueLogger {
}

/**
* info - Logs something in the error category.
* warn- Logs something in the warn category.
*
* @param {...string} input A spread of strings that you want to log.
*/
warn(...input) {
log("Warn", "yellow", this.getTimeStamp(), ...input);
}

/**
* error - Logs something in the error category.
*
* @param {...string} input A spread of strings that you want to log.
*/
error(...input) {
log("Error", "red", this.getTimeStamp(), ...input);
}

/**
* debug - Logs something in the debug category.
*
* @param {...string} input A spread of strings that you want to log.
*/
debug(...input) {
log("Debug", "blue", this.getTimeStamp(), ...input);
}


/**
* custom - Sends a custom log message.
*
* @param {string} category The category of this log message.
* @param {string} color The color you want the category to show up as.
* @param {...string} input A spread of strings that you want to log.
*/
custom(category, color, ...input) {
log(category, color, this.getTimeStamp(), ...input);
}

}

function log(category, color, timestamp, ...input) {
Expand Down

0 comments on commit f5b4ca1

Please sign in to comment.