Exports a function, which takes a string as an argument, and returns an object with methods that adds syntactial highlighting to your logs, leveraging the "chalk" and "debug" npm packages.
- Source:
Examples
const logger = require('/path/to/logger.js');
const debugLogger = logger("dev")
debugLogger.debugSucess("Hello Beekeeper");
// in the terminal
// DEBUG=dev node tester.js
// "✔️Hello Beekeeper"
const logger = require('/path/to/logger.js')("dev");
logger.highlight("Hello Beekeeper");
// Hello Beekeeper
(require("logger"))() → {Object}
- Source:
Exports the logger function.
Returns:
- Type
- Object
Methods
(inner) debugError(msg) → {undefined}
- Source:
Outputs bold yellow text with a red "X" when running DEGUG=name [COMMAND] in the terminal
Parameters:
Name | Type | Description |
---|---|---|
msg |
String | A string of text |
Returns:
- Type
- undefined
(inner) debugSuccess(msg) → {undefined}
- Source:
Outputs bold text with a green arrow when running DEGUG=name [COMMAND] in the terminal.
Parameters:
Name | Type | Description |
---|---|---|
msg |
String | A string of text |
Returns:
- Type
- undefined
(inner) error(args) → {undefined}
- Source:
Outputs a thick red "X", followed by bold yellow text
Parameters:
Name | Type | Description |
---|---|---|
args |
* | Takes nearly anything that you would pass into console.log |
Returns:
- Type
- undefined
(inner) failDeploy() → {undefined}
- Source:
Outputs bold yellow text with a red "X" if any part of the aws deployment failed.
Returns:
- Type
- undefined
(inner) help() → {undefined}
- Source:
Triggered by entering an invalid command. Outputs possible valid commands.
Returns:
- Type
- undefined
(inner) highlight(args) → {undefined}
- Source:
Outputs bold yellow text
Parameters:
Name | Type | Description |
---|---|---|
args |
* | Takes nearly anything that you would pass into console.log |
Returns:
- Type
- undefined