namirasoft-log 1.3.0 → 1.3.1
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/Logger.d.ts +1 -0
- package/dist/Logger.js +18 -0
- package/dist/Logger.js.map +1 -1
- package/package.json +2 -2
- package/src/Logger.ts +21 -0
package/dist/Logger.d.ts
CHANGED
|
@@ -7,6 +7,7 @@ export declare class Logger implements ILogger {
|
|
|
7
7
|
private formatter?;
|
|
8
8
|
private customFormatter;
|
|
9
9
|
private streams;
|
|
10
|
+
constructor();
|
|
10
11
|
setFromatter(formatter: IFormatter): void;
|
|
11
12
|
setCustomFormatter(level: LogLevel, formatter: IFormatter): void;
|
|
12
13
|
addStream(stream: IStream): void;
|
package/dist/Logger.js
CHANGED
|
@@ -20,6 +20,24 @@ class Logger {
|
|
|
20
20
|
this.formatter = new FormatterFull_1.FormatterFull();
|
|
21
21
|
this.customFormatter = {};
|
|
22
22
|
this.streams = [];
|
|
23
|
+
this.setFromatter = this.setFromatter.bind(this);
|
|
24
|
+
this.setCustomFormatter = this.setCustomFormatter.bind(this);
|
|
25
|
+
this.addStream = this.addStream.bind(this);
|
|
26
|
+
this.log = this.log.bind(this);
|
|
27
|
+
this.trace = this.trace.bind(this);
|
|
28
|
+
this.verbose = this.verbose.bind(this);
|
|
29
|
+
this.debug = this.debug.bind(this);
|
|
30
|
+
this.info = this.info.bind(this);
|
|
31
|
+
this.warning = this.warning.bind(this);
|
|
32
|
+
this.error = this.error.bind(this);
|
|
33
|
+
this.critical = this.critical.bind(this);
|
|
34
|
+
this.fatal = this.fatal.bind(this);
|
|
35
|
+
this.onCatchError = this.onCatchError.bind(this);
|
|
36
|
+
this.onCatchCritical = this.onCatchCritical.bind(this);
|
|
37
|
+
this.onCatchFatal = this.onCatchFatal.bind(this);
|
|
38
|
+
this.getErrorMessage = this.getErrorMessage.bind(this);
|
|
39
|
+
this.getErrorStack = this.getErrorStack.bind(this);
|
|
40
|
+
this.initUncought = this.initUncought.bind(this);
|
|
23
41
|
}
|
|
24
42
|
setFromatter(formatter) {
|
|
25
43
|
this.formatter = formatter;
|
package/dist/Logger.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Logger.js","sourceRoot":"","sources":["../src/Logger.ts"],"names":[],"mappings":";;;;;;;;;;;;AAAA,mDAAgD;AAIhD,+BAA4B;AAC5B,yCAAsC;AACtC,mDAAgD;AAEhD,MAAa,MAAM;
|
|
1
|
+
{"version":3,"file":"Logger.js","sourceRoot":"","sources":["../src/Logger.ts"],"names":[],"mappings":";;;;;;;;;;;;AAAA,mDAAgD;AAIhD,+BAA4B;AAC5B,yCAAsC;AACtC,mDAAgD;AAEhD,MAAa,MAAM;IAMf;QAJQ,kBAAa,GAAY,IAAI,6BAAa,EAAE,CAAC;QAC7C,cAAS,GAAgB,IAAI,6BAAa,EAAE,CAAC;QAC7C,oBAAe,GAAoC,EAAE,CAAC;QACtD,YAAO,GAAc,EAAE,CAAC;QAG5B,IAAI,CAAC,YAAY,GAAG,IAAI,CAAC,YAAY,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;QACjD,IAAI,CAAC,kBAAkB,GAAG,IAAI,CAAC,kBAAkB,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;QAC7D,IAAI,CAAC,SAAS,GAAG,IAAI,CAAC,SAAS,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;QAC3C,IAAI,CAAC,GAAG,GAAG,IAAI,CAAC,GAAG,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;QAC/B,IAAI,CAAC,KAAK,GAAG,IAAI,CAAC,KAAK,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;QACnC,IAAI,CAAC,OAAO,GAAG,IAAI,CAAC,OAAO,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;QACvC,IAAI,CAAC,KAAK,GAAG,IAAI,CAAC,KAAK,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;QACnC,I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,CAAC,KAAK,CAAC,CAAC,CAAC;QACvF,CAAC;KAAA;IACK,YAAY,CAAC,KAAsB,EAAE,KAAc;;YAErD,MAAM,IAAI,CAAC,KAAK,CAAC,IAAI,CAAC,eAAe,CAAC,KAAK,CAAC,EAAE,KAAK,EAAE,IAAI,CAAC,aAAa,CAAC,KAAK,CAAC,CAAC,CAAC;QACpF,CAAC;KAAA;IACS,eAAe,CAAC,KAAsB;QAE5C,IAAI,KAAK,YAAY,KAAK;YACtB,OAAO,KAAK,CAAC,OAAO,CAAC;QACzB,OAAO,KAAK,GAAG,EAAE,CAAC;IACtB,CAAC;IACS,aAAa,CAAC,KAAsB;;QAE1C,IAAI,KAAK,YAAY,KAAK;YACtB,OAAO,MAAA,KAAK,CAAC,KAAK,mCAAI,EAAE,CAAC;QAC7B,OAAO,KAAK,GAAG,EAAE,CAAC;IACtB,CAAC;IACD,YAAY;IAEZ,CAAC;CACJ;AAjHD,wBAiHC"}
|
package/package.json
CHANGED
|
@@ -8,13 +8,13 @@
|
|
|
8
8
|
"framework": "npm",
|
|
9
9
|
"application": "package",
|
|
10
10
|
"private": false,
|
|
11
|
-
"version": "1.3.
|
|
11
|
+
"version": "1.3.1",
|
|
12
12
|
"main": "./dist/index.js",
|
|
13
13
|
"types": "./dist/index.d.ts",
|
|
14
14
|
"author": "Amir Abolhasani",
|
|
15
15
|
"license": "MIT",
|
|
16
16
|
"scripts": {},
|
|
17
17
|
"dependencies": {
|
|
18
|
-
"@types/node": "^20.11.
|
|
18
|
+
"@types/node": "^20.11.30"
|
|
19
19
|
}
|
|
20
20
|
}
|
package/src/Logger.ts
CHANGED
|
@@ -12,6 +12,27 @@ export class Logger implements ILogger
|
|
|
12
12
|
private formatter?: IFormatter = new FormatterFull();
|
|
13
13
|
private customFormatter: { [level: string]: IFormatter } = {};
|
|
14
14
|
private streams: IStream[] = [];
|
|
15
|
+
constructor()
|
|
16
|
+
{
|
|
17
|
+
this.setFromatter = this.setFromatter.bind(this);
|
|
18
|
+
this.setCustomFormatter = this.setCustomFormatter.bind(this);
|
|
19
|
+
this.addStream = this.addStream.bind(this);
|
|
20
|
+
this.log = this.log.bind(this);
|
|
21
|
+
this.trace = this.trace.bind(this);
|
|
22
|
+
this.verbose = this.verbose.bind(this);
|
|
23
|
+
this.debug = this.debug.bind(this);
|
|
24
|
+
this.info = this.info.bind(this);
|
|
25
|
+
this.warning = this.warning.bind(this);
|
|
26
|
+
this.error = this.error.bind(this);
|
|
27
|
+
this.critical = this.critical.bind(this);
|
|
28
|
+
this.fatal = this.fatal.bind(this);
|
|
29
|
+
this.onCatchError = this.onCatchError.bind(this);
|
|
30
|
+
this.onCatchCritical = this.onCatchCritical.bind(this);
|
|
31
|
+
this.onCatchFatal = this.onCatchFatal.bind(this);
|
|
32
|
+
this.getErrorMessage = this.getErrorMessage.bind(this);
|
|
33
|
+
this.getErrorStack = this.getErrorStack.bind(this);
|
|
34
|
+
this.initUncought = this.initUncought.bind(this);
|
|
35
|
+
}
|
|
15
36
|
setFromatter(formatter: IFormatter): void
|
|
16
37
|
{
|
|
17
38
|
this.formatter = formatter;
|