diff options
author | uurgothat <cckhmck@gmail.com> | 2021-10-04 22:01:08 +0300 |
---|---|---|
committer | uurgothat <cckhmck@gmail.com> | 2021-10-04 22:01:08 +0300 |
commit | 18abf9ef40404a5693cf62d3f8b026f491765264 (patch) | |
tree | ffba9b64dd2d9f62940e3c994e8f97f841746ebe /util | |
parent | Merge branch 'master' of https://github.com/fosscord/fosscord-server (diff) | |
download | server-18abf9ef40404a5693cf62d3f8b026f491765264.tar.xz |
Rainbow the logs
Diffstat (limited to 'util')
-rw-r--r-- | util/package-lock.json | 1 | ||||
-rw-r--r-- | util/package.json | 1 | ||||
-rw-r--r-- | util/src/util/Database.ts | 5 |
3 files changed, 5 insertions, 2 deletions
diff --git a/util/package-lock.json b/util/package-lock.json index f4129614..26321ee9 100644 --- a/util/package-lock.json +++ b/util/package-lock.json @@ -12,6 +12,7 @@ "dependencies": { "ajv": "^8.6.2", "amqplib": "^0.8.0", + "chalk": "^4.1.2", "class-validator": "^0.13.1", "dot-prop": "^6.0.1", "env-paths": "^2.2.1", diff --git a/util/package.json b/util/package.json index 0e81a544..426b4e43 100644 --- a/util/package.json +++ b/util/package.json @@ -39,6 +39,7 @@ "dependencies": { "ajv": "^8.6.2", "amqplib": "^0.8.0", + "chalk": "^4.1.2", "class-validator": "^0.13.1", "dot-prop": "^6.0.1", "env-paths": "^2.2.1", diff --git a/util/src/util/Database.ts b/util/src/util/Database.ts index ab7c70c5..bf8c6fce 100644 --- a/util/src/util/Database.ts +++ b/util/src/util/Database.ts @@ -2,6 +2,7 @@ import path from "path"; import "reflect-metadata"; import { Connection, createConnection, ValueTransformer } from "typeorm"; import * as Models from "../entities"; +import { yellow, green} from "chalk"; // UUID extension option is only supported with postgres // We want to generate all id's with Snowflakes that's why we have our own BaseEntity class @@ -12,7 +13,7 @@ var dbConnection: Connection | undefined; export function initDatabase() { if (promise) return promise; // prevent initalizing multiple times - console.log("[Database] connecting ..."); + console.log(`[Database] ${yellow("connecting ...")}`); // @ts-ignore promise = createConnection({ type: "sqlite", @@ -32,7 +33,7 @@ export function initDatabase() { promise.then((connection) => { dbConnection = connection; - console.log("[Database] connected"); + console.log(`[Database] ${green("connected")}`); }); return promise; |