@spinajs/log 2.0.180 → 2.0.182
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/mjs/bootstrap.js
CHANGED
|
@@ -1,50 +1,50 @@
|
|
|
1
|
-
var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
|
|
2
|
-
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
3
|
-
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
|
|
4
|
-
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;
|
|
5
|
-
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
6
|
-
};
|
|
7
|
-
import { Configuration } from "@spinajs/configuration";
|
|
8
|
-
import { Injectable, Bootstrapper, DI } from "@spinajs/di";
|
|
9
|
-
import { Log } from "@spinajs/log-common";
|
|
10
|
-
import CONFIGURATION_SCHEMA from "./schemas/log.configuration.js";
|
|
11
|
-
let LogBotstrapper = class LogBotstrapper extends Bootstrapper {
|
|
12
|
-
bootstrap() {
|
|
13
|
-
DI.register(CONFIGURATION_SCHEMA).asValue("__configurationSchema__");
|
|
14
|
-
// check if we run tests,
|
|
15
|
-
// hook for uncaughtException causes to not showing
|
|
16
|
-
// mocha errors in console
|
|
17
|
-
if (!process.env.TESTING) {
|
|
18
|
-
process.on("uncaughtException", (err) => {
|
|
19
|
-
// if we have configuration resolved, we can assume that logger can read configuration
|
|
20
|
-
// so log to default log
|
|
21
|
-
// if not log to console
|
|
22
|
-
if (DI.has(Configuration)) {
|
|
23
|
-
const log = DI.resolve(Log, ["process"]);
|
|
24
|
-
log.fatal(err, "Unhandled exception occured");
|
|
25
|
-
}
|
|
26
|
-
else {
|
|
27
|
-
console.error("Unhandled exception occured, reason:" + JSON.stringify(err));
|
|
28
|
-
}
|
|
29
|
-
});
|
|
30
|
-
process.on("unhandledRejection", (reason, p) => {
|
|
31
|
-
// if we have configuration resolved, we can assume that logger can read configuration
|
|
32
|
-
// so log to default log
|
|
33
|
-
// if not log to console
|
|
34
|
-
if (DI.has(Configuration)) {
|
|
35
|
-
const log = DI.resolve(Log, ["process"]);
|
|
36
|
-
log.fatal(reason, "Unhandled rejection at Promise %s", p);
|
|
37
|
-
}
|
|
38
|
-
else {
|
|
39
|
-
console.error("Unhandled rejection at Promise %s, reason: " +
|
|
40
|
-
JSON.stringify(reason));
|
|
41
|
-
}
|
|
42
|
-
});
|
|
43
|
-
}
|
|
44
|
-
}
|
|
45
|
-
};
|
|
46
|
-
LogBotstrapper = __decorate([
|
|
47
|
-
Injectable(Bootstrapper)
|
|
48
|
-
], LogBotstrapper);
|
|
49
|
-
export { LogBotstrapper };
|
|
1
|
+
var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
|
|
2
|
+
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
3
|
+
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
|
|
4
|
+
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;
|
|
5
|
+
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
6
|
+
};
|
|
7
|
+
import { Configuration } from "@spinajs/configuration";
|
|
8
|
+
import { Injectable, Bootstrapper, DI } from "@spinajs/di";
|
|
9
|
+
import { Log } from "@spinajs/log-common";
|
|
10
|
+
import CONFIGURATION_SCHEMA from "./schemas/log.configuration.js";
|
|
11
|
+
let LogBotstrapper = class LogBotstrapper extends Bootstrapper {
|
|
12
|
+
bootstrap() {
|
|
13
|
+
DI.register(CONFIGURATION_SCHEMA).asValue("__configurationSchema__");
|
|
14
|
+
// check if we run tests,
|
|
15
|
+
// hook for uncaughtException causes to not showing
|
|
16
|
+
// mocha errors in console
|
|
17
|
+
if (!process.env.TESTING) {
|
|
18
|
+
process.on("uncaughtException", (err) => {
|
|
19
|
+
// if we have configuration resolved, we can assume that logger can read configuration
|
|
20
|
+
// so log to default log
|
|
21
|
+
// if not log to console
|
|
22
|
+
if (DI.has(Configuration)) {
|
|
23
|
+
const log = DI.resolve(Log, ["process"]);
|
|
24
|
+
log.fatal(err, "Unhandled exception occured");
|
|
25
|
+
}
|
|
26
|
+
else {
|
|
27
|
+
console.error("Unhandled exception occured, reason:" + JSON.stringify(err));
|
|
28
|
+
}
|
|
29
|
+
});
|
|
30
|
+
process.on("unhandledRejection", (reason, p) => {
|
|
31
|
+
// if we have configuration resolved, we can assume that logger can read configuration
|
|
32
|
+
// so log to default log
|
|
33
|
+
// if not log to console
|
|
34
|
+
if (DI.has(Configuration)) {
|
|
35
|
+
const log = DI.resolve(Log, ["process"]);
|
|
36
|
+
log.fatal(reason, "Unhandled rejection at Promise %s", p);
|
|
37
|
+
}
|
|
38
|
+
else {
|
|
39
|
+
console.error("Unhandled rejection at Promise %s, reason: " +
|
|
40
|
+
JSON.stringify(reason));
|
|
41
|
+
}
|
|
42
|
+
});
|
|
43
|
+
}
|
|
44
|
+
}
|
|
45
|
+
};
|
|
46
|
+
LogBotstrapper = __decorate([
|
|
47
|
+
Injectable(Bootstrapper)
|
|
48
|
+
], LogBotstrapper);
|
|
49
|
+
export { LogBotstrapper };
|
|
50
50
|
//# sourceMappingURL=bootstrap.js.map
|
package/lib/mjs/bootstrap.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"bootstrap.js","sour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K,CACX,sCAAsC,GAAG,IAAI,CAAC,SAAS,CAAC,GAAG,CAAC,CAC7D,CAAC;iBACH;YACH,CAAC,CAAC,CAAC;YAEH,OAAO,CAAC,EAAE,CAAC,oBAAoB,EAAE,CAAC,MAAM,EAAE,CAAC,EAAE,EAAE;gBAC7C,sFAAsF;gBACtF,wBAAwB;gBACxB,wBAAwB;gBACxB,IAAI,EAAE,CAAC,GAAG,CAAC,aAAa,CAAC,EAAE;oBACzB,MAAM,GAAG,GAAG,EAAE,CAAC,OAAO,CAAC,GAAG,EAAE,CAAC,SAAS,CAAC,CAAC,CAAC;oBACzC,GAAG,CAAC,KAAK,CAAC,MAAe,EAAE,mCAAmC,EAAE,CAAC,CAAC,CAAC;iBACpE;qBAAM;oBACL,OAAO,CAAC,KAAK,CACX,6CAA6C;wBAC3C,IAAI,CAAC,SAAS,CAAC,MAAM,CAAC,CACzB,CAAC;iBACH;YACH,CAAC,CAAC,CAAC;SACJ;IACH,CAAC;CACF,CAAA;AAtCY,cAAc;IAD1B,UAAU,CAAC,YAAY,CAAC;GACZ,cAAc,CAsC1B"}
|
package/lib/mjs/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/mjs/index.js
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.js.map
|
package/lib/mjs/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/mjs/log.js
CHANGED
|
@@ -1,156 +1,156 @@
|
|
|
1
|
-
var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
|
|
2
|
-
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
3
|
-
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
|
|
4
|
-
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;
|
|
5
|
-
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
6
|
-
};
|
|
7
|
-
var __metadata = (this && this.__metadata) || function (k, v) {
|
|
8
|
-
if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
|
|
9
|
-
};
|
|
10
|
-
/* eslint-disable @typescript-eslint/no-unsafe-assignment */
|
|
11
|
-
/* eslint-disable @typescript-eslint/no-unsafe-call */
|
|
12
|
-
/* eslint-disable @typescript-eslint/no-unsafe-argument */
|
|
13
|
-
import { Configuration } from "@spinajs/configuration";
|
|
14
|
-
import { DI, NewInstance, } from "@spinajs/di";
|
|
15
|
-
import { LogLevel, StrToLogLevel, createLogMessageObject, Log, } from "@spinajs/log-common";
|
|
16
|
-
import GlobToRegExp from "glob-to-regexp";
|
|
17
|
-
import { InvalidOperation, InvalidOption } from "@spinajs/exceptions";
|
|
18
|
-
import { InternalLoggerProxy } from "@spinajs/internal-logger";
|
|
19
|
-
function wrapWrite(level) {
|
|
20
|
-
return (err, message, ...args) => {
|
|
21
|
-
if (err instanceof Error) {
|
|
22
|
-
return this.write(createLogMessageObject(err, message, level, this.Name, this.Variables, ...args));
|
|
23
|
-
}
|
|
24
|
-
else {
|
|
25
|
-
if (message) {
|
|
26
|
-
return this.write(createLogMessageObject(err, null, level, this.Name, this.Variables, ...[message, ...args]));
|
|
27
|
-
}
|
|
28
|
-
else {
|
|
29
|
-
return this.write(createLogMessageObject(err, null, level, this.Name, this.Variables, ...args));
|
|
30
|
-
}
|
|
31
|
-
}
|
|
32
|
-
};
|
|
33
|
-
}
|
|
34
|
-
/**
|
|
35
|
-
* Default log implementation interface. Taken from bunyan. Feel free to implement own.
|
|
36
|
-
*/
|
|
37
|
-
let FrameworkLogger = class FrameworkLogger extends Log {
|
|
38
|
-
constructor(Name, variables, Parent) {
|
|
39
|
-
super();
|
|
40
|
-
this.Name = Name;
|
|
41
|
-
this.Parent = Parent;
|
|
42
|
-
this.Variables = variables ?? {};
|
|
43
|
-
}
|
|
44
|
-
resolve() {
|
|
45
|
-
const config = this.Container.get(Configuration);
|
|
46
|
-
if (!config) {
|
|
47
|
-
throw new Error(`Configuration module is not avaible. Please resolve configuration module before any logging can occur`);
|
|
48
|
-
}
|
|
49
|
-
this.Options = config.get("logger", {
|
|
50
|
-
targets: [
|
|
51
|
-
{
|
|
52
|
-
name: "Console",
|
|
53
|
-
type: "ConsoleTarget",
|
|
54
|
-
},
|
|
55
|
-
],
|
|
56
|
-
rules: [{ name: "*", level: "trace", target: "Console" }],
|
|
57
|
-
});
|
|
58
|
-
this.matchRulesToLogger();
|
|
59
|
-
this.resolveLogTargets();
|
|
60
|
-
super.resolve();
|
|
61
|
-
Log.Loggers.set(this.Name, this);
|
|
62
|
-
}
|
|
63
|
-
trace(err, message, ...args) {
|
|
64
|
-
wrapWrite.apply(this, [LogLevel.Trace])(err, message, ...args);
|
|
65
|
-
}
|
|
66
|
-
debug(err, message, ...args) {
|
|
67
|
-
wrapWrite.apply(this, [LogLevel.Debug])(err, message, ...args);
|
|
68
|
-
}
|
|
69
|
-
info(err, message, ...args) {
|
|
70
|
-
wrapWrite.apply(this, [LogLevel.Info])(err, message, ...args);
|
|
71
|
-
}
|
|
72
|
-
warn(err, message, ...args) {
|
|
73
|
-
wrapWrite.apply(this, [LogLevel.Warn])(err, message, ...args);
|
|
74
|
-
}
|
|
75
|
-
error(err, message, ...args) {
|
|
76
|
-
wrapWrite.apply(this, [LogLevel.Error])(err, message, ...args);
|
|
77
|
-
}
|
|
78
|
-
fatal(err, message, ...args) {
|
|
79
|
-
wrapWrite.apply(this, [LogLevel.Fatal])(err, message, ...args);
|
|
80
|
-
}
|
|
81
|
-
security(err, message, ...args) {
|
|
82
|
-
wrapWrite.apply(this, [LogLevel.Security])(err, message, ...args);
|
|
83
|
-
}
|
|
84
|
-
success(err, message, ...args) {
|
|
85
|
-
wrapWrite.apply(this, [LogLevel.Success])(err, message, ...args);
|
|
86
|
-
}
|
|
87
|
-
write(entry) {
|
|
88
|
-
if (entry.Variables.logger === this.Name) {
|
|
89
|
-
return Promise.allSettled(this.Targets.filter((t) => entry.Level >= StrToLogLevel[t.rule.level]).map((t) => {
|
|
90
|
-
if (!t.instance) {
|
|
91
|
-
throw new InvalidOperation(`Target for rule ${t.rule.name} not exists`);
|
|
92
|
-
}
|
|
93
|
-
return t.instance.write(entry);
|
|
94
|
-
}));
|
|
95
|
-
}
|
|
96
|
-
}
|
|
97
|
-
resolveLogTargets() {
|
|
98
|
-
this.Targets = this.Rules.map((r) => {
|
|
99
|
-
const found = this.Options.targets.filter((t) => {
|
|
100
|
-
return Array.isArray(r.target)
|
|
101
|
-
? r.target.includes(t.name)
|
|
102
|
-
: r.target === t.name;
|
|
103
|
-
});
|
|
104
|
-
if (!found) {
|
|
105
|
-
throw new InvalidOption(`No target matching rule ${r.name}`);
|
|
106
|
-
}
|
|
107
|
-
return found.map((f) => {
|
|
108
|
-
return {
|
|
109
|
-
instance: DI.resolve(f.type, [f]),
|
|
110
|
-
options: f,
|
|
111
|
-
rule: r,
|
|
112
|
-
};
|
|
113
|
-
});
|
|
114
|
-
}).reduce((prev, curr) => prev.concat(...curr), []);
|
|
115
|
-
}
|
|
116
|
-
matchRulesToLogger() {
|
|
117
|
-
this.Rules = this.Options.rules.filter((r) => {
|
|
118
|
-
const g = GlobToRegExp(r.name);
|
|
119
|
-
// BUG: g.test throws vscode err ?
|
|
120
|
-
return g.test(this.Name);
|
|
121
|
-
});
|
|
122
|
-
}
|
|
123
|
-
};
|
|
124
|
-
FrameworkLogger = __decorate([
|
|
125
|
-
NewInstance(),
|
|
126
|
-
__metadata("design:paramtypes", [String, Object, Log])
|
|
127
|
-
], FrameworkLogger);
|
|
128
|
-
export { FrameworkLogger };
|
|
129
|
-
const logFactoryFunction = (container, logName) => {
|
|
130
|
-
if (Log.Loggers.has(logName)) {
|
|
131
|
-
return Log.Loggers.get(logName);
|
|
132
|
-
}
|
|
133
|
-
if (!DI.has(Configuration)) {
|
|
134
|
-
if (Log.InternalLoggers.has(logName)) {
|
|
135
|
-
return Log.InternalLoggers.get(logName);
|
|
136
|
-
}
|
|
137
|
-
const internalLogger = container.resolve(InternalLoggerProxy, [logName]);
|
|
138
|
-
Log.InternalLoggers.set(logName, this);
|
|
139
|
-
return internalLogger;
|
|
140
|
-
}
|
|
141
|
-
return container.resolve("__logImplementation__", [logName]);
|
|
142
|
-
};
|
|
143
|
-
// register as string identifier to allow for
|
|
144
|
-
// resolving logs without referencing class
|
|
145
|
-
// to avoid circular dependencies in some @spinajs packages
|
|
146
|
-
// it should not be used in production code
|
|
147
|
-
DI.register(logFactoryFunction).as("__log__");
|
|
148
|
-
// register log factory function as Log class
|
|
149
|
-
// this way we can create or return already created
|
|
150
|
-
// log objects
|
|
151
|
-
DI.register(logFactoryFunction).as(Log);
|
|
152
|
-
// register Log class as string literal
|
|
153
|
-
// so we can resolve Log class
|
|
154
|
-
// it should not be used in production code
|
|
155
|
-
DI.register(FrameworkLogger).as("__logImplementation__");
|
|
1
|
+
var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
|
|
2
|
+
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
3
|
+
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
|
|
4
|
+
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;
|
|
5
|
+
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
6
|
+
};
|
|
7
|
+
var __metadata = (this && this.__metadata) || function (k, v) {
|
|
8
|
+
if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
|
|
9
|
+
};
|
|
10
|
+
/* eslint-disable @typescript-eslint/no-unsafe-assignment */
|
|
11
|
+
/* eslint-disable @typescript-eslint/no-unsafe-call */
|
|
12
|
+
/* eslint-disable @typescript-eslint/no-unsafe-argument */
|
|
13
|
+
import { Configuration } from "@spinajs/configuration";
|
|
14
|
+
import { DI, NewInstance, } from "@spinajs/di";
|
|
15
|
+
import { LogLevel, StrToLogLevel, createLogMessageObject, Log, } from "@spinajs/log-common";
|
|
16
|
+
import GlobToRegExp from "glob-to-regexp";
|
|
17
|
+
import { InvalidOperation, InvalidOption } from "@spinajs/exceptions";
|
|
18
|
+
import { InternalLoggerProxy } from "@spinajs/internal-logger";
|
|
19
|
+
function wrapWrite(level) {
|
|
20
|
+
return (err, message, ...args) => {
|
|
21
|
+
if (err instanceof Error) {
|
|
22
|
+
return this.write(createLogMessageObject(err, message, level, this.Name, this.Variables, ...args));
|
|
23
|
+
}
|
|
24
|
+
else {
|
|
25
|
+
if (message) {
|
|
26
|
+
return this.write(createLogMessageObject(err, null, level, this.Name, this.Variables, ...[message, ...args]));
|
|
27
|
+
}
|
|
28
|
+
else {
|
|
29
|
+
return this.write(createLogMessageObject(err, null, level, this.Name, this.Variables, ...args));
|
|
30
|
+
}
|
|
31
|
+
}
|
|
32
|
+
};
|
|
33
|
+
}
|
|
34
|
+
/**
|
|
35
|
+
* Default log implementation interface. Taken from bunyan. Feel free to implement own.
|
|
36
|
+
*/
|
|
37
|
+
let FrameworkLogger = class FrameworkLogger extends Log {
|
|
38
|
+
constructor(Name, variables, Parent) {
|
|
39
|
+
super();
|
|
40
|
+
this.Name = Name;
|
|
41
|
+
this.Parent = Parent;
|
|
42
|
+
this.Variables = variables ?? {};
|
|
43
|
+
}
|
|
44
|
+
resolve() {
|
|
45
|
+
const config = this.Container.get(Configuration);
|
|
46
|
+
if (!config) {
|
|
47
|
+
throw new Error(`Configuration module is not avaible. Please resolve configuration module before any logging can occur`);
|
|
48
|
+
}
|
|
49
|
+
this.Options = config.get("logger", {
|
|
50
|
+
targets: [
|
|
51
|
+
{
|
|
52
|
+
name: "Console",
|
|
53
|
+
type: "ConsoleTarget",
|
|
54
|
+
},
|
|
55
|
+
],
|
|
56
|
+
rules: [{ name: "*", level: "trace", target: "Console" }],
|
|
57
|
+
});
|
|
58
|
+
this.matchRulesToLogger();
|
|
59
|
+
this.resolveLogTargets();
|
|
60
|
+
super.resolve();
|
|
61
|
+
Log.Loggers.set(this.Name, this);
|
|
62
|
+
}
|
|
63
|
+
trace(err, message, ...args) {
|
|
64
|
+
wrapWrite.apply(this, [LogLevel.Trace])(err, message, ...args);
|
|
65
|
+
}
|
|
66
|
+
debug(err, message, ...args) {
|
|
67
|
+
wrapWrite.apply(this, [LogLevel.Debug])(err, message, ...args);
|
|
68
|
+
}
|
|
69
|
+
info(err, message, ...args) {
|
|
70
|
+
wrapWrite.apply(this, [LogLevel.Info])(err, message, ...args);
|
|
71
|
+
}
|
|
72
|
+
warn(err, message, ...args) {
|
|
73
|
+
wrapWrite.apply(this, [LogLevel.Warn])(err, message, ...args);
|
|
74
|
+
}
|
|
75
|
+
error(err, message, ...args) {
|
|
76
|
+
wrapWrite.apply(this, [LogLevel.Error])(err, message, ...args);
|
|
77
|
+
}
|
|
78
|
+
fatal(err, message, ...args) {
|
|
79
|
+
wrapWrite.apply(this, [LogLevel.Fatal])(err, message, ...args);
|
|
80
|
+
}
|
|
81
|
+
security(err, message, ...args) {
|
|
82
|
+
wrapWrite.apply(this, [LogLevel.Security])(err, message, ...args);
|
|
83
|
+
}
|
|
84
|
+
success(err, message, ...args) {
|
|
85
|
+
wrapWrite.apply(this, [LogLevel.Success])(err, message, ...args);
|
|
86
|
+
}
|
|
87
|
+
write(entry) {
|
|
88
|
+
if (entry.Variables.logger === this.Name) {
|
|
89
|
+
return Promise.allSettled(this.Targets.filter((t) => entry.Level >= StrToLogLevel[t.rule.level]).map((t) => {
|
|
90
|
+
if (!t.instance) {
|
|
91
|
+
throw new InvalidOperation(`Target for rule ${t.rule.name} not exists`);
|
|
92
|
+
}
|
|
93
|
+
return t.instance.write(entry);
|
|
94
|
+
}));
|
|
95
|
+
}
|
|
96
|
+
}
|
|
97
|
+
resolveLogTargets() {
|
|
98
|
+
this.Targets = this.Rules.map((r) => {
|
|
99
|
+
const found = this.Options.targets.filter((t) => {
|
|
100
|
+
return Array.isArray(r.target)
|
|
101
|
+
? r.target.includes(t.name)
|
|
102
|
+
: r.target === t.name;
|
|
103
|
+
});
|
|
104
|
+
if (!found) {
|
|
105
|
+
throw new InvalidOption(`No target matching rule ${r.name}`);
|
|
106
|
+
}
|
|
107
|
+
return found.map((f) => {
|
|
108
|
+
return {
|
|
109
|
+
instance: DI.resolve(f.type, [f]),
|
|
110
|
+
options: f,
|
|
111
|
+
rule: r,
|
|
112
|
+
};
|
|
113
|
+
});
|
|
114
|
+
}).reduce((prev, curr) => prev.concat(...curr), []);
|
|
115
|
+
}
|
|
116
|
+
matchRulesToLogger() {
|
|
117
|
+
this.Rules = this.Options.rules.filter((r) => {
|
|
118
|
+
const g = GlobToRegExp(r.name);
|
|
119
|
+
// BUG: g.test throws vscode err ?
|
|
120
|
+
return g.test(this.Name);
|
|
121
|
+
});
|
|
122
|
+
}
|
|
123
|
+
};
|
|
124
|
+
FrameworkLogger = __decorate([
|
|
125
|
+
NewInstance(),
|
|
126
|
+
__metadata("design:paramtypes", [String, Object, Log])
|
|
127
|
+
], FrameworkLogger);
|
|
128
|
+
export { FrameworkLogger };
|
|
129
|
+
const logFactoryFunction = (container, logName) => {
|
|
130
|
+
if (Log.Loggers.has(logName)) {
|
|
131
|
+
return Log.Loggers.get(logName);
|
|
132
|
+
}
|
|
133
|
+
if (!DI.has(Configuration)) {
|
|
134
|
+
if (Log.InternalLoggers.has(logName)) {
|
|
135
|
+
return Log.InternalLoggers.get(logName);
|
|
136
|
+
}
|
|
137
|
+
const internalLogger = container.resolve(InternalLoggerProxy, [logName]);
|
|
138
|
+
Log.InternalLoggers.set(logName, this);
|
|
139
|
+
return internalLogger;
|
|
140
|
+
}
|
|
141
|
+
return container.resolve("__logImplementation__", [logName]);
|
|
142
|
+
};
|
|
143
|
+
// register as string identifier to allow for
|
|
144
|
+
// resolving logs without referencing class
|
|
145
|
+
// to avoid circular dependencies in some @spinajs packages
|
|
146
|
+
// it should not be used in production code
|
|
147
|
+
DI.register(logFactoryFunction).as("__log__");
|
|
148
|
+
// register log factory function as Log class
|
|
149
|
+
// this way we can create or return already created
|
|
150
|
+
// log objects
|
|
151
|
+
DI.register(logFactoryFunction).as(Log);
|
|
152
|
+
// register Log class as string literal
|
|
153
|
+
// so we can resolve Log class
|
|
154
|
+
// it should not be used in production code
|
|
155
|
+
DI.register(FrameworkLogger).as("__logImplementation__");
|
|
156
156
|
//# sourceMappingURL=log.js.map
|
package/lib/mjs/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,OAAO,EAAE,aAAa,EAAE,MAAM,wBAAwB,CAAC;AACvD,OAAO,EACL,EAAE,EAEF,WAAW,GACZ,MAAM,aAAa,CAAC;AACrB,OAAO,EAEL,QAAQ,EAGR,aAAa,EACb,sBAAsB,EAGtB,GAAG,GACJ,MAAM,qBAAqB,CAAC;AAC7B,OAAO,YAAY,MAAM,gBAAgB,CAAC;AAC1C,OAAO,EAAE,gBAAgB,EAAE,aAAa,EAAE,MAAM,qBAAqB,CAAC;AACtE,OAAO,EAAE,mBAAmB,EAAE,MAAM,0BAA0B,CAAC;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,sBAAsB,CACpB,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,CAA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