90dc-core 1.2.6 → 1.2.7

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.
@@ -19,11 +19,12 @@ class Logger {
19
19
  info: 'green',
20
20
  http: 'magenta',
21
21
  debug: 'white',
22
+ serviceName: 'magenta'
22
23
  };
23
24
  winston.addColors(colors);
24
25
  const format = winston.format.combine(winston.format.timestamp({ format: 'YYYY-MM-DD HH:mm:ss:ms' }), winston.format.colorize({ all: true }), winston.format.printf(
25
26
  // eslint-disable-next-line @typescript-eslint/restrict-template-expressions
26
- (info) => `${info.timestamp}@${serviceName}/${info.level}: ${info.message}`));
27
+ (info) => `${info.timestamp}@[${serviceName.toUpperCase()}/${info.level}]: ${info.message}`));
27
28
  const transports = [
28
29
  new winston.transports.Console(),
29
30
  ];
@@ -1 +1 @@
1
- {"version":3,"sources":["../../../src/lib/utils/Logger.ts"],"sourcesContent":["import winston from 'winston'\n\nclass Logger {\n\n public static getLogger(serviceName: string){\n const levels = {\n error: 0,\n warn: 1,\n info: 2,\n http: 3,\n debug: 4,\n }\n\n const level = () => {\n const env = process.env.NODE_ENV || 'development'\n const isDevelopment = env === 'development'\n return isDevelopment ? 'debug' : 'warn'\n }\n\n const colors = {\n error: 'red',\n warn: 'yellow',\n info: 'green',\n http: 'magenta',\n debug: 'white',\n }\n\n winston.addColors(colors)\n\n const format: winston.Logform.Format = winston.format.combine(\n winston.format.timestamp({ format: 'YYYY-MM-DD HH:mm:ss:ms' }),\n winston.format.colorize({ all: true }),\n winston.format.printf(\n // eslint-disable-next-line @typescript-eslint/restrict-template-expressions\n (info) => `${info.timestamp}@${serviceName}/${info.level}: ${info.message}`,\n ),\n )\n\n const transports = [\n new winston.transports.Console(),\n ]\n return winston.createLogger({\n level: level(),\n levels,\n format,\n transports,\n })\n\n }\n}\n\n\nexport default Logger"],"names":["winston","Logger","getLogger","serviceName","levels","error","warn","info","http","debug","level","env","process","NODE_ENV","isDevelopment","colors","addColors","format","combine","timestamp","colorize","all","printf","message","transports","Console","createLogger"],"mappings":"AAAA,OAAOA,aAAa,UAAS;AAE7B,MAAMC;IAEJ,OAAcC,UAAUC,WAAmB,EAAC;QAC1C,MAAMC,SAAS;YACbC,OAAO;YACPC,MAAM;YACNC,MAAM;YACNC,MAAM;YACNC,OAAO;QACT;QAEA,MAAMC,QAAQ,IAAM;YAClB,MAAMC,MAAMC,QAAQD,GAAG,CAACE,QAAQ,IAAI;YACpC,MAAMC,gBAAgBH,QAAQ;YAC9B,OAAOG,gBAAgB,UAAU,MAAM;QACzC;QAEA,MAAMC,SAAS;YACbV,OAAO;YACPC,MAAM;YACNC,MAAM;YACNC,MAAM;YACNC,OAAO;QACT;QAEAT,QAAQgB,SAAS,CAACD;QAElB,MAAME,SAAiCjB,QAAQiB,MAAM,CAACC,OAAO,CAC3DlB,QAAQiB,MAAM,CAACE,SAAS,CAAC;YAAEF,QAAQ;QAAyB,IAC5DjB,QAAQiB,MAAM,CAACG,QAAQ,CAAC;YAAEC,KAAK,IAAI;QAAC,IACpCrB,QAAQiB,MAAM,CAACK,MAAM,CACnB,4EAA4E;QAC5E,CAACf,OAAS,CAAC,EAAEA,KAAKY,SAAS,CAAC,CAAC,EAAEhB,YAAY,CAAC,EAAEI,KAAKG,KAAK,CAAC,EAAE,EAAEH,KAAKgB,OAAO,CAAC,CAAC;QAI/E,MAAMC,aAAa;YACjB,IAAIxB,QAAQwB,UAAU,CAACC,OAAO;SAC/B;QACD,OAAOzB,QAAQ0B,YAAY,CAAC;YAC1BhB,OAAOA;YACPN;YACAa;YACAO;QACF;IAEF;AACF;AAGA,eAAevB,OAAM"}
1
+ {"version":3,"sources":["../../../src/lib/utils/Logger.ts"],"sourcesContent":["import winston from 'winston'\n\nclass Logger {\n\n public static getLogger(serviceName: string){\n const levels = {\n error: 0,\n warn: 1,\n info: 2,\n http: 3,\n debug: 4,\n }\n\n const level = () => {\n const env = process.env.NODE_ENV || 'development'\n const isDevelopment = env === 'development'\n return isDevelopment ? 'debug' : 'warn'\n }\n\n const colors = {\n error: 'red',\n warn: 'yellow',\n info: 'green',\n http: 'magenta',\n debug: 'white',\n serviceName: 'magenta'\n }\n\n winston.addColors(colors)\n\n const format: winston.Logform.Format = winston.format.combine(\n winston.format.timestamp({ format: 'YYYY-MM-DD HH:mm:ss:ms' }),\n winston.format.colorize({ all: true }),\n winston.format.printf(\n // eslint-disable-next-line @typescript-eslint/restrict-template-expressions\n (info) => `${info.timestamp}@[${serviceName.toUpperCase()}/${info.level}]: ${info.message}`,\n ),\n )\n\n const transports = [\n new winston.transports.Console(),\n ]\n return winston.createLogger({\n level: level(),\n levels,\n format,\n transports,\n })\n\n }\n}\n\n\nexport default Logger"],"names":["winston","Logger","getLogger","serviceName","levels","error","warn","info","http","debug","level","env","process","NODE_ENV","isDevelopment","colors","addColors","format","combine","timestamp","colorize","all","printf","toUpperCase","message","transports","Console","createLogger"],"mappings":"AAAA,OAAOA,aAAa,UAAS;AAE7B,MAAMC;IAEJ,OAAcC,UAAUC,WAAmB,EAAC;QAC1C,MAAMC,SAAS;YACbC,OAAO;YACPC,MAAM;YACNC,MAAM;YACNC,MAAM;YACNC,OAAO;QACT;QAEA,MAAMC,QAAQ,IAAM;YAClB,MAAMC,MAAMC,QAAQD,GAAG,CAACE,QAAQ,IAAI;YACpC,MAAMC,gBAAgBH,QAAQ;YAC9B,OAAOG,gBAAgB,UAAU,MAAM;QACzC;QAEA,MAAMC,SAAS;YACbV,OAAO;YACPC,MAAM;YACNC,MAAM;YACNC,MAAM;YACNC,OAAO;YACPN,aAAa;QACf;QAEAH,QAAQgB,SAAS,CAACD;QAElB,MAAME,SAAiCjB,QAAQiB,MAAM,CAACC,OAAO,CAC3DlB,QAAQiB,MAAM,CAACE,SAAS,CAAC;YAAEF,QAAQ;QAAyB,IAC5DjB,QAAQiB,MAAM,CAACG,QAAQ,CAAC;YAAEC,KAAK,IAAI;QAAC,IACpCrB,QAAQiB,MAAM,CAACK,MAAM,CACnB,4EAA4E;QAC5E,CAACf,OAAS,CAAC,EAAEA,KAAKY,SAAS,CAAC,EAAE,EAAEhB,YAAYoB,WAAW,GAAG,CAAC,EAAEhB,KAAKG,KAAK,CAAC,GAAG,EAAEH,KAAKiB,OAAO,CAAC,CAAC;QAI/F,MAAMC,aAAa;YACjB,IAAIzB,QAAQyB,UAAU,CAACC,OAAO;SAC/B;QACD,OAAO1B,QAAQ2B,YAAY,CAAC;YAC1BjB,OAAOA;YACPN;YACAa;YACAQ;QACF;IAEF;AACF;AAGA,eAAexB,OAAM"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "90dc-core",
3
- "version": "1.2.6",
3
+ "version": "1.2.7",
4
4
  "description": "A package that contains utils and interfaces used to create 90dc",
5
5
  "main": "dist/index.js",
6
6
  "type": "module",
@@ -23,6 +23,7 @@ class Logger {
23
23
  info: 'green',
24
24
  http: 'magenta',
25
25
  debug: 'white',
26
+ serviceName: 'magenta'
26
27
  }
27
28
 
28
29
  winston.addColors(colors)
@@ -32,7 +33,7 @@ class Logger {
32
33
  winston.format.colorize({ all: true }),
33
34
  winston.format.printf(
34
35
  // eslint-disable-next-line @typescript-eslint/restrict-template-expressions
35
- (info) => `${info.timestamp}@${serviceName}/${info.level}: ${info.message}`,
36
+ (info) => `${info.timestamp}@[${serviceName.toUpperCase()}/${info.level}]: ${info.message}`,
36
37
  ),
37
38
  )
38
39