@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 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 }), timestamp(), cli(), splat()),
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, Object2) {
87531
- logger.info(`${message} %o`, Object2);
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("configs :>> ", configs);
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);
@@ -1,5 +1,5 @@
1
1
  export default class Logger {
2
- static info(message: string, Object?: object): void;
2
+ static info(message: string, details?: any): void;
3
3
  static error(error: Error): void;
4
4
  static warn(message: string): void;
5
5
  static debug(message: string): void;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@ccci/micro-server",
3
- "version": "1.0.29",
3
+ "version": "1.0.31",
4
4
  "module": "index.ts",
5
5
  "type": "module",
6
6
  "main": "dist/index.js",