-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
01695ee
commit d696fc2
Showing
6 changed files
with
202 additions
and
188 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,102 @@ | ||
import chalk from 'chalk' | ||
|
||
export default function matrix(sOut, sErr) { | ||
return { | ||
debug: { | ||
level: 5, | ||
stream: sOut, | ||
/** | ||
* Format the debug message. | ||
* @private | ||
* @param {String} pfix Message prefix. | ||
* @param {String} msg The message body. | ||
* @return {Sring} The formatted mesage. | ||
*/ | ||
format: (pfix, msg) => `${pfix}${chalk.dim(msg)}` | ||
}, | ||
info: { | ||
level: 4, | ||
stream: sOut, | ||
/** | ||
* Format the info message. | ||
* @private | ||
* @param {String} pfix Message prefix. | ||
* @param {String} msg The message body. | ||
* @return {Sring} The formatted mesage. | ||
*/ | ||
format: (pfix, msg) => `${pfix}${msg}` | ||
}, | ||
log: { | ||
level: 3, | ||
stream: sOut, | ||
/** | ||
* Format the log message. | ||
* @private | ||
* @param {String} pfix Message prefix. | ||
* @param {String} msg The message body. | ||
* @return {Sring} The formatted mesage. | ||
*/ | ||
format: (pfix, msg) => `${pfix}${msg}` | ||
}, | ||
warn: { | ||
level: 2, | ||
stream: sErr, | ||
/** | ||
* Format the warn message. | ||
* @private | ||
* @param {String} pfix Message prefix. | ||
* @param {String} msg The message body. | ||
* @return {Sring} The formatted mesage. | ||
*/ | ||
format: (pfix, msg) => `${pfix}${chalk.yellow(msg)}` | ||
}, | ||
error: { | ||
level: 1, | ||
stream: sErr, | ||
/** | ||
* Format the error message. | ||
* @private | ||
* @param {String} pfix Message prefix. | ||
* @param {String} msg The message body. | ||
* @return {Sring} The formatted mesage. | ||
*/ | ||
format: (pfix, msg) => `${pfix}${chalk.red(`ERROR: ${msg}`)}` | ||
}, | ||
critical: { | ||
level: 0, | ||
stream: sErr, | ||
/** | ||
* Format the critical message. | ||
* @private | ||
* @param {String} pfix Message prefix. | ||
* @param {String} msg The message body. | ||
* @return {Sring} The formatted mesage. | ||
*/ | ||
format: (pfix, msg) => `${pfix}${chalk.bold.red(`CRITICAL: ${msg}`)}` | ||
}, | ||
panic: { | ||
level: 0, | ||
stream: sErr, | ||
/** | ||
* Format the panic message. | ||
* @private | ||
* @param {String} pfix Message prefix. | ||
* @param {String} msg The message body. | ||
* @return {Sring} The formatted mesage. | ||
*/ | ||
format: (pfix, msg) => `${pfix}${chalk.bold.red(`PANIC: ${msg}`)}` | ||
}, | ||
emergency: { | ||
level: 0, | ||
stream: sErr, | ||
/** | ||
* Format the emergency message. | ||
* @private | ||
* @param {String} pfix Message prefix. | ||
* @param {String} msg The message body. | ||
* @return {Sring} The formatted mesage. | ||
*/ | ||
format: (pfix, msg) => `${pfix}${chalk.bold.red(`EMERGENCY: ${msg}`)}` | ||
} | ||
} | ||
} |
Oops, something went wrong.