@ccci/micro-server 1.0.29 → 1.0.31
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.js +12 -6
- package/dist/utils/Logger.d.ts +1 -1
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -87519,16 +87519,21 @@ import fs from "fs";
|
|
|
87519
87519
|
|
|
87520
87520
|
// src/utils/Logger.ts
|
|
87521
87521
|
var import_winston = __toESM(require_winston(), 1);
|
|
87522
|
-
var { combine, timestamp, json: json2, errors, cli, splat } = import_winston.default.format;
|
|
87522
|
+
var { combine, timestamp, json: json2, errors, cli, splat, prettyPrint, printf } = import_winston.default.format;
|
|
87523
87523
|
var logger = import_winston.default.createLogger({
|
|
87524
87524
|
level: "info",
|
|
87525
|
-
format: combine(errors({ stack: true }),
|
|
87525
|
+
format: combine(timestamp(), errors({ stack: true }), prettyPrint(), splat(), printf((info) => {
|
|
87526
|
+
if (typeof info.message === "object") {
|
|
87527
|
+
info.message = JSON.stringify(info.message, null, 3);
|
|
87528
|
+
}
|
|
87529
|
+
return info.message;
|
|
87530
|
+
})),
|
|
87526
87531
|
transports: [new import_winston.default.transports.Console]
|
|
87527
87532
|
});
|
|
87528
87533
|
|
|
87529
87534
|
class Logger {
|
|
87530
|
-
static info(message,
|
|
87531
|
-
logger.info(`${message} %o`,
|
|
87535
|
+
static info(message, details) {
|
|
87536
|
+
logger.info(`${message} %o`, details);
|
|
87532
87537
|
}
|
|
87533
87538
|
static error(error) {
|
|
87534
87539
|
logger.error(error);
|
|
@@ -87555,10 +87560,11 @@ class DatabaseConnector {
|
|
|
87555
87560
|
DatabaseConnector.connections = [];
|
|
87556
87561
|
let connections = [];
|
|
87557
87562
|
const configPath = `${DatabaseConnector.rootDir}/config/db.config.ts`;
|
|
87563
|
+
Logger.info("configPath: ", configPath);
|
|
87558
87564
|
import(configPath).then((configs) => {
|
|
87559
87565
|
Logger.info("configs :>> ", configs);
|
|
87560
|
-
const config = configs[env];
|
|
87561
|
-
Logger.info("
|
|
87566
|
+
const config = configs.default()[env];
|
|
87567
|
+
Logger.info("config :>> ", config);
|
|
87562
87568
|
const connection = new Sequelize(config);
|
|
87563
87569
|
DatabaseConnector.connection = connection;
|
|
87564
87570
|
connections.push(connection);
|
package/dist/utils/Logger.d.ts
CHANGED