@spinajs/log 2.0.180 → 2.0.181
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/cjs/bootstrap.d.ts +4 -4
- package/lib/cjs/bootstrap.js +55 -55
- package/lib/cjs/bootstrap.js.map +1 -1
- package/lib/cjs/index.d.ts +4 -4
- package/lib/cjs/index.js +20 -20
- package/lib/cjs/log.d.ts +29 -29
- package/lib/cjs/log.js +161 -161
- package/lib/cjs/log.js.map +1 -1
- package/lib/cjs/schemas/log.configuration.d.ts +87 -87
- package/lib/cjs/schemas/log.configuration.js +100 -100
- package/lib/cjs/targets/BlackHoleTarget.d.ts +7 -7
- package/lib/cjs/targets/BlackHoleTarget.js +24 -24
- package/lib/cjs/targets/BlackHoleTarget.js.map +1 -1
- package/lib/cjs/targets/ColoredConsoleTarget.d.ts +50 -50
- package/lib/cjs/targets/ColoredConsoleTarget.js +70 -70
- package/lib/cjs/targets/ColoredConsoleTarget.js.map +1 -1
- package/lib/cjs/targets/FileTarget.d.ts +29 -29
- package/lib/cjs/targets/FileTarget.js +263 -263
- package/lib/cjs/targets/FileTarget.js.map +1 -1
- package/lib/cjs/targets/index.d.ts +3 -3
- package/lib/cjs/targets/index.js +19 -19
- package/lib/mjs/bootstrap.d.ts +4 -4
- package/lib/mjs/bootstrap.js +49 -49
- package/lib/mjs/bootstrap.js.map +1 -1
- package/lib/mjs/index.d.ts +4 -4
- package/lib/mjs/index.js +4 -4
- package/lib/mjs/log.d.ts +29 -29
- package/lib/mjs/log.js +155 -155
- package/lib/mjs/log.js.map +1 -1
- package/lib/mjs/schemas/log.configuration.d.ts +87 -87
- package/lib/mjs/schemas/log.configuration.js +98 -98
- package/lib/mjs/targets/BlackHoleTarget.d.ts +7 -7
- package/lib/mjs/targets/BlackHoleTarget.js +21 -21
- package/lib/mjs/targets/BlackHoleTarget.js.map +1 -1
- package/lib/mjs/targets/ColoredConsoleTarget.d.ts +50 -50
- package/lib/mjs/targets/ColoredConsoleTarget.js +64 -64
- package/lib/mjs/targets/ColoredConsoleTarget.js.map +1 -1
- package/lib/mjs/targets/FileTarget.d.ts +29 -29
- package/lib/mjs/targets/FileTarget.js +234 -234
- package/lib/mjs/targets/FileTarget.js.map +1 -1
- package/lib/mjs/targets/index.d.ts +3 -3
- package/lib/mjs/targets/index.js +3 -3
- package/lib/tsconfig.cjs.tsbuildinfo +1 -1
- package/lib/tsconfig.mjs.tsbuildinfo +1 -1
- package/package.json +6 -6
package/lib/cjs/bootstrap.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { Bootstrapper } from "@spinajs/di";
|
|
2
|
-
export declare class LogBotstrapper extends Bootstrapper {
|
|
3
|
-
bootstrap(): void;
|
|
4
|
-
}
|
|
1
|
+
import { Bootstrapper } from "@spinajs/di";
|
|
2
|
+
export declare class LogBotstrapper extends Bootstrapper {
|
|
3
|
+
bootstrap(): void;
|
|
4
|
+
}
|
|
5
5
|
//# sourceMappingURL=bootstrap.d.ts.map
|
package/lib/cjs/bootstrap.js
CHANGED
|
@@ -1,56 +1,56 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
|
|
3
|
-
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
4
|
-
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
|
|
5
|
-
else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
|
|
6
|
-
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
7
|
-
};
|
|
8
|
-
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
9
|
-
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
10
|
-
};
|
|
11
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
12
|
-
exports.LogBotstrapper = void 0;
|
|
13
|
-
const configuration_1 = require("@spinajs/configuration");
|
|
14
|
-
const di_1 = require("@spinajs/di");
|
|
15
|
-
const log_common_1 = require("@spinajs/log-common");
|
|
16
|
-
const log_configuration_js_1 = __importDefault(require("./schemas/log.configuration.js"));
|
|
17
|
-
let LogBotstrapper = class LogBotstrapper extends di_1.Bootstrapper {
|
|
18
|
-
bootstrap() {
|
|
19
|
-
di_1.DI.register(log_configuration_js_1.default).asValue("__configurationSchema__");
|
|
20
|
-
// check if we run tests,
|
|
21
|
-
// hook for uncaughtException causes to not showing
|
|
22
|
-
// mocha errors in console
|
|
23
|
-
if (!process.env.TESTING) {
|
|
24
|
-
process.on("uncaughtException", (err) => {
|
|
25
|
-
// if we have configuration resolved, we can assume that logger can read configuration
|
|
26
|
-
// so log to default log
|
|
27
|
-
// if not log to console
|
|
28
|
-
if (di_1.DI.has(configuration_1.Configuration)) {
|
|
29
|
-
const log = di_1.DI.resolve(log_common_1.Log, ["process"]);
|
|
30
|
-
log.fatal(err, "Unhandled exception occured");
|
|
31
|
-
}
|
|
32
|
-
else {
|
|
33
|
-
console.error("Unhandled exception occured, reason:" + JSON.stringify(err));
|
|
34
|
-
}
|
|
35
|
-
});
|
|
36
|
-
process.on("unhandledRejection", (reason, p) => {
|
|
37
|
-
// if we have configuration resolved, we can assume that logger can read configuration
|
|
38
|
-
// so log to default log
|
|
39
|
-
// if not log to console
|
|
40
|
-
if (di_1.DI.has(configuration_1.Configuration)) {
|
|
41
|
-
const log = di_1.DI.resolve(log_common_1.Log, ["process"]);
|
|
42
|
-
log.fatal(reason, "Unhandled rejection at Promise %s", p);
|
|
43
|
-
}
|
|
44
|
-
else {
|
|
45
|
-
console.error("Unhandled rejection at Promise %s, reason: " +
|
|
46
|
-
JSON.stringify(reason));
|
|
47
|
-
}
|
|
48
|
-
});
|
|
49
|
-
}
|
|
50
|
-
}
|
|
51
|
-
};
|
|
52
|
-
LogBotstrapper =
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
1
|
+
"use strict";
|
|
2
|
+
var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
|
|
3
|
+
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
4
|
+
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
|
|
5
|
+
else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
|
|
6
|
+
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
7
|
+
};
|
|
8
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
9
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
10
|
+
};
|
|
11
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
12
|
+
exports.LogBotstrapper = void 0;
|
|
13
|
+
const configuration_1 = require("@spinajs/configuration");
|
|
14
|
+
const di_1 = require("@spinajs/di");
|
|
15
|
+
const log_common_1 = require("@spinajs/log-common");
|
|
16
|
+
const log_configuration_js_1 = __importDefault(require("./schemas/log.configuration.js"));
|
|
17
|
+
let LogBotstrapper = class LogBotstrapper extends di_1.Bootstrapper {
|
|
18
|
+
bootstrap() {
|
|
19
|
+
di_1.DI.register(log_configuration_js_1.default).asValue("__configurationSchema__");
|
|
20
|
+
// check if we run tests,
|
|
21
|
+
// hook for uncaughtException causes to not showing
|
|
22
|
+
// mocha errors in console
|
|
23
|
+
if (!process.env.TESTING) {
|
|
24
|
+
process.on("uncaughtException", (err) => {
|
|
25
|
+
// if we have configuration resolved, we can assume that logger can read configuration
|
|
26
|
+
// so log to default log
|
|
27
|
+
// if not log to console
|
|
28
|
+
if (di_1.DI.has(configuration_1.Configuration)) {
|
|
29
|
+
const log = di_1.DI.resolve(log_common_1.Log, ["process"]);
|
|
30
|
+
log.fatal(err, "Unhandled exception occured");
|
|
31
|
+
}
|
|
32
|
+
else {
|
|
33
|
+
console.error("Unhandled exception occured, reason:" + JSON.stringify(err));
|
|
34
|
+
}
|
|
35
|
+
});
|
|
36
|
+
process.on("unhandledRejection", (reason, p) => {
|
|
37
|
+
// if we have configuration resolved, we can assume that logger can read configuration
|
|
38
|
+
// so log to default log
|
|
39
|
+
// if not log to console
|
|
40
|
+
if (di_1.DI.has(configuration_1.Configuration)) {
|
|
41
|
+
const log = di_1.DI.resolve(log_common_1.Log, ["process"]);
|
|
42
|
+
log.fatal(reason, "Unhandled rejection at Promise %s", p);
|
|
43
|
+
}
|
|
44
|
+
else {
|
|
45
|
+
console.error("Unhandled rejection at Promise %s, reason: " +
|
|
46
|
+
JSON.stringify(reason));
|
|
47
|
+
}
|
|
48
|
+
});
|
|
49
|
+
}
|
|
50
|
+
}
|
|
51
|
+
};
|
|
52
|
+
exports.LogBotstrapper = LogBotstrapper;
|
|
53
|
+
exports.LogBotstrapper = LogBotstrapper = __decorate([
|
|
54
|
+
(0, di_1.Injectable)(di_1.Bootstrapper)
|
|
55
|
+
], LogBotstrapper);
|
|
56
56
|
//# sourceMappingURL=bootstrap.js.map
|
package/lib/cjs/bootstrap.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"bootstrap.js","sourceRoot":"","sources":["../../src/bootstrap.ts"],"names":[],"mappings":";;;;;;;;;;;;AAAA,0DAAuD;AACvD,oCAA2D;AAC3D,oDAA0C;AAC1C,0FAAkE;AAG3D,IAAM,cAAc,GAApB,MAAM,cAAe,SAAQ,iBAAY;IACvC,SAAS;QACd,OAAE,CAAC,QAAQ,CAAC,8BAAoB,CAAC,CAAC,OAAO,CAAC,yBAAyB,CAAC,CAAC;QAErE,yBAAyB;QACzB,mDAAmD;QACnD,0BAA0B;QAC1B,IAAI,CAAC,OAAO,CAAC,GAAG,CAAC,OAAO,EAAE;YACxB,OAAO,CAAC,EAAE,CAAC,mBAAmB,EAAE,CAAC,GAAG,EAAE,EAAE;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lib/cjs/index.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
export * from "@spinajs/log-common";
|
|
2
|
-
export * from "./targets/index.js";
|
|
3
|
-
export * from "./log.js";
|
|
4
|
-
export * from "./bootstrap.js";
|
|
1
|
+
export * from "@spinajs/log-common";
|
|
2
|
+
export * from "./targets/index.js";
|
|
3
|
+
export * from "./log.js";
|
|
4
|
+
export * from "./bootstrap.js";
|
|
5
5
|
//# sourceMappingURL=index.d.ts.map
|
package/lib/cjs/index.js
CHANGED
|
@@ -1,21 +1,21 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
-
if (k2 === undefined) k2 = k;
|
|
4
|
-
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
-
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
-
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
-
}
|
|
8
|
-
Object.defineProperty(o, k2, desc);
|
|
9
|
-
}) : (function(o, m, k, k2) {
|
|
10
|
-
if (k2 === undefined) k2 = k;
|
|
11
|
-
o[k2] = m[k];
|
|
12
|
-
}));
|
|
13
|
-
var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
14
|
-
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
15
|
-
};
|
|
16
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
17
|
-
__exportStar(require("@spinajs/log-common"), exports);
|
|
18
|
-
__exportStar(require("./targets/index.js"), exports);
|
|
19
|
-
__exportStar(require("./log.js"), exports);
|
|
20
|
-
__exportStar(require("./bootstrap.js"), exports);
|
|
1
|
+
"use strict";
|
|
2
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
+
if (k2 === undefined) k2 = k;
|
|
4
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
+
}
|
|
8
|
+
Object.defineProperty(o, k2, desc);
|
|
9
|
+
}) : (function(o, m, k, k2) {
|
|
10
|
+
if (k2 === undefined) k2 = k;
|
|
11
|
+
o[k2] = m[k];
|
|
12
|
+
}));
|
|
13
|
+
var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
14
|
+
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
15
|
+
};
|
|
16
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
17
|
+
__exportStar(require("@spinajs/log-common"), exports);
|
|
18
|
+
__exportStar(require("./targets/index.js"), exports);
|
|
19
|
+
__exportStar(require("./log.js"), exports);
|
|
20
|
+
__exportStar(require("./bootstrap.js"), exports);
|
|
21
21
|
//# sourceMappingURL=index.js.map
|
package/lib/cjs/log.d.ts
CHANGED
|
@@ -1,30 +1,30 @@
|
|
|
1
|
-
import { ILogEntry, Log } from "@spinajs/log-common";
|
|
2
|
-
/**
|
|
3
|
-
* Default log implementation interface. Taken from bunyan. Feel free to implement own.
|
|
4
|
-
*/
|
|
5
|
-
export declare class FrameworkLogger extends Log {
|
|
6
|
-
Name: string;
|
|
7
|
-
protected Parent?: Log;
|
|
8
|
-
constructor(Name: string, variables?: Record<string, unknown>, Parent?: Log);
|
|
9
|
-
resolve(): void;
|
|
10
|
-
trace(message: string, ...args: any[]): void;
|
|
11
|
-
trace(err: Error, message: string, ...args: any[]): void;
|
|
12
|
-
debug(message: string, ...args: any[]): void;
|
|
13
|
-
debug(err: Error, message: string, ...args: any[]): void;
|
|
14
|
-
info(message: string, ...args: any[]): void;
|
|
15
|
-
info(err: Error, message: string, ...args: any[]): void;
|
|
16
|
-
warn(message: string, ...args: any[]): void;
|
|
17
|
-
warn(err: Error, message: string, ...args: any[]): void;
|
|
18
|
-
error(message: string, ...args: any[]): void;
|
|
19
|
-
error(err: Error, message: string, ...args: any[]): void;
|
|
20
|
-
fatal(message: string, ...args: any[]): void;
|
|
21
|
-
fatal(err: Error, message: string, ...args: any[]): void;
|
|
22
|
-
security(message: string, ...args: any[]): void;
|
|
23
|
-
security(err: Error, message: string, ...args: any[]): void;
|
|
24
|
-
success(message: string, ...args: any[]): void;
|
|
25
|
-
success(err: Error, message: string, ...args: any[]): void;
|
|
26
|
-
write(entry: ILogEntry): Promise<PromiseSettledResult<void>[]>;
|
|
27
|
-
protected resolveLogTargets(): void;
|
|
28
|
-
protected matchRulesToLogger(): void;
|
|
29
|
-
}
|
|
1
|
+
import { ILogEntry, Log } from "@spinajs/log-common";
|
|
2
|
+
/**
|
|
3
|
+
* Default log implementation interface. Taken from bunyan. Feel free to implement own.
|
|
4
|
+
*/
|
|
5
|
+
export declare class FrameworkLogger extends Log {
|
|
6
|
+
Name: string;
|
|
7
|
+
protected Parent?: Log;
|
|
8
|
+
constructor(Name: string, variables?: Record<string, unknown>, Parent?: Log);
|
|
9
|
+
resolve(): void;
|
|
10
|
+
trace(message: string, ...args: any[]): void;
|
|
11
|
+
trace(err: Error, message: string, ...args: any[]): void;
|
|
12
|
+
debug(message: string, ...args: any[]): void;
|
|
13
|
+
debug(err: Error, message: string, ...args: any[]): void;
|
|
14
|
+
info(message: string, ...args: any[]): void;
|
|
15
|
+
info(err: Error, message: string, ...args: any[]): void;
|
|
16
|
+
warn(message: string, ...args: any[]): void;
|
|
17
|
+
warn(err: Error, message: string, ...args: any[]): void;
|
|
18
|
+
error(message: string, ...args: any[]): void;
|
|
19
|
+
error(err: Error, message: string, ...args: any[]): void;
|
|
20
|
+
fatal(message: string, ...args: any[]): void;
|
|
21
|
+
fatal(err: Error, message: string, ...args: any[]): void;
|
|
22
|
+
security(message: string, ...args: any[]): void;
|
|
23
|
+
security(err: Error, message: string, ...args: any[]): void;
|
|
24
|
+
success(message: string, ...args: any[]): void;
|
|
25
|
+
success(err: Error, message: string, ...args: any[]): void;
|
|
26
|
+
write(entry: ILogEntry): Promise<PromiseSettledResult<void>[]>;
|
|
27
|
+
protected resolveLogTargets(): void;
|
|
28
|
+
protected matchRulesToLogger(): void;
|
|
29
|
+
}
|
|
30
30
|
//# sourceMappingURL=log.d.ts.map
|
package/lib/cjs/log.js
CHANGED
|
@@ -1,162 +1,162 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
|
|
3
|
-
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
4
|
-
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
|
|
5
|
-
else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
|
|
6
|
-
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
7
|
-
};
|
|
8
|
-
var __metadata = (this && this.__metadata) || function (k, v) {
|
|
9
|
-
if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
|
|
10
|
-
};
|
|
11
|
-
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
12
|
-
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
13
|
-
};
|
|
14
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
15
|
-
exports.FrameworkLogger = void 0;
|
|
16
|
-
/* eslint-disable @typescript-eslint/no-unsafe-assignment */
|
|
17
|
-
/* eslint-disable @typescript-eslint/no-unsafe-call */
|
|
18
|
-
/* eslint-disable @typescript-eslint/no-unsafe-argument */
|
|
19
|
-
const configuration_1 = require("@spinajs/configuration");
|
|
20
|
-
const di_1 = require("@spinajs/di");
|
|
21
|
-
const log_common_1 = require("@spinajs/log-common");
|
|
22
|
-
const glob_to_regexp_1 = __importDefault(require("glob-to-regexp"));
|
|
23
|
-
const exceptions_1 = require("@spinajs/exceptions");
|
|
24
|
-
const internal_logger_1 = require("@spinajs/internal-logger");
|
|
25
|
-
function wrapWrite(level) {
|
|
26
|
-
return (err, message, ...args) => {
|
|
27
|
-
if (err instanceof Error) {
|
|
28
|
-
return this.write((0, log_common_1.createLogMessageObject)(err, message, level, this.Name, this.Variables, ...args));
|
|
29
|
-
}
|
|
30
|
-
else {
|
|
31
|
-
if (message) {
|
|
32
|
-
return this.write((0, log_common_1.createLogMessageObject)(err, null, level, this.Name, this.Variables, ...[message, ...args]));
|
|
33
|
-
}
|
|
34
|
-
else {
|
|
35
|
-
return this.write((0, log_common_1.createLogMessageObject)(err, null, level, this.Name, this.Variables, ...args));
|
|
36
|
-
}
|
|
37
|
-
}
|
|
38
|
-
};
|
|
39
|
-
}
|
|
40
|
-
/**
|
|
41
|
-
* Default log implementation interface. Taken from bunyan. Feel free to implement own.
|
|
42
|
-
*/
|
|
43
|
-
let FrameworkLogger = class FrameworkLogger extends log_common_1.Log {
|
|
44
|
-
constructor(Name, variables, Parent) {
|
|
45
|
-
super();
|
|
46
|
-
this.Name = Name;
|
|
47
|
-
this.Parent = Parent;
|
|
48
|
-
this.Variables = variables ?? {};
|
|
49
|
-
}
|
|
50
|
-
resolve() {
|
|
51
|
-
const config = this.Container.get(configuration_1.Configuration);
|
|
52
|
-
if (!config) {
|
|
53
|
-
throw new Error(`Configuration module is not avaible. Please resolve configuration module before any logging can occur`);
|
|
54
|
-
}
|
|
55
|
-
this.Options = config.get("logger", {
|
|
56
|
-
targets: [
|
|
57
|
-
{
|
|
58
|
-
name: "Console",
|
|
59
|
-
type: "ConsoleTarget",
|
|
60
|
-
},
|
|
61
|
-
],
|
|
62
|
-
rules: [{ name: "*", level: "trace", target: "Console" }],
|
|
63
|
-
});
|
|
64
|
-
this.matchRulesToLogger();
|
|
65
|
-
this.resolveLogTargets();
|
|
66
|
-
super.resolve();
|
|
67
|
-
log_common_1.Log.Loggers.set(this.Name, this);
|
|
68
|
-
}
|
|
69
|
-
trace(err, message, ...args) {
|
|
70
|
-
wrapWrite.apply(this, [log_common_1.LogLevel.Trace])(err, message, ...args);
|
|
71
|
-
}
|
|
72
|
-
debug(err, message, ...args) {
|
|
73
|
-
wrapWrite.apply(this, [log_common_1.LogLevel.Debug])(err, message, ...args);
|
|
74
|
-
}
|
|
75
|
-
info(err, message, ...args) {
|
|
76
|
-
wrapWrite.apply(this, [log_common_1.LogLevel.Info])(err, message, ...args);
|
|
77
|
-
}
|
|
78
|
-
warn(err, message, ...args) {
|
|
79
|
-
wrapWrite.apply(this, [log_common_1.LogLevel.Warn])(err, message, ...args);
|
|
80
|
-
}
|
|
81
|
-
error(err, message, ...args) {
|
|
82
|
-
wrapWrite.apply(this, [log_common_1.LogLevel.Error])(err, message, ...args);
|
|
83
|
-
}
|
|
84
|
-
fatal(err, message, ...args) {
|
|
85
|
-
wrapWrite.apply(this, [log_common_1.LogLevel.Fatal])(err, message, ...args);
|
|
86
|
-
}
|
|
87
|
-
security(err, message, ...args) {
|
|
88
|
-
wrapWrite.apply(this, [log_common_1.LogLevel.Security])(err, message, ...args);
|
|
89
|
-
}
|
|
90
|
-
success(err, message, ...args) {
|
|
91
|
-
wrapWrite.apply(this, [log_common_1.LogLevel.Success])(err, message, ...args);
|
|
92
|
-
}
|
|
93
|
-
write(entry) {
|
|
94
|
-
if (entry.Variables.logger === this.Name) {
|
|
95
|
-
return Promise.allSettled(this.Targets.filter((t) => entry.Level >= log_common_1.StrToLogLevel[t.rule.level]).map((t) => {
|
|
96
|
-
if (!t.instance) {
|
|
97
|
-
throw new exceptions_1.InvalidOperation(`Target for rule ${t.rule.name} not exists`);
|
|
98
|
-
}
|
|
99
|
-
return t.instance.write(entry);
|
|
100
|
-
}));
|
|
101
|
-
}
|
|
102
|
-
}
|
|
103
|
-
resolveLogTargets() {
|
|
104
|
-
this.Targets = this.Rules.map((r) => {
|
|
105
|
-
const found = this.Options.targets.filter((t) => {
|
|
106
|
-
return Array.isArray(r.target)
|
|
107
|
-
? r.target.includes(t.name)
|
|
108
|
-
: r.target === t.name;
|
|
109
|
-
});
|
|
110
|
-
if (!found) {
|
|
111
|
-
throw new exceptions_1.InvalidOption(`No target matching rule ${r.name}`);
|
|
112
|
-
}
|
|
113
|
-
return found.map((f) => {
|
|
114
|
-
return {
|
|
115
|
-
instance: di_1.DI.resolve(f.type, [f]),
|
|
116
|
-
options: f,
|
|
117
|
-
rule: r,
|
|
118
|
-
};
|
|
119
|
-
});
|
|
120
|
-
}).reduce((prev, curr) => prev.concat(...curr), []);
|
|
121
|
-
}
|
|
122
|
-
matchRulesToLogger() {
|
|
123
|
-
this.Rules = this.Options.rules.filter((r) => {
|
|
124
|
-
const g = (0, glob_to_regexp_1.default)(r.name);
|
|
125
|
-
// BUG: g.test throws vscode err ?
|
|
126
|
-
return g.test(this.Name);
|
|
127
|
-
});
|
|
128
|
-
}
|
|
129
|
-
};
|
|
130
|
-
FrameworkLogger =
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
const logFactoryFunction = (container, logName) => {
|
|
136
|
-
if (log_common_1.Log.Loggers.has(logName)) {
|
|
137
|
-
return log_common_1.Log.Loggers.get(logName);
|
|
138
|
-
}
|
|
139
|
-
if (!di_1.DI.has(configuration_1.Configuration)) {
|
|
140
|
-
if (log_common_1.Log.InternalLoggers.has(logName)) {
|
|
141
|
-
return log_common_1.Log.InternalLoggers.get(logName);
|
|
142
|
-
}
|
|
143
|
-
const internalLogger = container.resolve(internal_logger_1.InternalLoggerProxy, [logName]);
|
|
144
|
-
log_common_1.Log.InternalLoggers.set(logName, this);
|
|
145
|
-
return internalLogger;
|
|
146
|
-
}
|
|
147
|
-
return container.resolve("__logImplementation__", [logName]);
|
|
148
|
-
};
|
|
149
|
-
// register as string identifier to allow for
|
|
150
|
-
// resolving logs without referencing class
|
|
151
|
-
// to avoid circular dependencies in some @spinajs packages
|
|
152
|
-
// it should not be used in production code
|
|
153
|
-
di_1.DI.register(logFactoryFunction).as("__log__");
|
|
154
|
-
// register log factory function as Log class
|
|
155
|
-
// this way we can create or return already created
|
|
156
|
-
// log objects
|
|
157
|
-
di_1.DI.register(logFactoryFunction).as(log_common_1.Log);
|
|
158
|
-
// register Log class as string literal
|
|
159
|
-
// so we can resolve Log class
|
|
160
|
-
// it should not be used in production code
|
|
161
|
-
di_1.DI.register(FrameworkLogger).as("__logImplementation__");
|
|
1
|
+
"use strict";
|
|
2
|
+
var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
|
|
3
|
+
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
4
|
+
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
|
|
5
|
+
else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
|
|
6
|
+
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
7
|
+
};
|
|
8
|
+
var __metadata = (this && this.__metadata) || function (k, v) {
|
|
9
|
+
if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
|
|
10
|
+
};
|
|
11
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
12
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
13
|
+
};
|
|
14
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
15
|
+
exports.FrameworkLogger = void 0;
|
|
16
|
+
/* eslint-disable @typescript-eslint/no-unsafe-assignment */
|
|
17
|
+
/* eslint-disable @typescript-eslint/no-unsafe-call */
|
|
18
|
+
/* eslint-disable @typescript-eslint/no-unsafe-argument */
|
|
19
|
+
const configuration_1 = require("@spinajs/configuration");
|
|
20
|
+
const di_1 = require("@spinajs/di");
|
|
21
|
+
const log_common_1 = require("@spinajs/log-common");
|
|
22
|
+
const glob_to_regexp_1 = __importDefault(require("glob-to-regexp"));
|
|
23
|
+
const exceptions_1 = require("@spinajs/exceptions");
|
|
24
|
+
const internal_logger_1 = require("@spinajs/internal-logger");
|
|
25
|
+
function wrapWrite(level) {
|
|
26
|
+
return (err, message, ...args) => {
|
|
27
|
+
if (err instanceof Error) {
|
|
28
|
+
return this.write((0, log_common_1.createLogMessageObject)(err, message, level, this.Name, this.Variables, ...args));
|
|
29
|
+
}
|
|
30
|
+
else {
|
|
31
|
+
if (message) {
|
|
32
|
+
return this.write((0, log_common_1.createLogMessageObject)(err, null, level, this.Name, this.Variables, ...[message, ...args]));
|
|
33
|
+
}
|
|
34
|
+
else {
|
|
35
|
+
return this.write((0, log_common_1.createLogMessageObject)(err, null, level, this.Name, this.Variables, ...args));
|
|
36
|
+
}
|
|
37
|
+
}
|
|
38
|
+
};
|
|
39
|
+
}
|
|
40
|
+
/**
|
|
41
|
+
* Default log implementation interface. Taken from bunyan. Feel free to implement own.
|
|
42
|
+
*/
|
|
43
|
+
let FrameworkLogger = class FrameworkLogger extends log_common_1.Log {
|
|
44
|
+
constructor(Name, variables, Parent) {
|
|
45
|
+
super();
|
|
46
|
+
this.Name = Name;
|
|
47
|
+
this.Parent = Parent;
|
|
48
|
+
this.Variables = variables ?? {};
|
|
49
|
+
}
|
|
50
|
+
resolve() {
|
|
51
|
+
const config = this.Container.get(configuration_1.Configuration);
|
|
52
|
+
if (!config) {
|
|
53
|
+
throw new Error(`Configuration module is not avaible. Please resolve configuration module before any logging can occur`);
|
|
54
|
+
}
|
|
55
|
+
this.Options = config.get("logger", {
|
|
56
|
+
targets: [
|
|
57
|
+
{
|
|
58
|
+
name: "Console",
|
|
59
|
+
type: "ConsoleTarget",
|
|
60
|
+
},
|
|
61
|
+
],
|
|
62
|
+
rules: [{ name: "*", level: "trace", target: "Console" }],
|
|
63
|
+
});
|
|
64
|
+
this.matchRulesToLogger();
|
|
65
|
+
this.resolveLogTargets();
|
|
66
|
+
super.resolve();
|
|
67
|
+
log_common_1.Log.Loggers.set(this.Name, this);
|
|
68
|
+
}
|
|
69
|
+
trace(err, message, ...args) {
|
|
70
|
+
wrapWrite.apply(this, [log_common_1.LogLevel.Trace])(err, message, ...args);
|
|
71
|
+
}
|
|
72
|
+
debug(err, message, ...args) {
|
|
73
|
+
wrapWrite.apply(this, [log_common_1.LogLevel.Debug])(err, message, ...args);
|
|
74
|
+
}
|
|
75
|
+
info(err, message, ...args) {
|
|
76
|
+
wrapWrite.apply(this, [log_common_1.LogLevel.Info])(err, message, ...args);
|
|
77
|
+
}
|
|
78
|
+
warn(err, message, ...args) {
|
|
79
|
+
wrapWrite.apply(this, [log_common_1.LogLevel.Warn])(err, message, ...args);
|
|
80
|
+
}
|
|
81
|
+
error(err, message, ...args) {
|
|
82
|
+
wrapWrite.apply(this, [log_common_1.LogLevel.Error])(err, message, ...args);
|
|
83
|
+
}
|
|
84
|
+
fatal(err, message, ...args) {
|
|
85
|
+
wrapWrite.apply(this, [log_common_1.LogLevel.Fatal])(err, message, ...args);
|
|
86
|
+
}
|
|
87
|
+
security(err, message, ...args) {
|
|
88
|
+
wrapWrite.apply(this, [log_common_1.LogLevel.Security])(err, message, ...args);
|
|
89
|
+
}
|
|
90
|
+
success(err, message, ...args) {
|
|
91
|
+
wrapWrite.apply(this, [log_common_1.LogLevel.Success])(err, message, ...args);
|
|
92
|
+
}
|
|
93
|
+
write(entry) {
|
|
94
|
+
if (entry.Variables.logger === this.Name) {
|
|
95
|
+
return Promise.allSettled(this.Targets.filter((t) => entry.Level >= log_common_1.StrToLogLevel[t.rule.level]).map((t) => {
|
|
96
|
+
if (!t.instance) {
|
|
97
|
+
throw new exceptions_1.InvalidOperation(`Target for rule ${t.rule.name} not exists`);
|
|
98
|
+
}
|
|
99
|
+
return t.instance.write(entry);
|
|
100
|
+
}));
|
|
101
|
+
}
|
|
102
|
+
}
|
|
103
|
+
resolveLogTargets() {
|
|
104
|
+
this.Targets = this.Rules.map((r) => {
|
|
105
|
+
const found = this.Options.targets.filter((t) => {
|
|
106
|
+
return Array.isArray(r.target)
|
|
107
|
+
? r.target.includes(t.name)
|
|
108
|
+
: r.target === t.name;
|
|
109
|
+
});
|
|
110
|
+
if (!found) {
|
|
111
|
+
throw new exceptions_1.InvalidOption(`No target matching rule ${r.name}`);
|
|
112
|
+
}
|
|
113
|
+
return found.map((f) => {
|
|
114
|
+
return {
|
|
115
|
+
instance: di_1.DI.resolve(f.type, [f]),
|
|
116
|
+
options: f,
|
|
117
|
+
rule: r,
|
|
118
|
+
};
|
|
119
|
+
});
|
|
120
|
+
}).reduce((prev, curr) => prev.concat(...curr), []);
|
|
121
|
+
}
|
|
122
|
+
matchRulesToLogger() {
|
|
123
|
+
this.Rules = this.Options.rules.filter((r) => {
|
|
124
|
+
const g = (0, glob_to_regexp_1.default)(r.name);
|
|
125
|
+
// BUG: g.test throws vscode err ?
|
|
126
|
+
return g.test(this.Name);
|
|
127
|
+
});
|
|
128
|
+
}
|
|
129
|
+
};
|
|
130
|
+
exports.FrameworkLogger = FrameworkLogger;
|
|
131
|
+
exports.FrameworkLogger = FrameworkLogger = __decorate([
|
|
132
|
+
(0, di_1.NewInstance)(),
|
|
133
|
+
__metadata("design:paramtypes", [String, Object, log_common_1.Log])
|
|
134
|
+
], FrameworkLogger);
|
|
135
|
+
const logFactoryFunction = (container, logName) => {
|
|
136
|
+
if (log_common_1.Log.Loggers.has(logName)) {
|
|
137
|
+
return log_common_1.Log.Loggers.get(logName);
|
|
138
|
+
}
|
|
139
|
+
if (!di_1.DI.has(configuration_1.Configuration)) {
|
|
140
|
+
if (log_common_1.Log.InternalLoggers.has(logName)) {
|
|
141
|
+
return log_common_1.Log.InternalLoggers.get(logName);
|
|
142
|
+
}
|
|
143
|
+
const internalLogger = container.resolve(internal_logger_1.InternalLoggerProxy, [logName]);
|
|
144
|
+
log_common_1.Log.InternalLoggers.set(logName, this);
|
|
145
|
+
return internalLogger;
|
|
146
|
+
}
|
|
147
|
+
return container.resolve("__logImplementation__", [logName]);
|
|
148
|
+
};
|
|
149
|
+
// register as string identifier to allow for
|
|
150
|
+
// resolving logs without referencing class
|
|
151
|
+
// to avoid circular dependencies in some @spinajs packages
|
|
152
|
+
// it should not be used in production code
|
|
153
|
+
di_1.DI.register(logFactoryFunction).as("__log__");
|
|
154
|
+
// register log factory function as Log class
|
|
155
|
+
// this way we can create or return already created
|
|
156
|
+
// log objects
|
|
157
|
+
di_1.DI.register(logFactoryFunction).as(log_common_1.Log);
|
|
158
|
+
// register Log class as string literal
|
|
159
|
+
// so we can resolve Log class
|
|
160
|
+
// it should not be used in production code
|
|
161
|
+
di_1.DI.register(FrameworkLogger).as("__logImplementation__");
|
|
162
162
|
//# sourceMappingURL=log.js.map
|
package/lib/cjs/log.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"log.js","sourceRoot":"","sources":["../../src/log.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;AAAA,4DAA4D;AAC5D,sDAAsD;AACtD,0DAA0D;AAC1D,0DAAuD;AACvD,oCAIqB;AACrB,oDAU6B;AAC7B,oEAA0C;AAC1C,oDAAsE;AACtE,8DAA+D;AAE/D,SAAS,SAAS,CAAY,KAAe;IAC3C,OAAO,CAAC,GAAmB,EAAE,OAAuB,EAAE,GAAG,IAAW,EAAE,EAAE;QACtE,IAAI,GAAG,YAAY,KAAK,EAAE;YACxB,OAAO,IAAI,CAAC,KAAK,CACf,IAAA,mCAAsB,EACpB,GAAG,EACH,OAAO,EACP,KAAK,EACL,IAAI,CAAC,IAAI,EACT,IAAI,CAAC,SAAS,EACd,GAAG,IAAI,CACR,CACF,CAAC;SACH;aAAM;YACL,IAAI,OAAO,EAAE;gBACX,OAAO,IAAI,CAAC,KAAK,CACf,IAAA,mCAAsB,EACpB,GAAG,EACH,IAAI,EACJ,KAAK,EACL,IAAI,CAAC,IAAI,EACT,IAAI,CAAC,SAAS,EACd,GAAG,CAAC,OAAO,EAAE,GAAG,IAAI,CAAC,CACtB,CACF,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