@cloudnux/local-cloud-provider 0.10.0 → 0.11.0

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
@@ -1002,12 +1002,14 @@ var errorToString = (error) => {
1002
1002
 
1003
1003
  // ../../utils/src/logging/index.ts
1004
1004
  var currentLogLevel = logLevels[env("LOG_LEVEL")?.toLowerCase()] ?? logLevels.info;
1005
+ var module = "default";
1006
+ var requestId = "";
1005
1007
  var logger = {
1006
1008
  fatal: (message, meta) => {
1007
1009
  if (currentLogLevel >= logLevels.fatal) {
1008
1010
  console.error(
1009
1011
  `[${(/* @__PURE__ */ new Date()).toTimeString()}]`,
1010
- `${chalk.bgRed.white(" fatal ")}${EOL}`,
1012
+ `${chalk.bgRed.white(" fatal ")} - ${module || "unknown module"} - ${requestId || "no request ID"} - ${EOL}`,
1011
1013
  errorToString(message),
1012
1014
  meta ? `${EOL}${JSON.stringify(meta, null, 2)}` : ""
1013
1015
  );
@@ -1017,7 +1019,7 @@ var logger = {
1017
1019
  if (currentLogLevel >= logLevels.error) {
1018
1020
  console.error(
1019
1021
  `[${(/* @__PURE__ */ new Date()).toTimeString()}]`,
1020
- `${chalk.bgRed.white(" error ")}${EOL}`,
1022
+ `${chalk.bgRed.white(" error ")} - ${module || "unknown module"} - ${requestId || "no request ID"} - ${EOL}`,
1021
1023
  errorToString(message),
1022
1024
  meta ? `${EOL}${JSON.stringify(meta, null, 2)}` : ""
1023
1025
  );
@@ -1027,7 +1029,7 @@ var logger = {
1027
1029
  if (currentLogLevel >= logLevels.warn) {
1028
1030
  console.warn(
1029
1031
  `[${(/* @__PURE__ */ new Date()).toTimeString()}]`,
1030
- `${chalk.bgYellow.black(" warn ")}${EOL}`,
1032
+ `${chalk.bgYellow.black(" warn ")} - ${module || "unknown module"} - ${requestId || "no request ID"} - ${EOL}`,
1031
1033
  errorToString(message),
1032
1034
  meta ? `${EOL}${JSON.stringify(meta, null, 2)}` : ""
1033
1035
  );
@@ -1037,7 +1039,7 @@ var logger = {
1037
1039
  if (currentLogLevel >= logLevels.info) {
1038
1040
  console.info(
1039
1041
  `[${(/* @__PURE__ */ new Date()).toTimeString()}]`,
1040
- `${chalk.bgBlue.white(" info ")}${EOL}`,
1042
+ `${chalk.bgBlue.white(" info ")} - ${module || "unknown module"} - ${requestId || "no request ID"} - ${EOL}`,
1041
1043
  message,
1042
1044
  meta ? `${EOL}${JSON.stringify(meta, null, 2)}` : ""
1043
1045
  );
@@ -1047,7 +1049,7 @@ var logger = {
1047
1049
  if (currentLogLevel >= logLevels.debug) {
1048
1050
  console.debug(
1049
1051
  `[${(/* @__PURE__ */ new Date()).toTimeString()}]`,
1050
- `${chalk.bgWhite.black(" debug ")}${EOL}`,
1052
+ `${chalk.bgWhite.black(" debug ")} - ${module || "unknown module"} - ${requestId || "no request ID"} - ${EOL}`,
1051
1053
  message,
1052
1054
  meta ? `${EOL}${JSON.stringify(meta, null, 2)}` : ""
1053
1055
  );
@@ -1798,7 +1800,16 @@ import fastifyPrintRoutes from "fastify-print-routes";
1798
1800
  function createRouter(options = {}) {
1799
1801
  const fastify = Fastify({
1800
1802
  maxParamLength: 1e3,
1801
- logger: options.logger
1803
+ logger: options.logger ? {
1804
+ transport: {
1805
+ target: "pino-pretty",
1806
+ options: {
1807
+ colorize: true,
1808
+ translateTime: "HH:MM:ss Z",
1809
+ ignore: "pid,hostname"
1810
+ }
1811
+ }
1812
+ } : void 0
1802
1813
  });
1803
1814
  fastify.register(fastifyRawBody, {
1804
1815
  field: "rawBody",