diff --git a/README.md b/README.md index bb74340..e510582 100644 --- a/README.md +++ b/README.md @@ -160,6 +160,13 @@ $ yarn install $ yarn test ``` +## Output Color Key + +**Success -** Green Background, White Text ✅ +**Warning -** Yellow Background, White Text ⚠️ +**Error -** Red Background, White Text 🛑 +**General -** White Background, Black Text ❕ + ## 📜 License MIT diff --git a/lib/helper.js b/lib/helper.js index 4269c36..01a0a95 100644 --- a/lib/helper.js +++ b/lib/helper.js @@ -37,9 +37,9 @@ let logofied = text => { */ let logger = (data, error) => { if (error) { - console.log(chalk.red(`${JSON.stringify(data, null, 2)}`)); + console.log(chalk.bgRed(chalk.white(`${JSON.stringify(data, null, 2)}`))); } else { - console.log(chalk.green(`${JSON.stringify(data, null, 2)}`)); + console.log(chalk.bgWhite(chalk.black(`${JSON.stringify(data, null, 2)}`))); } }; @@ -117,4 +117,4 @@ module.exports = { writeMetaData: writeMetaData, logger: logger, logofied: logofied -}; +}; \ No newline at end of file diff --git a/lib/services.js b/lib/services.js index 499f371..c61aa73 100644 --- a/lib/services.js +++ b/lib/services.js @@ -8,6 +8,7 @@ const Storage = require("./storage"); const Iam = require("./iam"); const Database = require("./database"); const Network = require("./network"); +const chalk = require("chalk"); let core = null; let ncProviders = null; @@ -114,7 +115,9 @@ function Services(program, spinner) { break; default: - throw new Error("Please select a valid command for Compute"); + throw new Error( + chalk.bgRed(chalk.white("Please select a valid command for Compute")) + ); break; } } @@ -164,7 +167,9 @@ function Services(program, spinner) { break; default: - throw new Error("Please select a valid command for Storage"); + throw new Error( + chalk.bgRed(chalk.white("Please select a valid command for Storage")) + ); break; } } @@ -206,7 +211,9 @@ function Services(program, spinner) { break; default: - throw new Error("Please select a valid command for Database"); + throw new Error( + chalk.bgRed(chalk.white("Please select a valid command for Database")) + ); break; } } @@ -270,7 +277,9 @@ function Services(program, spinner) { break; default: - throw new Error("Please select a valid command for IAM"); + throw new Error( + chalk.bgRed(chalk.white("Please select a valid command for IAM")) + ); break; } } @@ -397,10 +406,12 @@ function Services(program, spinner) { }); break; default: - throw new Error("Please select a valid command for Database"); + throw new Error( + chalk.bgRed(chalk.white("Please select a valid command for Database")) + ); break; } } } -module.exports = Services; +module.exports = Services; \ No newline at end of file