90dc-core 1.2.4 → 1.2.5
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.map +1 -1
- package/dist/lib/utils/Logger.js +0 -5
- package/dist/lib/utils/Logger.js.map +1 -1
- package/package.json +1 -1
- package/src/index.ts +2 -1
- package/src/lib/utils/Logger.ts +0 -5
- package/dist/lib/utils/Logger/Logger.d.ts +0 -8
- package/dist/lib/utils/Logger/Logger.js +0 -50
- package/dist/lib/utils/Logger/Logger.js.map +0 -1
package/dist/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/index.ts"],"sourcesContent":["//Interfaces\nexport * from \"./lib/models/ProgramInterfaces\";\nexport * from \"./lib/models/ExerciseInterfaces\";\nexport * from \"./lib/models/WorkoutInterfaces\";\nexport * from \"./lib/models/UserInterfaces\";\n\n//Utils\nexport * from \"./lib/utils/Logger\""],"names":[],"mappings":"AAAA,YAAY;AACZ,cAAc,iCAAiC;AAC/C,cAAc,kCAAkC;AAChD,cAAc,iCAAiC;AAC/C,cAAc,8BAA8B;AAE5C,OAAO;AACP,cAAc,qBAAoB"}
|
|
1
|
+
{"version":3,"sources":["../src/index.ts"],"sourcesContent":["//Interfaces\nexport * from \"./lib/models/ProgramInterfaces\";\nexport * from \"./lib/models/ExerciseInterfaces\";\nexport * from \"./lib/models/WorkoutInterfaces\";\nexport * from \"./lib/models/UserInterfaces\";\n\n//Utils\nexport * from \"./lib/utils/Logger\"\n\n"],"names":[],"mappings":"AAAA,YAAY;AACZ,cAAc,iCAAiC;AAC/C,cAAc,kCAAkC;AAChD,cAAc,iCAAiC;AAC/C,cAAc,8BAA8B;AAE5C,OAAO;AACP,cAAc,qBAAoB"}
|
package/dist/lib/utils/Logger.js
CHANGED
|
@@ -36,11 +36,6 @@ class Logger {
|
|
|
36
36
|
(info) => `${info.timestamp}@${this._serviceName}/${info.level}: ${info.message}`));
|
|
37
37
|
const transports = [
|
|
38
38
|
new winston.transports.Console(),
|
|
39
|
-
new winston.transports.File({
|
|
40
|
-
filename: 'logs/error.log',
|
|
41
|
-
level: 'error',
|
|
42
|
-
}),
|
|
43
|
-
new winston.transports.File({ filename: 'logs/all.log' }),
|
|
44
39
|
];
|
|
45
40
|
return winston.createLogger({
|
|
46
41
|
level: level(),
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../src/lib/utils/Logger.ts"],"sourcesContent":["import winston from 'winston'\n\nclass Logger {\n\n private static _serviceName = \"\";\n\n static get serviceName(): string {\n return this._serviceName;\n }\n\n static set serviceName(value: string) {\n this._serviceName = value;\n }\n\n constructor(name: string) {\n Logger._serviceName = name;\n }\n\n public static getLogger(){\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}@${this._serviceName}/${info.level}: ${info.message}`,\n ),\n )\n\n const transports = [\n new winston.transports.Console(),\n
|
|
1
|
+
{"version":3,"sources":["../../../src/lib/utils/Logger.ts"],"sourcesContent":["import winston from 'winston'\n\nclass Logger {\n\n private static _serviceName = \"\";\n\n static get serviceName(): string {\n return this._serviceName;\n }\n\n static set serviceName(value: string) {\n this._serviceName = value;\n }\n\n constructor(name: string) {\n Logger._serviceName = name;\n }\n\n public static getLogger(){\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}@${this._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","_serviceName","serviceName","value","constructor","name","getLogger","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,OAAeC,eAAe,GAAG;IAEjC,WAAWC,cAAsB;QAC/B,OAAO,IAAI,CAACD,YAAY;IAC1B;IAEA,WAAWC,YAAYC,KAAa,EAAE;QACpC,IAAI,CAACF,YAAY,GAAGE;IACtB;IAEAC,YAAYC,IAAY,CAAE;QACxBL,OAAOC,YAAY,GAAGI;IACxB;IAEA,OAAcC,YAAW;QACvB,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;QAEAb,QAAQoB,SAAS,CAACD;QAElB,MAAME,SAAiCrB,QAAQqB,MAAM,CAACC,OAAO,CAC3DtB,QAAQqB,MAAM,CAACE,SAAS,CAAC;YAAEF,QAAQ;QAAyB,IAC5DrB,QAAQqB,MAAM,CAACG,QAAQ,CAAC;YAAEC,KAAK,IAAI;QAAC,IACpCzB,QAAQqB,MAAM,CAACK,MAAM,CACnB,4EAA4E;QAC5E,CAACf,OAAS,CAAC,EAAEA,KAAKY,SAAS,CAAC,CAAC,EAAE,IAAI,CAACrB,YAAY,CAAC,CAAC,EAAES,KAAKG,KAAK,CAAC,EAAE,EAAEH,KAAKgB,OAAO,CAAC,CAAC;QAIrF,MAAMC,aAAa;YACjB,IAAI5B,QAAQ4B,UAAU,CAACC,OAAO;SAC/B;QACD,OAAO7B,QAAQ8B,YAAY,CAAC;YAC1BhB,OAAOA;YACPN;YACAa;YACAO;QACF;IAEF;AACF;AAGA,eAAe3B,OAAM"}
|
package/package.json
CHANGED
package/src/index.ts
CHANGED
package/src/lib/utils/Logger.ts
CHANGED
|
@@ -52,11 +52,6 @@ class Logger {
|
|
|
52
52
|
|
|
53
53
|
const transports = [
|
|
54
54
|
new winston.transports.Console(),
|
|
55
|
-
new winston.transports.File({
|
|
56
|
-
filename: 'logs/error.log',
|
|
57
|
-
level: 'error',
|
|
58
|
-
}),
|
|
59
|
-
new winston.transports.File({ filename: 'logs/all.log' }),
|
|
60
55
|
]
|
|
61
56
|
return winston.createLogger({
|
|
62
57
|
level: level(),
|
|
@@ -1,50 +0,0 @@
|
|
|
1
|
-
import winston from 'winston';
|
|
2
|
-
class Logger {
|
|
3
|
-
static _serviceName = "";
|
|
4
|
-
static get serviceName() {
|
|
5
|
-
return this._serviceName;
|
|
6
|
-
}
|
|
7
|
-
static set serviceName(value) {
|
|
8
|
-
this._serviceName = value;
|
|
9
|
-
}
|
|
10
|
-
static getLogger() {
|
|
11
|
-
const levels = {
|
|
12
|
-
error: 0,
|
|
13
|
-
warn: 1,
|
|
14
|
-
info: 2,
|
|
15
|
-
http: 3,
|
|
16
|
-
debug: 4,
|
|
17
|
-
};
|
|
18
|
-
const level = () => {
|
|
19
|
-
const env = process.env.NODE_ENV || 'development';
|
|
20
|
-
const isDevelopment = env === 'development';
|
|
21
|
-
return isDevelopment ? 'debug' : 'warn';
|
|
22
|
-
};
|
|
23
|
-
const colors = {
|
|
24
|
-
error: 'red',
|
|
25
|
-
warn: 'yellow',
|
|
26
|
-
info: 'green',
|
|
27
|
-
http: 'magenta',
|
|
28
|
-
debug: 'white',
|
|
29
|
-
};
|
|
30
|
-
winston.addColors(colors);
|
|
31
|
-
const format = winston.format.combine(winston.format.timestamp({ format: 'YYYY-MM-DD HH:mm:ss:ms' }), winston.format.colorize({ all: true }), winston.format.printf(
|
|
32
|
-
// eslint-disable-next-line @typescript-eslint/restrict-template-expressions
|
|
33
|
-
(info) => `${info.timestamp}@${this._serviceName} ${info.level}: ${info.message}`));
|
|
34
|
-
const transports = [
|
|
35
|
-
new winston.transports.Console(),
|
|
36
|
-
new winston.transports.File({
|
|
37
|
-
filename: 'logs/error.log',
|
|
38
|
-
level: 'error',
|
|
39
|
-
}),
|
|
40
|
-
new winston.transports.File({ filename: 'logs/all.log' }),
|
|
41
|
-
];
|
|
42
|
-
return winston.createLogger({
|
|
43
|
-
level: level(),
|
|
44
|
-
levels,
|
|
45
|
-
format,
|
|
46
|
-
transports,
|
|
47
|
-
});
|
|
48
|
-
}
|
|
49
|
-
}
|
|
50
|
-
export default Logger;
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../../src/lib/utils/Logger/Logger.ts"],"sourcesContent":["import winston from 'winston'\n\nclass Logger {\n\n private static _serviceName = \"\";\n\n static get serviceName(): string {\n return this._serviceName;\n }\n\n static set serviceName(value: string) {\n this._serviceName = value;\n }\n\n\n\n public static getLogger(){\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}@${this._serviceName} ${info.level}: ${info.message}`,\n ),\n )\n\n const transports = [\n new winston.transports.Console(),\n new winston.transports.File({\n filename: 'logs/error.log',\n level: 'error',\n }),\n new winston.transports.File({ filename: 'logs/all.log' }),\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","_serviceName","serviceName","value","getLogger","levels","error","warn","info","http","debug","level","env","process","NODE_ENV","isDevelopment","colors","addColors","format","combine","timestamp","colorize","all","printf","message","transports","Console","File","filename","createLogger"],"mappings":"AAAA,OAAOA,aAAa,UAAS;AAE7B,MAAMC;IAEJ,OAAeC,eAAe,GAAG;IAEjC,WAAWC,cAAsB;QAC/B,OAAO,IAAI,CAACD,YAAY;IAC1B;IAEA,WAAWC,YAAYC,KAAa,EAAE;QACpC,IAAI,CAACF,YAAY,GAAGE;IACtB;IAIA,OAAcC,YAAW;QACvB,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;QAEAX,QAAQkB,SAAS,CAACD;QAElB,MAAME,SAAiCnB,QAAQmB,MAAM,CAACC,OAAO,CAC3DpB,QAAQmB,MAAM,CAACE,SAAS,CAAC;YAAEF,QAAQ;QAAyB,IAC5DnB,QAAQmB,MAAM,CAACG,QAAQ,CAAC;YAAEC,KAAK,IAAI;QAAC,IACpCvB,QAAQmB,MAAM,CAACK,MAAM,CACnB,4EAA4E;QAC5E,CAACf,OAAS,CAAC,EAAEA,KAAKY,SAAS,CAAC,CAAC,EAAE,IAAI,CAACnB,YAAY,CAAC,CAAC,EAAEO,KAAKG,KAAK,CAAC,EAAE,EAAEH,KAAKgB,OAAO,CAAC,CAAC;QAIrF,MAAMC,aAAa;YACjB,IAAI1B,QAAQ0B,UAAU,CAACC,OAAO;YAC9B,IAAI3B,QAAQ0B,UAAU,CAACE,IAAI,CAAC;gBAC1BC,UAAU;gBACVjB,OAAO;YACT;YACA,IAAIZ,QAAQ0B,UAAU,CAACE,IAAI,CAAC;gBAAEC,UAAU;YAAe;SACxD;QACD,OAAO7B,QAAQ8B,YAAY,CAAC;YAC1BlB,OAAOA;YACPN;YACAa;YACAO;QACF;IAEF;AACF;AAGA,eAAezB,OAAM"}
|