aboutsummaryrefslogtreecommitdiff
path: root/src/modules/console.js
diff options
context:
space:
mode:
author0neGal <mail@0negal.com>2023-07-22 16:09:41 +0200
committer0neGal <mail@0negal.com>2023-07-22 16:09:41 +0200
commit11f2bc2de10e5ec7bb8a8b102855e9b7f0122c02 (patch)
tree29fbc46781019ccc19c53664a27042acd4112f25 /src/modules/console.js
parente984cf81b7fd84c44fb39206c639c35a44c6054c (diff)
downloadViper-11f2bc2de10e5ec7bb8a8b102855e9b7f0122c02.tar.gz
Viper-11f2bc2de10e5ec7bb8a8b102855e9b7f0122c02.zip
colored console logging
Far prettier, and far more useful at a glance.
Diffstat (limited to 'src/modules/console.js')
-rw-r--r--src/modules/console.js27
1 files changed, 27 insertions, 0 deletions
diff --git a/src/modules/console.js b/src/modules/console.js
new file mode 100644
index 0000000..7112071
--- /dev/null
+++ b/src/modules/console.js
@@ -0,0 +1,27 @@
+let new_console = {
+ ...console
+}
+
+let orig_console = console;
+
+new_console.ok = (...args) => {
+ orig_console.log('\x1b[92m%s\x1b[0m', ...args)
+}
+
+new_console.misc = (...args) => {
+ orig_console.warn('\x1b[90m%s\x1b[0m', ...args)
+}
+
+new_console.info = (...args) => {
+ orig_console.warn('\x1b[94m%s\x1b[0m', ...args)
+}
+
+new_console.warn = (...args) => {
+ orig_console.warn('\x1b[93m%s\x1b[0m', ...args)
+}
+
+new_console.error = (...args) => {
+ orig_console.error('\x1b[91m%s\x1b[0m', ...args)
+}
+
+module.exports = new_console;