namirasoft-log 1.4.29 → 1.4.31
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/.ns-sdkg-file-keep +11 -11
- package/dist/BaseFormatter.js +7 -7
- package/dist/BaseFormatter.js.map +1 -1
- package/dist/NamirasoftLogServer.d.ts +2 -0
- package/dist/NamirasoftLogServer.js +3 -1
- package/dist/NamirasoftLogServer.js.map +1 -1
- package/dist/NamirasoftLogServerMetrics.d.ts +6 -0
- package/dist/NamirasoftLogServerMetrics.js +28 -0
- package/dist/NamirasoftLogServerMetrics.js.map +1 -0
- package/dist/StreamNamirasoftLog.d.ts +1 -2
- package/dist/StreamNamirasoftLog.js +1 -3
- package/dist/StreamNamirasoftLog.js.map +1 -1
- package/dist/command/LogCreateCommand.js +0 -9
- package/dist/command/LogCreateCommand.js.map +1 -1
- package/dist/command/Log_CreateForCommand.js +0 -9
- package/dist/command/Log_CreateForCommand.js.map +1 -1
- package/dist/command/MetricsCommand.d.ts +4 -0
- package/dist/command/MetricsCommand.js +15 -0
- package/dist/command/MetricsCommand.js.map +1 -0
- package/dist/command/MetricsGetCommand.d.ts +5 -0
- package/dist/command/MetricsGetCommand.js +38 -0
- package/dist/command/MetricsGetCommand.js.map +1 -0
- package/dist/command/cli.js +2 -0
- package/dist/command/cli.js.map +1 -1
- package/dist/index.d.ts +3 -0
- package/dist/index.js +3 -0
- package/dist/index.js.map +1 -1
- package/dist/row/LogCreateRow.d.ts +0 -1
- package/package.json +4 -4
- package/src/BaseFormatter.ts +36 -36
- package/src/FormatterFull.ts +19 -19
- package/src/FormatterShort.ts +12 -12
- package/src/IFormatter.ts +5 -5
- package/src/ILogger.ts +17 -17
- package/src/IStream.ts +4 -4
- package/src/Log.ts +13 -13
- package/src/LogLevel.ts +11 -11
- package/src/Logger.ts +126 -126
- package/src/NamirasoftLogServer.ts +4 -1
- package/src/NamirasoftLogServerMetrics.ts +36 -0
- package/src/StreamConsole.ts +37 -37
- package/src/StreamFile.ts +47 -47
- package/src/StreamNamirasoftLog.ts +64 -67
- package/src/command/LogCreateCommand.ts +0 -9
- package/src/command/Log_CreateForCommand.ts +0 -9
- package/src/command/MetricsCommand.ts +32 -0
- package/src/command/MetricsGetCommand.ts +45 -0
- package/src/command/cli.ts +2 -0
- package/src/index.ts +3 -0
- package/src/row/LogCreateRow.ts +0 -1
package/.ns-sdkg-file-keep
CHANGED
|
@@ -1,12 +1,12 @@
|
|
|
1
|
-
/src/BaseFormatter.ts
|
|
2
|
-
/src/FormatterFull.ts
|
|
3
|
-
/src/FormatterShort.ts
|
|
4
|
-
/src/IFormatter.ts
|
|
5
|
-
/src/ILogger.ts
|
|
6
|
-
/src/IStream.ts
|
|
7
|
-
/src/Log.ts
|
|
8
|
-
/src/Logger.ts
|
|
9
|
-
/src/LogLevel.ts
|
|
10
|
-
/src/StreamConsole.ts
|
|
11
|
-
/src/StreamFile.ts
|
|
1
|
+
/src/BaseFormatter.ts
|
|
2
|
+
/src/FormatterFull.ts
|
|
3
|
+
/src/FormatterShort.ts
|
|
4
|
+
/src/IFormatter.ts
|
|
5
|
+
/src/ILogger.ts
|
|
6
|
+
/src/IStream.ts
|
|
7
|
+
/src/Log.ts
|
|
8
|
+
/src/Logger.ts
|
|
9
|
+
/src/LogLevel.ts
|
|
10
|
+
/src/StreamConsole.ts
|
|
11
|
+
/src/StreamFile.ts
|
|
12
12
|
/src/StreamNamirasoftLog.ts
|
package/dist/BaseFormatter.js
CHANGED
|
@@ -3,18 +3,18 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
3
3
|
exports.BaseFormatter = void 0;
|
|
4
4
|
class BaseFormatter {
|
|
5
5
|
formatDateTime(date) {
|
|
6
|
-
return this.formatDate(date) + " " + this.formatTime(date);
|
|
6
|
+
return this.formatDate(date) + " " + this.formatTime(date) + " UTC";
|
|
7
7
|
}
|
|
8
8
|
formatDate(date) {
|
|
9
|
-
const year = date.
|
|
10
|
-
const month = (date.
|
|
11
|
-
const day = String(date.
|
|
9
|
+
const year = date.getUTCFullYear();
|
|
10
|
+
const month = (date.getUTCMonth() + 1).toString().padStart(2, '0');
|
|
11
|
+
const day = String(date.getUTCDate()).toString().padStart(2, '0');
|
|
12
12
|
return `${year}-${month}-${day}`;
|
|
13
13
|
}
|
|
14
14
|
formatTime(date) {
|
|
15
|
-
const hours = String(date.
|
|
16
|
-
const minutes = String(date.
|
|
17
|
-
const seconds = String(date.
|
|
15
|
+
const hours = String(date.getUTCHours()).padStart(2, '0');
|
|
16
|
+
const minutes = String(date.getUTCMinutes()).padStart(2, '0');
|
|
17
|
+
const seconds = String(date.getUTCSeconds()).padStart(2, '0');
|
|
18
18
|
return `${hours}:${minutes}:${seconds}`;
|
|
19
19
|
}
|
|
20
20
|
qoute(text, size, filler) {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"BaseFormatter.js","sourceRoot":"","sources":["../src/BaseFormatter.ts"],"names":[],"mappings":";;;AAAA,MAAsB,aAAa;IAErB,cAAc,CAAC,IAAU;QAE/B,OAAO,IAAI,CAAC,UAAU,CAAC,IAAI,CAAC,GAAG,GAAG,GAAG,IAAI,CAAC,UAAU,CAAC,IAAI,CAAC,CAAC;
|
|
1
|
+
{"version":3,"file":"BaseFormatter.js","sourceRoot":"","sources":["../src/BaseFormatter.ts"],"names":[],"mappings":";;;AAAA,MAAsB,aAAa;IAErB,cAAc,CAAC,IAAU;QAE/B,OAAO,IAAI,CAAC,UAAU,CAAC,IAAI,CAAC,GAAG,GAAG,GAAG,IAAI,CAAC,UAAU,CAAC,IAAI,CAAC,GAAG,MAAM,CAAC;IACxE,CAAC;IACS,UAAU,CAAC,IAAU;QAE3B,MAAM,IAAI,GAAG,IAAI,CAAC,cAAc,EAAE,CAAC;QACnC,MAAM,KAAK,GAAG,CAAC,IAAI,CAAC,WAAW,EAAE,GAAG,CAAC,CAAC,CAAC,QAAQ,EAAE,CAAC,QAAQ,CAAC,CAAC,EAAE,GAAG,CAA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G,EAAE,CAAC;QAClB,CAAC,CAAC,CAAC;IACP,CAAC;CACJ;AApCD,sCAoCC"}
|
|
@@ -5,10 +5,12 @@ import { NamirasoftLogServerLogGroup } from "./NamirasoftLogServerLogGroup";
|
|
|
5
5
|
import { NamirasoftLogServerLogGroupCategory } from "./NamirasoftLogServerLogGroupCategory";
|
|
6
6
|
import { NamirasoftLogServerLogGroupField } from "./NamirasoftLogServerLogGroupField";
|
|
7
7
|
import { NamirasoftLogServerLogGroupTag } from "./NamirasoftLogServerLogGroupTag";
|
|
8
|
+
import { NamirasoftLogServerMetrics } from "./NamirasoftLogServerMetrics";
|
|
8
9
|
import { NamirasoftLogServerValue } from "./NamirasoftLogServerValue";
|
|
9
10
|
import { TokenManager } from "namirasoft-account";
|
|
10
11
|
export declare class NamirasoftLogServer extends NSABaseServer {
|
|
11
12
|
healthz: NamirasoftLogServerHealthz;
|
|
13
|
+
metrics: NamirasoftLogServerMetrics;
|
|
12
14
|
value: NamirasoftLogServerValue;
|
|
13
15
|
log_group_category: NamirasoftLogServerLogGroupCategory;
|
|
14
16
|
log_group_field: NamirasoftLogServerLogGroupField;
|
|
@@ -8,11 +8,13 @@ const NamirasoftLogServerLogGroup_1 = require("./NamirasoftLogServerLogGroup");
|
|
|
8
8
|
const NamirasoftLogServerLogGroupCategory_1 = require("./NamirasoftLogServerLogGroupCategory");
|
|
9
9
|
const NamirasoftLogServerLogGroupField_1 = require("./NamirasoftLogServerLogGroupField");
|
|
10
10
|
const NamirasoftLogServerLogGroupTag_1 = require("./NamirasoftLogServerLogGroupTag");
|
|
11
|
+
const NamirasoftLogServerMetrics_1 = require("./NamirasoftLogServerMetrics");
|
|
11
12
|
const NamirasoftLogServerValue_1 = require("./NamirasoftLogServerValue");
|
|
12
13
|
class NamirasoftLogServer extends namirasoft_account_1.NSABaseServer {
|
|
13
14
|
constructor(base_url, manager, onError) {
|
|
14
|
-
super(base_url, `1.4.
|
|
15
|
+
super(base_url, `1.4.30`, manager, onError);
|
|
15
16
|
this.healthz = new NamirasoftLogServerHealthz_1.NamirasoftLogServerHealthz(this);
|
|
17
|
+
this.metrics = new NamirasoftLogServerMetrics_1.NamirasoftLogServerMetrics(this);
|
|
16
18
|
this.value = new NamirasoftLogServerValue_1.NamirasoftLogServerValue(this);
|
|
17
19
|
this.log_group_category = new NamirasoftLogServerLogGroupCategory_1.NamirasoftLogServerLogGroupCategory(this);
|
|
18
20
|
this.log_group_field = new NamirasoftLogServerLogGroupField_1.NamirasoftLogServerLogGroupField(this);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"NamirasoftLogServer.js","sourceRoot":"","sources":["../src/NamirasoftLogServer.ts"],"names":[],"mappings":";;;AAoBA,2DAAmD;AACnD,6EAA0E;AAC1E,qEAAkE;AAClE,+EAA4E;AAC5E,+FAA4F;AAC5F,yFAAsF;AACtF,qFAAkF;AAClF,yEAAsE;AAGtE,MAAa,mBAAoB,SAAQ,kCAAa;
|
|
1
|
+
{"version":3,"file":"NamirasoftLogServer.js","sourceRoot":"","sources":["../src/NamirasoftLogServer.ts"],"names":[],"mappings":";;;AAoBA,2DAAmD;AACnD,6EAA0E;AAC1E,qEAAkE;AAClE,+EAA4E;AAC5E,+FAA4F;AAC5F,yFAAsF;AACtF,qFAAkF;AAClF,6EAA0E;AAC1E,yEAAsE;AAGtE,MAAa,mBAAoB,SAAQ,kCAAa;IAUlD,YAAY,QAAgB,EAAE,OAAqB,EAAE,OAA+B;QAEhF,KAAK,CAAC,QAAQ,EAAE,QAAQ,EAAE,OAAO,EAAE,OAAO,CAAC,CAAC;QAC5C,IAAI,CAAC,OAAO,GAAG,IAAI,uDAA0B,CAAC,IAAI,CAAC,CAAC;QACpD,IAAI,CAAC,OAAO,GAAG,IAAI,uDAA0B,CAAC,IAAI,CAAC,CAAC;QACpD,IAAI,CAAC,KAAK,GAAG,IAAI,mDAAwB,CAAC,IAAI,CAAC,CAAC;QAChD,IAAI,CAAC,kBAAkB,GAAG,IAAI,yEAAmC,CAAC,IAAI,CAAC,CAAC;QACxE,IAAI,CAAC,eAAe,GAAG,IAAI,mEAAgC,CAAC,IAAI,CAAC,CAAC;QAClE,IAAI,CAAC,aAAa,GAAG,IAAI,+DAA8B,CAAC,IAAI,CAAC,CAAC;QAC9D,IAAI,CAAC,SAAS,GAAG,IAAI,yDAA2B,CAAC,IAAI,CAAC,CAAC;QACvD,IAAI,CAAC,GAAG,GAAG,IAAI,+CAAsB,CAAC,IAAI,CAAC,CAAC;IAChD,CAAC;CACJ;AAtBD,kDAsBC;AAAA,CAAC"}
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import { NamirasoftLogServer } from "./NamirasoftLogServer";
|
|
2
|
+
import { NamirasoftLogServerBase } from "./NamirasoftLogServerBase";
|
|
3
|
+
export declare class NamirasoftLogServerMetrics extends NamirasoftLogServerBase {
|
|
4
|
+
constructor(server: NamirasoftLogServer);
|
|
5
|
+
Get(): Promise<void>;
|
|
6
|
+
}
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
|
3
|
+
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
4
|
+
return new (P || (P = Promise))(function (resolve, reject) {
|
|
5
|
+
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
|
6
|
+
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
|
7
|
+
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
|
8
|
+
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
9
|
+
});
|
|
10
|
+
};
|
|
11
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
12
|
+
exports.NamirasoftLogServerMetrics = void 0;
|
|
13
|
+
const NamirasoftLogServerBase_1 = require("./NamirasoftLogServerBase");
|
|
14
|
+
class NamirasoftLogServerMetrics extends NamirasoftLogServerBase_1.NamirasoftLogServerBase {
|
|
15
|
+
constructor(server) {
|
|
16
|
+
super(server);
|
|
17
|
+
this.Get = this.Get.bind(this);
|
|
18
|
+
}
|
|
19
|
+
Get() {
|
|
20
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
21
|
+
let path = `/metrics`;
|
|
22
|
+
yield this.server._get(path, {});
|
|
23
|
+
});
|
|
24
|
+
}
|
|
25
|
+
}
|
|
26
|
+
exports.NamirasoftLogServerMetrics = NamirasoftLogServerMetrics;
|
|
27
|
+
;
|
|
28
|
+
//# sourceMappingURL=NamirasoftLogServerMetrics.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"NamirasoftLogServerMetrics.js","sourceRoot":"","sources":["../src/NamirasoftLogServerMetrics.ts"],"names":[],"mappings":";;;;;;;;;;;;AAqBA,uEAAoE;AAEpE,MAAa,0BAA2B,SAAQ,iDAAuB;IAEnE,YAAY,MAA2B;QAEnC,KAAK,CAAC,MAAM,CAAC,CAAC;QACd,IAAI,CAAC,GAAG,GAAG,IAAI,CAAC,GAAG,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;IACnC,CAAC;IACK,GAAG;;YAEL,IAAI,IAAI,GAAG,UAAU,CAAC;YACtB,MAAM,IAAI,CAAC,MAAM,CAAC,IAAI,CAAO,IAAI,EAAE,EAAE,CAAC,CAAC;QAC3C,CAAC;KAAA;CACJ;AAZD,gEAYC;AAAA,CAAC"}
|
|
@@ -8,8 +8,7 @@ export declare class StreamNamirasoftLog implements IStream {
|
|
|
8
8
|
user_id?: string;
|
|
9
9
|
log_group_id: string;
|
|
10
10
|
getProductID: () => (string | null);
|
|
11
|
-
|
|
12
|
-
constructor(server: NamirasoftLogServer, log_group_id: string, getProductID: () => (string | null), getWorkspaceID: () => (string | null));
|
|
11
|
+
constructor(server: NamirasoftLogServer, log_group_id: string, getProductID: () => (string | null));
|
|
13
12
|
write(log: Log, formated: {
|
|
14
13
|
pre: string[];
|
|
15
14
|
messages: string[];
|
|
@@ -11,13 +11,12 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge
|
|
|
11
11
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
12
12
|
exports.StreamNamirasoftLog = void 0;
|
|
13
13
|
class StreamNamirasoftLog {
|
|
14
|
-
constructor(server, log_group_id, getProductID
|
|
14
|
+
constructor(server, log_group_id, getProductID) {
|
|
15
15
|
this.queue = [];
|
|
16
16
|
this.isProcessing = false;
|
|
17
17
|
this.server = server;
|
|
18
18
|
this.log_group_id = log_group_id;
|
|
19
19
|
this.getProductID = getProductID;
|
|
20
|
-
this.getWorkspaceID = getWorkspaceID;
|
|
21
20
|
}
|
|
22
21
|
write(log, formated) {
|
|
23
22
|
if (process.env.NAMIRASOFT_STANDALNOE)
|
|
@@ -27,7 +26,6 @@ class StreamNamirasoftLog {
|
|
|
27
26
|
level: log.level.toString(),
|
|
28
27
|
log_group_id: this.log_group_id,
|
|
29
28
|
product_id: this.getProductID(),
|
|
30
|
-
workspace_id: this.getWorkspaceID(),
|
|
31
29
|
message
|
|
32
30
|
};
|
|
33
31
|
this.queue.push(() => __awaiter(this, void 0, void 0, function* () {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"StreamNamirasoftLog.js","sourceRoot":"","sources":["../src/StreamNamirasoftLog.ts"],"names":[],"mappings":";;;;;;;;;;;;AAIA,MAAa,mBAAmB;
|
|
1
|
+
{"version":3,"file":"StreamNamirasoftLog.js","sourceRoot":"","sources":["../src/StreamNamirasoftLog.ts"],"names":[],"mappings":";;;;;;;;;;;;AAIA,MAAa,mBAAmB;IAQ5B,YAAY,MAA2B,EAAE,YAAoB,EAAE,YAAmC;QAN1F,UAAK,GAA4B,EAAE,CAAC;QACpC,iBAAY,GAAG,KAAK,CAAC;QAOzB,IAAI,CAAC,MAAM,GAAG,MAAM,CAAC;QACrB,IAAI,CAAC,YAAY,GAAG,YAAY,CAAC;QACjC,IAAI,CAAC,YAAY,GAAG,Y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C;gBACG,IAAI,CAAC,YAAY,GAAG,KAAK,CAAC;YAC9B,CAAC;QACL,CAAC;KAAA;CACJ;AA5DD,kDA4DC"}
|
|
@@ -33,14 +33,6 @@ class LogCreateCommand extends namirasoft_node_cli_1.BaseFinalCommand {
|
|
|
33
33
|
args: ["product_id"],
|
|
34
34
|
defaults: [""]
|
|
35
35
|
},
|
|
36
|
-
{
|
|
37
|
-
name: "workspace_id",
|
|
38
|
-
short: "",
|
|
39
|
-
description: "Provides the value of 'workspace_id' in body",
|
|
40
|
-
optional: true,
|
|
41
|
-
args: ["workspace_id"],
|
|
42
|
-
defaults: [""]
|
|
43
|
-
},
|
|
44
36
|
{
|
|
45
37
|
name: "level",
|
|
46
38
|
short: "",
|
|
@@ -72,7 +64,6 @@ class LogCreateCommand extends namirasoft_node_cli_1.BaseFinalCommand {
|
|
|
72
64
|
let ans = yield server.log.Create({
|
|
73
65
|
log_group_id: this.option_values.log_group_id,
|
|
74
66
|
product_id: this.option_values.product_id,
|
|
75
|
-
workspace_id: this.option_values.workspace_id,
|
|
76
67
|
level: this.option_values.level,
|
|
77
68
|
message: this.option_values.message
|
|
78
69
|
});
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"LogCreateCommand.js","sourceRoot":"","sources":["../../src/command/LogCreateCommand.ts"],"names":[],"mappings":";;;;;;;;;;;;AAoBA,6DAAuD;AACvD,qDAA0D;AAC1D,gEAA6D;AAC7D,2DAAkD;AAElD,MAAa,gBAAiB,SAAQ,sCAAgB;IAElD,YAAY,IAAc;QAEtB,KAAK,CAAC,IAAI,EAAE,EAAE,EAAE;YACZ;gBACI,IAAI,EAAE,cAAc;gBACpB,KAAK,EAAE,EAAE;gBACT,WAAW,EAAE,8CAA8C;gBAC3D,QAAQ,EAAE,KAAK;gBACf,IAAI,EAAE,CAAC,cAAc,CAAC;gBACtB,QAAQ,EAAE,CAAC,EAAE,CAAC;aACjB;YACD;gBACI,IAAI,EAAE,YAAY;gBAClB,KAAK,E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",
|
|
38
|
-
short: "",
|
|
39
|
-
description: "Provides the value of 'workspace_id' in body",
|
|
40
|
-
optional: true,
|
|
41
|
-
args: ["workspace_id"],
|
|
42
|
-
defaults: [""]
|
|
43
|
-
},
|
|
44
36
|
{
|
|
45
37
|
name: "level",
|
|
46
38
|
short: "",
|
|
@@ -72,7 +64,6 @@ class Log_CreateForCommand extends namirasoft_node_cli_1.BaseFinalCommand {
|
|
|
72
64
|
let ans = yield server.log._CreateFor(this.arg_values[0], {
|
|
73
65
|
log_group_id: this.option_values.log_group_id,
|
|
74
66
|
product_id: this.option_values.product_id,
|
|
75
|
-
workspace_id: this.option_values.workspace_id,
|
|
76
67
|
level: this.option_values.level,
|
|
77
68
|
message: this.option_values.message
|
|
78
69
|
});
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Log_CreateForCommand.js","sourceRoot":"","sources":["../../src/command/Log_CreateForCommand.ts"],"names":[],"mappings":";;;;;;;;;;;;AAoBA,6DAAuD;AACvD,qDAA0D;AAC1D,gEAA6D;AAC7D,2DAAkD;AAElD,MAAa,oBAAqB,SAAQ,sCAAgB;IAEtD,YAAY,IAAc;QAEtB,KAAK,CAAC,IAAI,EAAE,CAAC,SAAS,CAAC,EAAE;YACrB;gBACI,IAAI,EAAE,cAAc;gBACpB,KAAK,EAAE,EAAE;gBACT,WAAW,EAAE,8CAA8C;gBAC3D,QAAQ,EAAE,KAAK;gBACf,IAAI,EAAE,CAAC,cAAc,CAAC;gBACtB,QAAQ,EAAE,CAAC,EAAE,CAAC;aACjB;YACD;gBACI,IAAI,EAAE,YAAY;gBAClB,KAAK,EAAE,EAAE;gBACT,WAAW,EAAE,4CAA4C;gBACzD,QAAQ,EAAE,IAAI;gBACd,IAAI,EAAE,CAAC,YAAY,CAAC;gBACpB,QAAQ,EAAE,CAAC,EAAE,CAAC;aACjB;YACD;gBACI,IAAI,EAAE,
|
|
1
|
+
{"version":3,"file":"Log_CreateForCommand.js","sourceRoot":"","sources":["../../src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I,OAAO,GAAG,IAAI,iCAAY,CAAC,OAAO,EAAE,GAAG,EAAE,GAAG,CAAC,CAAC,CAAC;YACnD,OAAO,CAAC,QAAQ,CAAC,KAAK,EAAE,KAAK,CAAC,CAAC;YAC/B,IAAI,GAAG,GAAG,IAAI,CAAC,GAAG,CAAC,OAAO,CAAC,OAAO,CAAC,mBAAmB,CAAC,CAAC;YACxD,IAAI,MAAM,GAAG,IAAI,yCAAmB,CAAC,GAAG,EAAE,OAAO,EAAE,CAAC,CAAC,EAAE,CAAC,IAAI,CAAC,GAAG,CAAC,MAAM,CAAC,KAAK,CAAC,CAAC,CAAC,OAAO,CAAC,CAAC,CAAC;YAC1F,IAAI,GAAG,GAAG,MAAM,MAAM,CAAC,GAAG,CAAC,UAAU,CAAC,IAAI,CAAC,UAAU,CAAC,CAAC,CAAC,EAAE;gBACtD,YAAY,EAAE,IAAI,CAAC,aAAa,CAAC,YAAY;gBAC7C,UAAU,EAAE,IAAI,CAAC,aAAa,CAAC,UAAU;gBACzC,KAAK,EAAE,IAAI,CAAC,aAAa,CAAC,KAAK;gBAC/B,OAAO,EAAE,IAAI,CAAC,aAAa,CAAC,OAAO;aACtC,CAAC,CAAC;YACH,IAAI,CAAC,GAAG,CAAC,MAAM,CAAC,OAAO,CAAC,IAAI,CAAC,SAAS,CAAC,GAAG,CAAC,CAAC,CAAC;QACjD,CAAC;KAAA;CACJ;AAzDD,oDAyDC;AAAA,CAAC"}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.MetricsCommand = void 0;
|
|
4
|
+
const namirasoft_node_cli_1 = require("namirasoft-node-cli");
|
|
5
|
+
const MetricsGetCommand_1 = require("./MetricsGetCommand");
|
|
6
|
+
class MetricsCommand extends namirasoft_node_cli_1.BaseNavigatorCommand {
|
|
7
|
+
constructor(argv) {
|
|
8
|
+
super(argv, {
|
|
9
|
+
"get": MetricsGetCommand_1.MetricsGetCommand,
|
|
10
|
+
});
|
|
11
|
+
}
|
|
12
|
+
}
|
|
13
|
+
exports.MetricsCommand = MetricsCommand;
|
|
14
|
+
;
|
|
15
|
+
//# sourceMappingURL=MetricsCommand.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"MetricsCommand.js","sourceRoot":"","sources":["../../src/command/MetricsCommand.ts"],"names":[],"mappings":";;;AAoBA,6DAA2D;AAC3D,2DAAwD;AAExD,MAAa,cAAe,SAAQ,0CAAoB;IAEpD,YAAY,IAAc;QAEtB,KAAK,CAAC,IAAI,EAAE;YACR,KAAK,EAAE,qCAAiB;SAC3B,CAAC,CAAC;IACP,CAAC;CACJ;AARD,wCAQC;AAAA,CAAC"}
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
|
3
|
+
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
4
|
+
return new (P || (P = Promise))(function (resolve, reject) {
|
|
5
|
+
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
|
6
|
+
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
|
7
|
+
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
|
8
|
+
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
9
|
+
});
|
|
10
|
+
};
|
|
11
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
12
|
+
exports.MetricsGetCommand = void 0;
|
|
13
|
+
const namirasoft_node_cli_1 = require("namirasoft-node-cli");
|
|
14
|
+
const namirasoft_core_1 = require("namirasoft-core");
|
|
15
|
+
const NamirasoftLogServer_1 = require("../NamirasoftLogServer");
|
|
16
|
+
const namirasoft_account_1 = require("namirasoft-account");
|
|
17
|
+
class MetricsGetCommand extends namirasoft_node_cli_1.BaseFinalCommand {
|
|
18
|
+
constructor(argv) {
|
|
19
|
+
super(argv, [], []);
|
|
20
|
+
}
|
|
21
|
+
exec() {
|
|
22
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
23
|
+
let token = this.app.storage.getNSAToken();
|
|
24
|
+
if (token == null)
|
|
25
|
+
throw new Error("Token is not available. Please login first using:\nns-log account config \nor \nns-log account login.");
|
|
26
|
+
let storage = new namirasoft_core_1.IStorageMemoryDedicated();
|
|
27
|
+
let manager = new namirasoft_account_1.TokenManager(storage, () => { });
|
|
28
|
+
manager.setValue(token, false);
|
|
29
|
+
let url = this.app.storage.getItem("ns-log-server-url");
|
|
30
|
+
let server = new NamirasoftLogServer_1.NamirasoftLogServer(url, manager, e => this.app.logger.error(e.message));
|
|
31
|
+
let ans = yield server.metrics.Get();
|
|
32
|
+
this.app.logger.success(JSON.stringify(ans));
|
|
33
|
+
});
|
|
34
|
+
}
|
|
35
|
+
}
|
|
36
|
+
exports.MetricsGetCommand = MetricsGetCommand;
|
|
37
|
+
;
|
|
38
|
+
//# sourceMappingURL=MetricsGetCommand.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"MetricsGetCommand.js","sourceRoot":"","sources":["../../src/command/MetricsGetCommand.ts"],"names":[],"mappings":";;;;;;;;;;;;AAoBA,6DAAuD;AACvD,qDAA0D;AAC1D,gEAA6D;AAC7D,2DAAkD;AAElD,MAAa,iBAAkB,SAAQ,sCAAgB;IAEnD,YAAY,IAAc;QAEtB,KAAK,CAAC,IAAI,EAAE,EAAE,EAAE,EAAE,CAAC,CAAC;IACxB,CAAC;IACc,IAAI;;YAEf,IAAI,KAAK,GAAG,IAAI,CAAC,GAAG,CAAC,OAAO,CAAC,WAAW,EAAE,CAAC;YAC3C,IAAI,KAAK,IAAI,IAAI;gBACb,MAAM,IAAI,KAAK,CAAC,uGAAuG,CAAC,CAAC;YAC7H,IAAI,OAAO,GAAG,IAAI,yCAAuB,EAAE,CAAC;YAC5C,IAAI,OAAO,GAAG,IAAI,iCAAY,CAAC,OAAO,EAAE,GAAG,EAAE,GAAG,CAAC,CAAC,CAAC;YACnD,OAAO,CAAC,QAAQ,CAAC,KAAK,EAAE,KAAK,CAAC,CAAC;YAC/B,IAAI,GAAG,GAAG,IAAI,CAAC,GAAG,CAAC,OAAO,CAAC,OAAO,CAAC,mBAAmB,CAAC,CAAC;YACxD,IAAI,MAAM,GAAG,IAAI,yCAAmB,CAAC,GAAG,EAAE,OAAO,EAAE,CAAC,CAAC,EAAE,CAAC,IAAI,CAAC,GAAG,CAAC,MAAM,CAAC,KAAK,CAAC,CAAC,CAAC,OAAO,CAAC,CAAC,CAAC;YAC1F,IAAI,GAAG,GAAG,MAAM,MAAM,CAAC,OAAO,CAAC,GAAG,EAAE,CAAC;YACrC,IAAI,CAAC,GAAG,CAAC,MAAM,CAAC,OAAO,CAAC,IAAI,CAAC,SAAS,CAAC,GAAG,CAAC,CAAC,CAAC;QACjD,CAAC;KAAA;CACJ;AAnBD,8CAmBC;AAAA,CAAC"}
|
package/dist/command/cli.js
CHANGED
|
@@ -10,9 +10,11 @@ const LogGroupCategoryCommand_1 = require("./LogGroupCategoryCommand");
|
|
|
10
10
|
const LogGroupCommand_1 = require("./LogGroupCommand");
|
|
11
11
|
const LogGroupFieldCommand_1 = require("./LogGroupFieldCommand");
|
|
12
12
|
const LogGroupTagCommand_1 = require("./LogGroupTagCommand");
|
|
13
|
+
const MetricsCommand_1 = require("./MetricsCommand");
|
|
13
14
|
const ValueCommand_1 = require("./ValueCommand");
|
|
14
15
|
let app = new namirasoft_node_cli_1.Application("ns-log", new namirasoft_node_cli_1.BaseStorage(), {
|
|
15
16
|
"healthz": HealthzCommand_1.HealthzCommand,
|
|
17
|
+
"metrics": MetricsCommand_1.MetricsCommand,
|
|
16
18
|
"value": ValueCommand_1.ValueCommand,
|
|
17
19
|
"loggroupcategory": LogGroupCategoryCommand_1.LogGroupCategoryCommand,
|
|
18
20
|
"loggroupfield": LogGroupFieldCommand_1.LogGroupFieldCommand,
|
package/dist/command/cli.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"cli.js","sourceRoot":"","sources":["../../src/command/cli.ts"],"names":[],"mappings":";;;AAqBA,2DAAoD;AACpD,6DAA+D;AAC/D,6DAAoD;AACpD,qDAAkD;AAClD,6CAA0C;AAC1C,uEAAoE;AACpE,uDAAoD;AACpD,iEAA8D;AAC9D,6DAA0D;AAC1D,iDAA8C;AAE9C,IAAI,GAAG,GAAG,IAAI,iCAAW,CAAC,QAAQ,EAAE,IAAI,iCAAW,EAAE,EACjD;IACI,SAAS,EAAE,+BAAc;IACzB,OAAO,EAAE,2BAAY;IACrB,kBAAkB,EAAE,iDAAuB;IAC3C,eAAe,EAAE,2CAAoB;IACrC,aAAa,EAAE,uCAAkB;IACjC,UAAU,EAAE,iCAAe;IAC3B,KAAK,EAAE,uBAAU;IACjB,SAAS,EAAE,mCAAc;IACzB,QAAQ,EAAE,CAAC,IAAc,EAAE,EAAE,CAAC,IAAI,mCAAa,CAAC,IAAI,EAAE,CAAC,mBAAmB,CAAC,CAAC;CAC/E,CAAC,CAAC;AACP,GAAG,CAAC,GAAG,EAAE,CAAC"}
|
|
1
|
+
{"version":3,"file":"cli.js","sourceRoot":"","sources":["../../src/command/cli.ts"],"names":[],"mappings":";;;AAqBA,2DAAoD;AACpD,6DAA+D;AAC/D,6DAAoD;AACpD,qDAAkD;AAClD,6CAA0C;AAC1C,uEAAoE;AACpE,uDAAoD;AACpD,iEAA8D;AAC9D,6DAA0D;AAC1D,qDAAkD;AAClD,iDAA8C;AAE9C,IAAI,GAAG,GAAG,IAAI,iCAAW,CAAC,QAAQ,EAAE,IAAI,iCAAW,EAAE,EACjD;IACI,SAAS,EAAE,+BAAc;IACzB,SAAS,EAAE,+BAAc;IACzB,OAAO,EAAE,2BAAY;IACrB,kBAAkB,EAAE,iDAAuB;IAC3C,eAAe,EAAE,2CAAoB;IACrC,aAAa,EAAE,uCAAkB;IACjC,UAAU,EAAE,iCAAe;IAC3B,KAAK,EAAE,uBAAU;IACjB,SAAS,EAAE,mCAAc;IACzB,QAAQ,EAAE,CAAC,IAAc,EAAE,EAAE,CAAC,IAAI,mCAAa,CAAC,IAAI,EAAE,CAAC,mBAAmB,CAAC,CAAC;CAC/E,CAAC,CAAC;AACP,GAAG,CAAC,GAAG,EAAE,CAAC"}
|
package/dist/index.d.ts
CHANGED
|
@@ -15,6 +15,7 @@ export * from "./NamirasoftLogServerLogGroup";
|
|
|
15
15
|
export * from "./NamirasoftLogServerLogGroupCategory";
|
|
16
16
|
export * from "./NamirasoftLogServerLogGroupField";
|
|
17
17
|
export * from "./NamirasoftLogServerLogGroupTag";
|
|
18
|
+
export * from "./NamirasoftLogServerMetrics";
|
|
18
19
|
export * from "./NamirasoftLogServerValue";
|
|
19
20
|
export * from "./StreamConsole";
|
|
20
21
|
export * from "./StreamFile";
|
|
@@ -49,6 +50,8 @@ export * from "./command/LogGroupTagUpdateCommand";
|
|
|
49
50
|
export * from "./command/LogGroupUpdateCommand";
|
|
50
51
|
export * from "./command/LogListCommand";
|
|
51
52
|
export * from "./command/Log_CreateForCommand";
|
|
53
|
+
export * from "./command/MetricsCommand";
|
|
54
|
+
export * from "./command/MetricsGetCommand";
|
|
52
55
|
export * from "./command/ValueCommand";
|
|
53
56
|
export * from "./command/ValueListCommand";
|
|
54
57
|
export * from "./enum/LogGroupRetentionUnit";
|
package/dist/index.js
CHANGED
|
@@ -31,6 +31,7 @@ __exportStar(require("./NamirasoftLogServerLogGroup"), exports);
|
|
|
31
31
|
__exportStar(require("./NamirasoftLogServerLogGroupCategory"), exports);
|
|
32
32
|
__exportStar(require("./NamirasoftLogServerLogGroupField"), exports);
|
|
33
33
|
__exportStar(require("./NamirasoftLogServerLogGroupTag"), exports);
|
|
34
|
+
__exportStar(require("./NamirasoftLogServerMetrics"), exports);
|
|
34
35
|
__exportStar(require("./NamirasoftLogServerValue"), exports);
|
|
35
36
|
__exportStar(require("./StreamConsole"), exports);
|
|
36
37
|
__exportStar(require("./StreamFile"), exports);
|
|
@@ -65,6 +66,8 @@ __exportStar(require("./command/LogGroupTagUpdateCommand"), exports);
|
|
|
65
66
|
__exportStar(require("./command/LogGroupUpdateCommand"), exports);
|
|
66
67
|
__exportStar(require("./command/LogListCommand"), exports);
|
|
67
68
|
__exportStar(require("./command/Log_CreateForCommand"), exports);
|
|
69
|
+
__exportStar(require("./command/MetricsCommand"), exports);
|
|
70
|
+
__exportStar(require("./command/MetricsGetCommand"), exports);
|
|
68
71
|
__exportStar(require("./command/ValueCommand"), exports);
|
|
69
72
|
__exportStar(require("./command/ValueListCommand"), exports);
|
|
70
73
|
__exportStar(require("./enum/LogGroupRetentionUnit"), exports);
|
package/dist/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAoBA,kDAAgC;AAChC,kDAAgC;AAChC,mDAAiC;AACjC,+CAA6B;AAC7B,4CAA0B;AAC1B,4CAA0B;AAC1B,wCAAsB;AACtB,6CAA2B;AAC3B,2CAAyB;AACzB,wDAAsC;AACtC,4DAA0C;AAC1C,+DAA6C;AAC7C,2DAAyC;AACzC,gEAA8C;AAC9C,wEAAsD;AACtD,qEAAmD;AACnD,mEAAiD;AACjD,6DAA2C;AAC3C,kDAAgC;AAChC,+CAA6B;AAC7B,wDAAsC;AACtC,2DAAyC;AACzC,8DAA4C;AAC5C,uDAAqC;AACrC,6DAA2C;AAC3C,0DAAwC;AACxC,oEAAkD;AAClD,0EAAwD;AACxD,0EAAwD;AACxD,uEAAqD;AACrD,wEAAsD;AACtD,4DAA0C;AAC1C,kEAAgD;AAChD,kEAAgD;AAChD,iEAA+C;AAC/C,uEAAqD;AACrD,uEAAqD;AACrD,oEAAkD;AAClD,qEAAmD;AACnD,uEAAqD;AACrD,+DAA6C;AAC7C,gEAA8C;AAC9C,+DAA6C;AAC7C,qEAAmD;AACnD,qEAAmD;AACnD,kEAAgD;AAChD,mEAAiD;AACjD,qEAAmD;AACnD,kEAAgD;AAChD,2DAAyC;AACzC,iEAA+C;AAC/C,yDAAuC;AACvC,6DAA2C;AAC3C,+DAA6C;AAC7C,mEAAiD;AACjD,gEAA8C;AAC9C,2DAAyC;AACzC,8DAA4C;AAC5C,sDAAoC;AACpC,mEAAiD;AACjD,+DAA6C;AAC7C,4DAA0C;AAC1C,0DAAwC;AACxC,qDAAmC;AACnC,4DAA0C;AAC1C,yDAAuC;AACvC,wDAAsC;AACtC,yDAAuC;AACvC,oDAAkC;AAClC,uDAAqC;AACrC,+CAA6B"}
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAoBA,kDAAgC;AAChC,kDAAgC;AAChC,mDAAiC;AACjC,+CAA6B;AAC7B,4CAA0B;AAC1B,4CAA0B;AAC1B,wCAAsB;AACtB,6CAA2B;AAC3B,2CAAyB;AACzB,wDAAsC;AACtC,4DAA0C;AAC1C,+DAA6C;AAC7C,2DAAyC;AACzC,gEAA8C;AAC9C,wEAAsD;AACtD,qEAAmD;AACnD,mEAAiD;AACjD,+DAA6C;AAC7C,6DAA2C;AAC3C,kDAAgC;AAChC,+CAA6B;AAC7B,wDAAsC;AACtC,2DAAyC;AACzC,8DAA4C;AAC5C,uDAAqC;AACrC,6DAA2C;AAC3C,0DAAwC;AACxC,oEAAkD;AAClD,0EAAwD;AACxD,0EAAwD;AACxD,uEAAqD;AACrD,wEAAsD;AACtD,4DAA0C;AAC1C,kEAAgD;AAChD,kEAAgD;AAChD,iEAA+C;AAC/C,uEAAqD;AACrD,uEAAqD;AACrD,oEAAkD;AAClD,qEAAmD;AACnD,uEAAqD;AACrD,+DAA6C;AAC7C,gEAA8C;AAC9C,+DAA6C;AAC7C,qEAAmD;AACnD,qEAAmD;AACnD,kEAAgD;AAChD,mEAAiD;AACjD,qEAAmD;AACnD,kEAAgD;AAChD,2DAAyC;AACzC,iEAA+C;AAC/C,2DAAyC;AACzC,8DAA4C;AAC5C,yDAAuC;AACvC,6DAA2C;AAC3C,+DAA6C;AAC7C,mEAAiD;AACjD,gEAA8C;AAC9C,2DAAyC;AACzC,8DAA4C;AAC5C,sDAAoC;AACpC,mEAAiD;AACjD,+DAA6C;AAC7C,4DAA0C;AAC1C,0DAAwC;AACxC,qDAAmC;AACnC,4DAA0C;AAC1C,yDAAuC;AACvC,wDAAsC;AACtC,yDAAuC;AACvC,oDAAkC;AAClC,uDAAqC;AACrC,+CAA6B"}
|
package/package.json
CHANGED
|
@@ -8,7 +8,7 @@
|
|
|
8
8
|
"framework": "npm",
|
|
9
9
|
"application": "package",
|
|
10
10
|
"private": false,
|
|
11
|
-
"version": "1.4.
|
|
11
|
+
"version": "1.4.31",
|
|
12
12
|
"author": "Amir Abolhasani",
|
|
13
13
|
"license": "MIT",
|
|
14
14
|
"main": "./dist/index.js",
|
|
@@ -17,10 +17,10 @@
|
|
|
17
17
|
"build": ""
|
|
18
18
|
},
|
|
19
19
|
"dependencies": {
|
|
20
|
-
"namirasoft-core": "^1.4.
|
|
21
|
-
"namirasoft-site": "^1.4.
|
|
20
|
+
"namirasoft-core": "^1.4.80",
|
|
21
|
+
"namirasoft-site": "^1.4.39",
|
|
22
22
|
"namirasoft-node-cli": "^1.4.7",
|
|
23
|
-
"namirasoft-account": "^1.4.
|
|
23
|
+
"namirasoft-account": "^1.4.85"
|
|
24
24
|
},
|
|
25
25
|
"bin": {
|
|
26
26
|
"ns-log": "./dist/command/cli.js"
|
package/src/BaseFormatter.ts
CHANGED
|
@@ -1,37 +1,37 @@
|
|
|
1
|
-
export abstract class BaseFormatter
|
|
2
|
-
{
|
|
3
|
-
protected formatDateTime(date: Date)
|
|
4
|
-
{
|
|
5
|
-
return this.formatDate(date) + " " + this.formatTime(date);
|
|
6
|
-
}
|
|
7
|
-
protected formatDate(date: Date)
|
|
8
|
-
{
|
|
9
|
-
const year = date.
|
|
10
|
-
const month = (date.
|
|
11
|
-
const day = String(date.
|
|
12
|
-
return `${year}-${month}-${day}`;
|
|
13
|
-
}
|
|
14
|
-
protected formatTime(date: Date)
|
|
15
|
-
{
|
|
16
|
-
const hours = String(date.
|
|
17
|
-
const minutes = String(date.
|
|
18
|
-
const seconds = String(date.
|
|
19
|
-
return `${hours}:${minutes}:${seconds}`;
|
|
20
|
-
}
|
|
21
|
-
protected qoute(text: string, size: number, filler: string)
|
|
22
|
-
{
|
|
23
|
-
let count = (size - text.length) / 2;
|
|
24
|
-
text = text.padStart(text.length + count, filler);
|
|
25
|
-
text = text.padEnd(size, filler);
|
|
26
|
-
return text;
|
|
27
|
-
}
|
|
28
|
-
protected getMesssages(messages: any[]): string[]
|
|
29
|
-
{
|
|
30
|
-
return messages.map(x =>
|
|
31
|
-
{
|
|
32
|
-
if (typeof (x) == "object")
|
|
33
|
-
return JSON.stringify(x, undefined, 4);
|
|
34
|
-
return x + "";
|
|
35
|
-
});
|
|
36
|
-
}
|
|
1
|
+
export abstract class BaseFormatter
|
|
2
|
+
{
|
|
3
|
+
protected formatDateTime(date: Date)
|
|
4
|
+
{
|
|
5
|
+
return this.formatDate(date) + " " + this.formatTime(date) + " UTC";
|
|
6
|
+
}
|
|
7
|
+
protected formatDate(date: Date)
|
|
8
|
+
{
|
|
9
|
+
const year = date.getUTCFullYear();
|
|
10
|
+
const month = (date.getUTCMonth() + 1).toString().padStart(2, '0');
|
|
11
|
+
const day = String(date.getUTCDate()).toString().padStart(2, '0');
|
|
12
|
+
return `${year}-${month}-${day}`;
|
|
13
|
+
}
|
|
14
|
+
protected formatTime(date: Date)
|
|
15
|
+
{
|
|
16
|
+
const hours = String(date.getUTCHours()).padStart(2, '0');
|
|
17
|
+
const minutes = String(date.getUTCMinutes()).padStart(2, '0');
|
|
18
|
+
const seconds = String(date.getUTCSeconds()).padStart(2, '0');
|
|
19
|
+
return `${hours}:${minutes}:${seconds}`;
|
|
20
|
+
}
|
|
21
|
+
protected qoute(text: string, size: number, filler: string)
|
|
22
|
+
{
|
|
23
|
+
let count = (size - text.length) / 2;
|
|
24
|
+
text = text.padStart(text.length + count, filler);
|
|
25
|
+
text = text.padEnd(size, filler);
|
|
26
|
+
return text;
|
|
27
|
+
}
|
|
28
|
+
protected getMesssages(messages: any[]): string[]
|
|
29
|
+
{
|
|
30
|
+
return messages.map(x =>
|
|
31
|
+
{
|
|
32
|
+
if (typeof (x) == "object")
|
|
33
|
+
return JSON.stringify(x, undefined, 4);
|
|
34
|
+
return x + "";
|
|
35
|
+
});
|
|
36
|
+
}
|
|
37
37
|
}
|
package/src/FormatterFull.ts
CHANGED
|
@@ -1,20 +1,20 @@
|
|
|
1
|
-
import { BaseFormatter } from "./BaseFormatter";
|
|
2
|
-
import { IFormatter } from "./IFormatter";
|
|
3
|
-
import { Log } from "./Log";
|
|
4
|
-
import { LogLevel } from "./LogLevel";
|
|
5
|
-
|
|
6
|
-
export class FormatterFull extends BaseFormatter implements IFormatter
|
|
7
|
-
{
|
|
8
|
-
format(log: Log): { pre: string[], messages: string[], post: string[] }
|
|
9
|
-
{
|
|
10
|
-
let pre: string[] = [];
|
|
11
|
-
let messages: string[] = [];
|
|
12
|
-
let post: string[] = [];
|
|
13
|
-
pre.push(this.qoute(this.formatDateTime(log.date), 100, '-'));
|
|
14
|
-
pre.push("Level: " + LogLevel[log.level]);
|
|
15
|
-
messages.push(...this.getMesssages(log.messages));
|
|
16
|
-
post.push(this.qoute("", 100, '-'));
|
|
17
|
-
post.push("");
|
|
18
|
-
return { pre, messages, post };
|
|
19
|
-
}
|
|
1
|
+
import { BaseFormatter } from "./BaseFormatter";
|
|
2
|
+
import { IFormatter } from "./IFormatter";
|
|
3
|
+
import { Log } from "./Log";
|
|
4
|
+
import { LogLevel } from "./LogLevel";
|
|
5
|
+
|
|
6
|
+
export class FormatterFull extends BaseFormatter implements IFormatter
|
|
7
|
+
{
|
|
8
|
+
format(log: Log): { pre: string[], messages: string[], post: string[] }
|
|
9
|
+
{
|
|
10
|
+
let pre: string[] = [];
|
|
11
|
+
let messages: string[] = [];
|
|
12
|
+
let post: string[] = [];
|
|
13
|
+
pre.push(this.qoute(this.formatDateTime(log.date), 100, '-'));
|
|
14
|
+
pre.push("Level: " + LogLevel[log.level]);
|
|
15
|
+
messages.push(...this.getMesssages(log.messages));
|
|
16
|
+
post.push(this.qoute("", 100, '-'));
|
|
17
|
+
post.push("");
|
|
18
|
+
return { pre, messages, post };
|
|
19
|
+
}
|
|
20
20
|
}
|
package/src/FormatterShort.ts
CHANGED
|
@@ -1,13 +1,13 @@
|
|
|
1
|
-
import { BaseFormatter } from "./BaseFormatter";
|
|
2
|
-
import { IFormatter } from "./IFormatter";
|
|
3
|
-
import { Log } from "./Log";
|
|
4
|
-
|
|
5
|
-
export class FormatterShort extends BaseFormatter implements IFormatter
|
|
6
|
-
{
|
|
7
|
-
format(log: Log): { pre: string[], messages: string[], post: string[] }
|
|
8
|
-
{
|
|
9
|
-
let ans: string[] = [];
|
|
10
|
-
ans.push(this.formatDateTime(log.date) + ": " + this.getMesssages(log.messages).filter(m => m).join(" - "));
|
|
11
|
-
return { pre: [], messages: ans, post: [] };
|
|
12
|
-
}
|
|
1
|
+
import { BaseFormatter } from "./BaseFormatter";
|
|
2
|
+
import { IFormatter } from "./IFormatter";
|
|
3
|
+
import { Log } from "./Log";
|
|
4
|
+
|
|
5
|
+
export class FormatterShort extends BaseFormatter implements IFormatter
|
|
6
|
+
{
|
|
7
|
+
format(log: Log): { pre: string[], messages: string[], post: string[] }
|
|
8
|
+
{
|
|
9
|
+
let ans: string[] = [];
|
|
10
|
+
ans.push(this.formatDateTime(log.date) + ": " + this.getMesssages(log.messages).filter(m => m).join(" - "));
|
|
11
|
+
return { pre: [], messages: ans, post: [] };
|
|
12
|
+
}
|
|
13
13
|
}
|
package/src/IFormatter.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { Log } from "./Log";
|
|
2
|
-
|
|
3
|
-
export interface IFormatter
|
|
4
|
-
{
|
|
5
|
-
format(log: Log): { pre: string[], messages: string[], post: string[] };
|
|
1
|
+
import { Log } from "./Log";
|
|
2
|
+
|
|
3
|
+
export interface IFormatter
|
|
4
|
+
{
|
|
5
|
+
format(log: Log): { pre: string[], messages: string[], post: string[] };
|
|
6
6
|
}
|
package/src/ILogger.ts
CHANGED
|
@@ -1,18 +1,18 @@
|
|
|
1
|
-
import { LogLevel } from "./LogLevel";
|
|
2
|
-
|
|
3
|
-
export interface ILogger
|
|
4
|
-
{
|
|
5
|
-
log(level: LogLevel, ...messages: any[]): void;
|
|
6
|
-
trace(...messages: any[]): void;
|
|
7
|
-
verbose(...messages: any[]): void;
|
|
8
|
-
debug(...messages: any[]): void;
|
|
9
|
-
info(...messages: any[]): void;
|
|
10
|
-
success(...messages: any[]): void;
|
|
11
|
-
warning(...messages: any[]): void;
|
|
12
|
-
error(...messages: any[]): void;
|
|
13
|
-
critical(...messages: any[]): void;
|
|
14
|
-
fatal(...messages: any[]): void;
|
|
15
|
-
onCatchError(error: Error | unknown): void;
|
|
16
|
-
onCatchCritical(error: Error | unknown): void;
|
|
17
|
-
onCatchFatal(error: Error | unknown): void;
|
|
1
|
+
import { LogLevel } from "./LogLevel";
|
|
2
|
+
|
|
3
|
+
export interface ILogger
|
|
4
|
+
{
|
|
5
|
+
log(level: LogLevel, ...messages: any[]): void;
|
|
6
|
+
trace(...messages: any[]): void;
|
|
7
|
+
verbose(...messages: any[]): void;
|
|
8
|
+
debug(...messages: any[]): void;
|
|
9
|
+
info(...messages: any[]): void;
|
|
10
|
+
success(...messages: any[]): void;
|
|
11
|
+
warning(...messages: any[]): void;
|
|
12
|
+
error(...messages: any[]): void;
|
|
13
|
+
critical(...messages: any[]): void;
|
|
14
|
+
fatal(...messages: any[]): void;
|
|
15
|
+
onCatchError(error: Error | unknown): void;
|
|
16
|
+
onCatchCritical(error: Error | unknown): void;
|
|
17
|
+
onCatchFatal(error: Error | unknown): void;
|
|
18
18
|
}
|