mirror of
https://github.com/spacebarchat/server.git
synced 2026-10-23 04:22:47 +00:00
Rainbow the logs
This commit is contained in:
1 parent
e52e7ef0e1
commit
d4ddf3acf0
9 files changed
+30
-6
No files matched your search
@@ -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;
|
||||
|
||||
Reference in new issue
Block a user