@reldens/utils 0.10.0-beta.3 → 0.10.0-beta.4
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/lib/logger.js +16 -16
- package/package.json +1 -1
package/lib/logger.js
CHANGED
|
@@ -10,14 +10,14 @@ class Logger
|
|
|
10
10
|
{
|
|
11
11
|
logLevels = {
|
|
12
12
|
none: 0,
|
|
13
|
-
debug:
|
|
14
|
-
info:
|
|
15
|
-
notice:
|
|
16
|
-
warning:
|
|
17
|
-
error:
|
|
18
|
-
critical:
|
|
19
|
-
alert:
|
|
20
|
-
emergency:
|
|
13
|
+
debug: 8, // debug-level messages
|
|
14
|
+
info: 7, // informational messages
|
|
15
|
+
notice: 6, // normal but significant condition
|
|
16
|
+
warning: 5, // warning conditions
|
|
17
|
+
error: 4, // error conditions
|
|
18
|
+
critical: 3, // critical conditions
|
|
19
|
+
alert: 2, // action must be taken immediately
|
|
20
|
+
emergency: 1, // system is unusable
|
|
21
21
|
};
|
|
22
22
|
|
|
23
23
|
constructor()
|
|
@@ -39,7 +39,7 @@ class Logger
|
|
|
39
39
|
|
|
40
40
|
debug(...args)
|
|
41
41
|
{
|
|
42
|
-
if(
|
|
42
|
+
if(8 > this.logLevel){
|
|
43
43
|
return;
|
|
44
44
|
}
|
|
45
45
|
this.log('debug', ...args);
|
|
@@ -47,7 +47,7 @@ class Logger
|
|
|
47
47
|
|
|
48
48
|
info(...args)
|
|
49
49
|
{
|
|
50
|
-
if(
|
|
50
|
+
if(7 > this.logLevel){
|
|
51
51
|
return;
|
|
52
52
|
}
|
|
53
53
|
this.log('info', ...args);
|
|
@@ -55,7 +55,7 @@ class Logger
|
|
|
55
55
|
|
|
56
56
|
notice(...args)
|
|
57
57
|
{
|
|
58
|
-
if(
|
|
58
|
+
if(6 > this.logLevel){
|
|
59
59
|
return;
|
|
60
60
|
}
|
|
61
61
|
this.log('notice', ...args);
|
|
@@ -63,7 +63,7 @@ class Logger
|
|
|
63
63
|
|
|
64
64
|
warning(...args)
|
|
65
65
|
{
|
|
66
|
-
if(
|
|
66
|
+
if(5 > this.logLevel){
|
|
67
67
|
return;
|
|
68
68
|
}
|
|
69
69
|
this.log('warning', ...args);
|
|
@@ -71,7 +71,7 @@ class Logger
|
|
|
71
71
|
|
|
72
72
|
error(...args)
|
|
73
73
|
{
|
|
74
|
-
if(
|
|
74
|
+
if(4 > this.logLevel){
|
|
75
75
|
return;
|
|
76
76
|
}
|
|
77
77
|
this.log('error', ...args);
|
|
@@ -79,7 +79,7 @@ class Logger
|
|
|
79
79
|
|
|
80
80
|
critical(...args)
|
|
81
81
|
{
|
|
82
|
-
if(
|
|
82
|
+
if(3 > this.logLevel){
|
|
83
83
|
return;
|
|
84
84
|
}
|
|
85
85
|
this.log('critical', ...args);
|
|
@@ -87,7 +87,7 @@ class Logger
|
|
|
87
87
|
|
|
88
88
|
alert(...args)
|
|
89
89
|
{
|
|
90
|
-
if(
|
|
90
|
+
if(2 > this.logLevel){
|
|
91
91
|
return;
|
|
92
92
|
}
|
|
93
93
|
this.log('alert', ...args);
|
|
@@ -95,7 +95,7 @@ class Logger
|
|
|
95
95
|
|
|
96
96
|
emergency(...args)
|
|
97
97
|
{
|
|
98
|
-
if(
|
|
98
|
+
if(1 > this.logLevel){
|
|
99
99
|
return;
|
|
100
100
|
}
|
|
101
101
|
this.log('emergency', ...args);
|