@xube/kit-log 0.0.90 → 0.0.92
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/xube-log.js +32 -32
- package/package.json +2 -2
package/dist/xube-log.js
CHANGED
|
@@ -1,43 +1,43 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
+
var _a;
|
|
2
3
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
4
|
exports.XubeLog = void 0;
|
|
4
5
|
const colors_1 = require("colors");
|
|
5
6
|
const log_level_1 = require("./log-level");
|
|
6
7
|
class XubeLog {
|
|
7
|
-
level;
|
|
8
|
-
static instance;
|
|
9
8
|
constructor(level) {
|
|
10
9
|
this.level = level;
|
|
10
|
+
this.error = (message, ...optionalParams) => {
|
|
11
|
+
console.error((0, colors_1.red)(message), optionalParams);
|
|
12
|
+
};
|
|
13
|
+
this.warn = (message, ...optionalParams) => {
|
|
14
|
+
if (this.level >= log_level_1.LogLevel.LOG_LEVEL_WARN) {
|
|
15
|
+
console.warn((0, colors_1.yellow)(message), optionalParams);
|
|
16
|
+
}
|
|
17
|
+
};
|
|
18
|
+
this.success = (message, ...optionalParams) => {
|
|
19
|
+
if (this.level >= log_level_1.LogLevel.LOG_LEVEL_INFO) {
|
|
20
|
+
console.log((0, colors_1.green)(message), optionalParams);
|
|
21
|
+
}
|
|
22
|
+
};
|
|
23
|
+
this.log = (message, ...optionalParams) => {
|
|
24
|
+
if (this.level >= log_level_1.LogLevel.LOG_LEVEL_INFO) {
|
|
25
|
+
console.log(message, optionalParams);
|
|
26
|
+
}
|
|
27
|
+
};
|
|
28
|
+
this.info = this.log;
|
|
29
|
+
this.debug = (message, ...optionalParams) => {
|
|
30
|
+
if (this.level >= log_level_1.LogLevel.LOG_LEVEL_DEBUG) {
|
|
31
|
+
console.debug((0, colors_1.blue)(message), optionalParams);
|
|
32
|
+
}
|
|
33
|
+
};
|
|
11
34
|
}
|
|
12
|
-
static getInstance = (level = log_level_1.LogLevel.LOG_LEVEL_INFO) => {
|
|
13
|
-
if (!this.instance) {
|
|
14
|
-
this.instance = new XubeLog(level);
|
|
15
|
-
}
|
|
16
|
-
return this.instance;
|
|
17
|
-
};
|
|
18
|
-
error = (message, ...optionalParams) => {
|
|
19
|
-
console.error((0, colors_1.red)(message), optionalParams);
|
|
20
|
-
};
|
|
21
|
-
warn = (message, ...optionalParams) => {
|
|
22
|
-
if (this.level >= log_level_1.LogLevel.LOG_LEVEL_WARN) {
|
|
23
|
-
console.warn((0, colors_1.yellow)(message), optionalParams);
|
|
24
|
-
}
|
|
25
|
-
};
|
|
26
|
-
success = (message, ...optionalParams) => {
|
|
27
|
-
if (this.level >= log_level_1.LogLevel.LOG_LEVEL_INFO) {
|
|
28
|
-
console.log((0, colors_1.green)(message), optionalParams);
|
|
29
|
-
}
|
|
30
|
-
};
|
|
31
|
-
log = (message, ...optionalParams) => {
|
|
32
|
-
if (this.level >= log_level_1.LogLevel.LOG_LEVEL_INFO) {
|
|
33
|
-
console.log(message, optionalParams);
|
|
34
|
-
}
|
|
35
|
-
};
|
|
36
|
-
info = this.log;
|
|
37
|
-
debug = (message, ...optionalParams) => {
|
|
38
|
-
if (this.level >= log_level_1.LogLevel.LOG_LEVEL_DEBUG) {
|
|
39
|
-
console.debug((0, colors_1.blue)(message), optionalParams);
|
|
40
|
-
}
|
|
41
|
-
};
|
|
42
35
|
}
|
|
43
36
|
exports.XubeLog = XubeLog;
|
|
37
|
+
_a = XubeLog;
|
|
38
|
+
XubeLog.getInstance = (level = log_level_1.LogLevel.LOG_LEVEL_INFO) => {
|
|
39
|
+
if (!_a.instance) {
|
|
40
|
+
_a.instance = new _a(level);
|
|
41
|
+
}
|
|
42
|
+
return _a.instance;
|
|
43
|
+
};
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@xube/kit-log",
|
|
3
|
-
"version": "0.0.
|
|
3
|
+
"version": "0.0.92",
|
|
4
4
|
"description": "",
|
|
5
5
|
"main": "dist/index.js",
|
|
6
6
|
"scripts": {
|
|
@@ -20,6 +20,6 @@
|
|
|
20
20
|
"colors": "^1.4.0"
|
|
21
21
|
},
|
|
22
22
|
"devDependencies": {
|
|
23
|
-
"@xube/kit-build": "^0.0.
|
|
23
|
+
"@xube/kit-build": "^0.0.92"
|
|
24
24
|
}
|
|
25
25
|
}
|