@spinajs/log 2.0.52 → 2.0.54
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/bootstrap.d.ts +5 -0
- package/lib/bootstrap.d.ts.map +1 -0
- package/lib/bootstrap.js +50 -0
- package/lib/bootstrap.js.map +1 -0
- package/lib/decorators.d.ts +7 -0
- package/lib/decorators.d.ts.map +1 -0
- package/lib/decorators.js +35 -0
- package/lib/decorators.js.map +1 -0
- package/lib/index.d.ts +6 -0
- package/lib/index.d.ts.map +1 -0
- package/lib/index.js +6 -0
- package/lib/index.js.map +1 -0
- package/lib/log.d.ts +45 -0
- package/lib/log.d.ts.map +1 -0
- package/lib/log.js +197 -0
- package/lib/log.js.map +1 -0
- package/lib/schemas/log.configuration.d.ts +88 -0
- package/lib/schemas/log.configuration.d.ts.map +1 -0
- package/lib/schemas/log.configuration.js +99 -0
- package/lib/schemas/log.configuration.js.map +1 -0
- package/lib/targets/BlackHoleTarget.d.ts +8 -0
- package/lib/targets/BlackHoleTarget.d.ts.map +1 -0
- package/lib/targets/BlackHoleTarget.js +22 -0
- package/lib/targets/BlackHoleTarget.js.map +1 -0
- package/lib/targets/ColoredConsoleTarget.d.ts +51 -0
- package/lib/targets/ColoredConsoleTarget.d.ts.map +1 -0
- package/lib/targets/ColoredConsoleTarget.js +65 -0
- package/lib/targets/ColoredConsoleTarget.js.map +1 -0
- package/lib/targets/FileTarget.d.ts +30 -0
- package/lib/targets/FileTarget.d.ts.map +1 -0
- package/lib/targets/FileTarget.js +232 -0
- package/lib/targets/FileTarget.js.map +1 -0
- package/lib/targets/index.d.ts +4 -0
- package/lib/targets/index.d.ts.map +1 -0
- package/lib/targets/index.js +4 -0
- package/lib/targets/index.js.map +1 -0
- package/package.json +9 -6
- package/.eslintignore +0 -2
- package/.eslintrc.cjs +0 -45
- package/.mocharc.json +0 -8
- package/typedoc.json +0 -16
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"bootstrap.d.ts","sourceRoot":"","sources":["../src/bootstrap.ts"],"names":[],"mappings":"AACA,OAAO,EAAc,YAAY,EAAM,MAAM,aAAa,CAAC;AAI3D,qBACa,cAAe,SAAQ,YAAY;IACvC,SAAS,IAAI,IAAI;CAqCzB"}
|
package/lib/bootstrap.js
ADDED
|
@@ -0,0 +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 "./log.js";
|
|
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
|
+
//# sourceMappingURL=bootstrap.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"bootstrap.js","sourceRoot":"","sources":["../src/bootstrap.ts"],"names":[],"mappings":";;;;;;AAAA,OAAO,EAAE,aAAa,EAAE,MAAM,wBAAwB,CAAC;AACvD,OAAO,EAAE,UAAU,EAAE,YAAY,EAAE,EAAE,EAAE,MAAM,aAAa,CAAC;AAC3D,OAAO,EAAE,GAAG,EAAE,MAAM,UAAU,CAAC;AAC/B,OAAO,oBAAoB,MAAM,gCAAgC,CAAC;AAG3D,IAAM,cAAc,GAApB,MAAM,cAAe,SAAQ,YAAY;IACvC,SAAS;QACd,EAAE,CAAC,QAAQ,CAAC,oBAAoB,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;gBACtC,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,GAAG,EAAE,6BAA6B,CAAC,CAAC;iBAC/C;qBAAM;oBACL,OAAO,CAAC,KAAK,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;SAtCY,cAAc"}
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Creates ( if not exists ) new logger instance with given name and optional variables
|
|
3
|
+
* @param name - name of logger
|
|
4
|
+
* @param variables - optional log variables
|
|
5
|
+
*/
|
|
6
|
+
export declare function Logger(name: string, variables?: Record<string, unknown>): (target: any, key: string) => any;
|
|
7
|
+
//# sourceMappingURL=decorators.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"decorators.d.ts","sourceRoot":"","sources":["../src/decorators.ts"],"names":[],"mappings":"AAKA;;;;GAIG;AACH,wBAAgB,MAAM,CAAC,IAAI,EAAE,MAAM,EAAE,SAAS,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,YACtD,GAAG,OAAO,MAAM,KAAG,GAAG,CAyBvC"}
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
/* eslint-disable @typescript-eslint/no-unsafe-member-access */
|
|
2
|
+
/* eslint-disable @typescript-eslint/no-unsafe-assignment */
|
|
3
|
+
import { DI } from "@spinajs/di";
|
|
4
|
+
import { Log } from "./log.js";
|
|
5
|
+
/**
|
|
6
|
+
* Creates ( if not exists ) new logger instance with given name and optional variables
|
|
7
|
+
* @param name - name of logger
|
|
8
|
+
* @param variables - optional log variables
|
|
9
|
+
*/
|
|
10
|
+
export function Logger(name, variables) {
|
|
11
|
+
return (target, key) => {
|
|
12
|
+
let logger;
|
|
13
|
+
// property getter
|
|
14
|
+
const getter = () => {
|
|
15
|
+
if (!logger) {
|
|
16
|
+
const allLoggers = DI.get(Array.ofType(Log));
|
|
17
|
+
const found = allLoggers.find((l) => l.Name);
|
|
18
|
+
if (found) {
|
|
19
|
+
logger = found;
|
|
20
|
+
}
|
|
21
|
+
else {
|
|
22
|
+
logger = DI.resolve(Log, [name, variables]);
|
|
23
|
+
}
|
|
24
|
+
}
|
|
25
|
+
return logger;
|
|
26
|
+
};
|
|
27
|
+
// Create new property with getter and setter
|
|
28
|
+
Object.defineProperty(target, key, {
|
|
29
|
+
get: getter,
|
|
30
|
+
enumerable: false,
|
|
31
|
+
configurable: false,
|
|
32
|
+
});
|
|
33
|
+
};
|
|
34
|
+
}
|
|
35
|
+
//# sourceMappingURL=decorators.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"decorators.js","sourceRoot":"","sources":["../src/decorators.ts"],"names":[],"mappings":"AAAA,+DAA+D;AAC/D,4DAA4D;AAC5D,OAAO,EAAE,EAAE,EAAE,MAAM,aAAa,CAAC;AACjC,OAAO,EAAE,GAAG,EAAE,MAAM,UAAU,CAAC;AAE/B;;;;GAIG;AACH,MAAM,UAAU,MAAM,CAAC,IAAY,EAAE,SAAmC;IACtE,OAAO,CAAC,MAAW,EAAE,GAAW,EAAO,EAAE;QACvC,IAAI,MAAW,CAAC;QAEhB,kBAAkB;QAClB,MAAM,MAAM,GAAG,GAAG,EAAE;YAClB,IAAI,CAAC,MAAM,EAAE;gBACX,MAAM,UAAU,GAAG,EAAE,CAAC,GAAG,CAAC,KAAK,CAAC,MAAM,CAAC,GAAG,CAAC,CAAC,CAAC;gBAC7C,MAAM,KAAK,GAAG,UAAU,CAAC,IAAI,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,IAAI,CAAC,CAAC;gBAE7C,IAAI,KAAK,EAAE;oBACT,MAAM,GAAG,KAAK,CAAC;iBAChB;qBAAM;oBACL,MAAM,GAAG,EAAE,CAAC,OAAO,CAAC,GAAG,EAAE,CAAC,IAAI,EAAE,SAAS,CAAC,CAAC,CAAC;iBAC7C;aACF;YACD,OAAO,MAAM,CAAC;QAChB,CAAC,CAAC;QAEF,6CAA6C;QAC7C,MAAM,CAAC,cAAc,CAAC,MAAM,EAAE,GAAG,EAAE;YACjC,GAAG,EAAE,MAAM;YACX,UAAU,EAAE,KAAK;YACjB,YAAY,EAAE,KAAK;SACpB,CAAC,CAAC;IACL,CAAC,CAAC;AACJ,CAAC"}
|
package/lib/index.d.ts
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,cAAc,qBAAqB,CAAC;AACpC,cAAc,oBAAoB,CAAC;AACnC,cAAc,UAAU,CAAC;AACzB,cAAc,iBAAiB,CAAC;AAChC,cAAc,gBAAgB,CAAC"}
|
package/lib/index.js
ADDED
package/lib/index.js.map
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,cAAc,qBAAqB,CAAC;AACpC,cAAc,oBAAoB,CAAC;AACnC,cAAc,UAAU,CAAC;AACzB,cAAc,iBAAiB,CAAC;AAChC,cAAc,gBAAgB,CAAC"}
|
package/lib/log.d.ts
ADDED
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
import { Container, SyncService } from "@spinajs/di";
|
|
2
|
+
import { ILogOptions, ILogRule, ILogEntry, LogVariables, ILog, ILogTargetDesc } from "@spinajs/log-common";
|
|
3
|
+
/**
|
|
4
|
+
* Default log implementation interface. Taken from bunyan. Feel free to implement own.
|
|
5
|
+
*/
|
|
6
|
+
export declare class Log extends SyncService implements ILog {
|
|
7
|
+
Name: string;
|
|
8
|
+
protected Parent?: Log;
|
|
9
|
+
static Loggers: Map<string, Log>;
|
|
10
|
+
static InternalLoggers: Map<string, Log>;
|
|
11
|
+
Timers: Map<string, Date>;
|
|
12
|
+
Targets: ILogTargetDesc[];
|
|
13
|
+
static clearLoggers(): void;
|
|
14
|
+
protected static AttachedToExitEvents: boolean;
|
|
15
|
+
protected Options: ILogOptions;
|
|
16
|
+
protected Rules: ILogRule[];
|
|
17
|
+
protected Variables: Record<string, any>;
|
|
18
|
+
protected Container: Container;
|
|
19
|
+
constructor(Name: string, variables?: Record<string, unknown>, Parent?: Log);
|
|
20
|
+
addVariable(name: string, value: unknown): void;
|
|
21
|
+
timeStart(name: string): void;
|
|
22
|
+
timeEnd(name: string): number;
|
|
23
|
+
resolve(): void;
|
|
24
|
+
trace(message: string, ...args: any[]): void;
|
|
25
|
+
trace(err: Error, message: string, ...args: any[]): void;
|
|
26
|
+
debug(message: string, ...args: any[]): void;
|
|
27
|
+
debug(err: Error, message: string, ...args: any[]): void;
|
|
28
|
+
info(message: string, ...args: any[]): void;
|
|
29
|
+
info(err: Error, message: string, ...args: any[]): void;
|
|
30
|
+
warn(message: string, ...args: any[]): void;
|
|
31
|
+
warn(err: Error, message: string, ...args: any[]): void;
|
|
32
|
+
error(message: string, ...args: any[]): void;
|
|
33
|
+
error(err: Error, message: string, ...args: any[]): void;
|
|
34
|
+
fatal(message: string, ...args: any[]): void;
|
|
35
|
+
fatal(err: Error, message: string, ...args: any[]): void;
|
|
36
|
+
security(message: string, ...args: any[]): void;
|
|
37
|
+
security(err: Error, message: string, ...args: any[]): void;
|
|
38
|
+
success(message: string, ...args: any[]): void;
|
|
39
|
+
success(err: Error, message: string, ...args: any[]): void;
|
|
40
|
+
write(entry: ILogEntry): Promise<PromiseSettledResult<void>[]>;
|
|
41
|
+
child(name: string, variables?: LogVariables): Log;
|
|
42
|
+
protected resolveLogTargets(): void;
|
|
43
|
+
protected matchRulesToLogger(): void;
|
|
44
|
+
}
|
|
45
|
+
//# sourceMappingURL=log.d.ts.map
|
package/lib/log.d.ts.map
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"log.d.ts","sourceRoot":"","sources":["../src/log.ts"],"names":[],"mappings":"AAIA,OAAO,EAEL,SAAS,EAIT,WAAW,EACZ,MAAM,aAAa,CAAC;AACrB,OAAO,EAGL,WAAW,EACX,QAAQ,EACR,SAAS,EAET,YAAY,EAEZ,IAAI,EACJ,cAAc,EAEf,MAAM,qBAAqB,CAAC;AA8C7B;;GAEG;AACH,qBACa,GAAI,SAAQ,WAAY,YAAW,IAAI;IAuBzC,IAAI,EAAE,MAAM;IAEnB,SAAS,CAAC,MAAM,CAAC,EAAE,GAAG;IAxBxB,OAAc,OAAO,EAAE,GAAG,CAAC,MAAM,EAAE,GAAG,CAAC,CAAa;IACpD,OAAc,eAAe,EAAE,GAAG,CAAC,MAAM,EAAE,GAAG,CAAC,CAAa;IAErD,MAAM,EAAE,GAAG,CAAC,MAAM,EAAE,IAAI,CAAC,CAA2B;IACpD,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 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
|
+
var Log_1;
|
|
11
|
+
/* eslint-disable @typescript-eslint/no-unsafe-assignment */
|
|
12
|
+
/* eslint-disable @typescript-eslint/no-unsafe-call */
|
|
13
|
+
/* eslint-disable @typescript-eslint/no-unsafe-argument */
|
|
14
|
+
import { Configuration } from "@spinajs/configuration";
|
|
15
|
+
import { Autoinject, Container, DI, NewInstance, SyncService, } from "@spinajs/di";
|
|
16
|
+
import { LogLevel, StrToLogLevel, createLogMessageObject, } from "@spinajs/log-common";
|
|
17
|
+
import GlobToRegExp from "glob-to-regexp";
|
|
18
|
+
import { InvalidOperation, InvalidOption } from "../../exceptions/lib/index.js";
|
|
19
|
+
import { InternalLoggerProxy } from "@spinajs/internal-logger";
|
|
20
|
+
function wrapWrite(level) {
|
|
21
|
+
return (err, message, ...args) => {
|
|
22
|
+
if (err instanceof Error) {
|
|
23
|
+
return this.write(createLogMessageObject(err, message, level, this.Name, this.Variables, ...args));
|
|
24
|
+
}
|
|
25
|
+
else {
|
|
26
|
+
if (message) {
|
|
27
|
+
return this.write(createLogMessageObject(err, null, level, this.Name, this.Variables, ...[message, ...args]));
|
|
28
|
+
}
|
|
29
|
+
else {
|
|
30
|
+
return this.write(createLogMessageObject(err, null, level, this.Name, this.Variables, ...args));
|
|
31
|
+
}
|
|
32
|
+
}
|
|
33
|
+
};
|
|
34
|
+
}
|
|
35
|
+
/**
|
|
36
|
+
* Default log implementation interface. Taken from bunyan. Feel free to implement own.
|
|
37
|
+
*/
|
|
38
|
+
let Log = Log_1 = class Log extends SyncService {
|
|
39
|
+
static { this.Loggers = new Map(); }
|
|
40
|
+
static { this.InternalLoggers = new Map(); }
|
|
41
|
+
static clearLoggers() {
|
|
42
|
+
Log_1.Loggers.clear();
|
|
43
|
+
}
|
|
44
|
+
static { this.AttachedToExitEvents = false; }
|
|
45
|
+
constructor(Name, variables, Parent) {
|
|
46
|
+
super();
|
|
47
|
+
this.Name = Name;
|
|
48
|
+
this.Parent = Parent;
|
|
49
|
+
this.Timers = new Map();
|
|
50
|
+
this.Variables = {};
|
|
51
|
+
this.Variables = variables ?? {};
|
|
52
|
+
}
|
|
53
|
+
addVariable(name, value) {
|
|
54
|
+
this.Variables[`${name}`] = value;
|
|
55
|
+
}
|
|
56
|
+
timeStart(name) {
|
|
57
|
+
if (this.Timers.has(name)) {
|
|
58
|
+
return;
|
|
59
|
+
}
|
|
60
|
+
this.Timers.set(name, new Date());
|
|
61
|
+
}
|
|
62
|
+
timeEnd(name) {
|
|
63
|
+
if (this.Timers.has(name)) {
|
|
64
|
+
const cTime = new Date();
|
|
65
|
+
const diff = cTime.getTime() - this.Timers.get(name).getTime();
|
|
66
|
+
this.Timers.delete(name);
|
|
67
|
+
return diff;
|
|
68
|
+
}
|
|
69
|
+
return 0;
|
|
70
|
+
}
|
|
71
|
+
resolve() {
|
|
72
|
+
const config = this.Container.get(Configuration);
|
|
73
|
+
if (!config) {
|
|
74
|
+
throw new Error(`Configuration module is not avaible. Please resolve configuration module before any logging can occur`);
|
|
75
|
+
}
|
|
76
|
+
this.Options = config.get("logger", {
|
|
77
|
+
targets: [
|
|
78
|
+
{
|
|
79
|
+
name: "Console",
|
|
80
|
+
type: "ConsoleTarget",
|
|
81
|
+
},
|
|
82
|
+
],
|
|
83
|
+
rules: [{ name: "*", level: "trace", target: "Console" }],
|
|
84
|
+
});
|
|
85
|
+
this.matchRulesToLogger();
|
|
86
|
+
this.resolveLogTargets();
|
|
87
|
+
super.resolve();
|
|
88
|
+
Log_1.Loggers.set(this.Name, this);
|
|
89
|
+
}
|
|
90
|
+
trace(err, message, ...args) {
|
|
91
|
+
wrapWrite.apply(this, [LogLevel.Trace])(err, message, ...args);
|
|
92
|
+
}
|
|
93
|
+
debug(err, message, ...args) {
|
|
94
|
+
wrapWrite.apply(this, [LogLevel.Debug])(err, message, ...args);
|
|
95
|
+
}
|
|
96
|
+
info(err, message, ...args) {
|
|
97
|
+
wrapWrite.apply(this, [LogLevel.Info])(err, message, ...args);
|
|
98
|
+
}
|
|
99
|
+
warn(err, message, ...args) {
|
|
100
|
+
wrapWrite.apply(this, [LogLevel.Warn])(err, message, ...args);
|
|
101
|
+
}
|
|
102
|
+
error(err, message, ...args) {
|
|
103
|
+
wrapWrite.apply(this, [LogLevel.Error])(err, message, ...args);
|
|
104
|
+
}
|
|
105
|
+
fatal(err, message, ...args) {
|
|
106
|
+
wrapWrite.apply(this, [LogLevel.Fatal])(err, message, ...args);
|
|
107
|
+
}
|
|
108
|
+
security(err, message, ...args) {
|
|
109
|
+
wrapWrite.apply(this, [LogLevel.Security])(err, message, ...args);
|
|
110
|
+
}
|
|
111
|
+
success(err, message, ...args) {
|
|
112
|
+
wrapWrite.apply(this, [LogLevel.Success])(err, message, ...args);
|
|
113
|
+
}
|
|
114
|
+
write(entry) {
|
|
115
|
+
if (entry.Variables.logger === this.Name) {
|
|
116
|
+
return Promise.allSettled(this.Targets.filter((t) => entry.Level >= StrToLogLevel[t.rule.level]).map((t) => {
|
|
117
|
+
if (!t.instance) {
|
|
118
|
+
throw new InvalidOperation(`Target for rule ${t.rule.name} not exists`);
|
|
119
|
+
}
|
|
120
|
+
return t.instance.write(entry);
|
|
121
|
+
}));
|
|
122
|
+
}
|
|
123
|
+
}
|
|
124
|
+
child(name, variables) {
|
|
125
|
+
return DI.resolve(Log_1, [
|
|
126
|
+
`${this.Name}.${name}`,
|
|
127
|
+
{
|
|
128
|
+
...this.Variables,
|
|
129
|
+
...variables,
|
|
130
|
+
},
|
|
131
|
+
this,
|
|
132
|
+
]);
|
|
133
|
+
}
|
|
134
|
+
resolveLogTargets() {
|
|
135
|
+
this.Targets = this.Rules.map((r) => {
|
|
136
|
+
const found = this.Options.targets.filter((t) => {
|
|
137
|
+
return Array.isArray(r.target)
|
|
138
|
+
? r.target.includes(t.name)
|
|
139
|
+
: r.target === t.name;
|
|
140
|
+
});
|
|
141
|
+
if (!found) {
|
|
142
|
+
throw new InvalidOption(`No target matching rule ${r.name}`);
|
|
143
|
+
}
|
|
144
|
+
return found.map((f) => {
|
|
145
|
+
return {
|
|
146
|
+
instance: DI.resolve(f.type, [f]),
|
|
147
|
+
options: f,
|
|
148
|
+
rule: r,
|
|
149
|
+
};
|
|
150
|
+
});
|
|
151
|
+
}).reduce((prev, curr) => prev.concat(...curr), []);
|
|
152
|
+
}
|
|
153
|
+
matchRulesToLogger() {
|
|
154
|
+
this.Rules = this.Options.rules.filter((r) => {
|
|
155
|
+
const g = GlobToRegExp(r.name);
|
|
156
|
+
// BUG: g.test throws vscode err ?
|
|
157
|
+
return g.test(this.Name);
|
|
158
|
+
});
|
|
159
|
+
}
|
|
160
|
+
};
|
|
161
|
+
__decorate([
|
|
162
|
+
Autoinject(),
|
|
163
|
+
__metadata("design:type", Container)
|
|
164
|
+
], Log.prototype, "Container", void 0);
|
|
165
|
+
Log = Log_1 = __decorate([
|
|
166
|
+
NewInstance(),
|
|
167
|
+
__metadata("design:paramtypes", [String, Object, Log])
|
|
168
|
+
], Log);
|
|
169
|
+
export { Log };
|
|
170
|
+
const logFactoryFunction = (container, logName) => {
|
|
171
|
+
if (Log.Loggers.has(logName)) {
|
|
172
|
+
return Log.Loggers.get(logName);
|
|
173
|
+
}
|
|
174
|
+
if (!DI.has(Configuration)) {
|
|
175
|
+
if (Log.InternalLoggers.has(logName)) {
|
|
176
|
+
return Log.InternalLoggers.get(logName);
|
|
177
|
+
}
|
|
178
|
+
const internalLogger = container.resolve(InternalLoggerProxy, [logName]);
|
|
179
|
+
Log.InternalLoggers.set(logName, this);
|
|
180
|
+
return internalLogger;
|
|
181
|
+
}
|
|
182
|
+
return container.resolve("__logImplementation__", [logName]);
|
|
183
|
+
};
|
|
184
|
+
// register as string identifier to allow for
|
|
185
|
+
// resolving logs without referencing class
|
|
186
|
+
// to avoid circular dependencies in some @spinajs packages
|
|
187
|
+
// it should not be used in production code
|
|
188
|
+
DI.register(logFactoryFunction).as("__log__");
|
|
189
|
+
// register log factory function as Log class
|
|
190
|
+
// this way we can create or return already created
|
|
191
|
+
// log objects
|
|
192
|
+
DI.register(logFactoryFunction).as(Log);
|
|
193
|
+
// register Log class as string literal
|
|
194
|
+
// so we can resolve Log class
|
|
195
|
+
// it should not be used in production code
|
|
196
|
+
DI.register(Log).as("__logImplementation__");
|
|
197
|
+
//# sourceMappingURL=log.js.map
|
package/lib/log.js.map
ADDED
|
@@ -0,0 +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,UAAU,EACV,SAAS,EACT,EAAE,EAEF,WAAW,EACX,WAAW,GACZ,MAAM,aAAa,CAAC;AACrB,OAAO,EAEL,QAAQ,EAIR,aAAa,EAEb,sBAAsB,GAIvB,MAAM,qBAAqB,CAAC;AAC7B,OAAO,YAAY,MAAM,gBAAgB,CAAC;AAC1C,OAAO,EAAE,gBAAgB,EAAE,aAAa,EAAE,MAAM,+BAA+B,CAAC;AAChF,OAAO,EAAE,mBAAmB,EAAE,MAAM,0BAA0B,CAAC;AAE/D,SAAS,SAAS,CAAY,KAAe;IAC3C,OAAO,CAAC,GAAmB,EAAE,OAAuB,EAAE,GAAG,IAAW,EA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AAG,CAAC,CAAC,EAAE,CAAC,uBAAuB,CAAC,CAAC"}
|
|
@@ -0,0 +1,88 @@
|
|
|
1
|
+
declare const CONFIGURATION_SCHEMA: {
|
|
2
|
+
$id: string;
|
|
3
|
+
$configurationModule: string;
|
|
4
|
+
description: string;
|
|
5
|
+
type: string;
|
|
6
|
+
properties: {
|
|
7
|
+
targets: {
|
|
8
|
+
description: string;
|
|
9
|
+
type: string;
|
|
10
|
+
minItems: number;
|
|
11
|
+
uniqueItems: boolean;
|
|
12
|
+
items: {
|
|
13
|
+
type: string;
|
|
14
|
+
properties: {
|
|
15
|
+
layout: {
|
|
16
|
+
type: string;
|
|
17
|
+
};
|
|
18
|
+
name: {
|
|
19
|
+
type: string;
|
|
20
|
+
};
|
|
21
|
+
type: {
|
|
22
|
+
type: string;
|
|
23
|
+
};
|
|
24
|
+
enabled: {
|
|
25
|
+
type: string;
|
|
26
|
+
};
|
|
27
|
+
path: {
|
|
28
|
+
type: string;
|
|
29
|
+
};
|
|
30
|
+
archivePath: {
|
|
31
|
+
type: string;
|
|
32
|
+
};
|
|
33
|
+
maxSize: {
|
|
34
|
+
type: string;
|
|
35
|
+
minimum: number;
|
|
36
|
+
};
|
|
37
|
+
compress: {
|
|
38
|
+
type: string;
|
|
39
|
+
};
|
|
40
|
+
rotate: {
|
|
41
|
+
type: string;
|
|
42
|
+
};
|
|
43
|
+
maxArchiveFiles: {
|
|
44
|
+
type: string;
|
|
45
|
+
minimum: number;
|
|
46
|
+
};
|
|
47
|
+
bufferSize: {
|
|
48
|
+
type: string;
|
|
49
|
+
minimum: number;
|
|
50
|
+
};
|
|
51
|
+
};
|
|
52
|
+
required: string[];
|
|
53
|
+
};
|
|
54
|
+
};
|
|
55
|
+
rules: {
|
|
56
|
+
description: string;
|
|
57
|
+
type: string;
|
|
58
|
+
minItems: number;
|
|
59
|
+
uniqueItems: boolean;
|
|
60
|
+
items: {
|
|
61
|
+
type: string;
|
|
62
|
+
properties: {
|
|
63
|
+
name: {
|
|
64
|
+
type: string;
|
|
65
|
+
};
|
|
66
|
+
level: {
|
|
67
|
+
type: string;
|
|
68
|
+
enum: string[];
|
|
69
|
+
};
|
|
70
|
+
target: {
|
|
71
|
+
oneOf: ({
|
|
72
|
+
type: string;
|
|
73
|
+
items?: undefined;
|
|
74
|
+
} | {
|
|
75
|
+
type: string;
|
|
76
|
+
items: {
|
|
77
|
+
type: string;
|
|
78
|
+
};
|
|
79
|
+
})[];
|
|
80
|
+
};
|
|
81
|
+
};
|
|
82
|
+
required: string[];
|
|
83
|
+
};
|
|
84
|
+
};
|
|
85
|
+
};
|
|
86
|
+
};
|
|
87
|
+
export default CONFIGURATION_SCHEMA;
|
|
88
|
+
//# sourceMappingURL=log.configuration.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"log.configuration.d.ts","sourceRoot":"","sources":["../../src/schemas/log.configuration.ts"],"names":[],"mappings":"AAAA,QAAA,MAAM,oBAAoB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAiGzB,CAAC;AAEF,eAAe,oBAAoB,CAAC"}
|
|
@@ -0,0 +1,99 @@
|
|
|
1
|
+
const CONFIGURATION_SCHEMA = {
|
|
2
|
+
$id: "spinajs/log.configuration.schema.json",
|
|
3
|
+
$configurationModule: "logger",
|
|
4
|
+
description: "Logger configuration option validation",
|
|
5
|
+
type: "object",
|
|
6
|
+
properties: {
|
|
7
|
+
targets: {
|
|
8
|
+
description: "Log target, where log messages should be written to, and their options",
|
|
9
|
+
type: "array",
|
|
10
|
+
minItems: 1,
|
|
11
|
+
uniqueItems: true,
|
|
12
|
+
items: {
|
|
13
|
+
type: "object",
|
|
14
|
+
properties: {
|
|
15
|
+
layout: {
|
|
16
|
+
type: "string",
|
|
17
|
+
},
|
|
18
|
+
name: {
|
|
19
|
+
type: "string",
|
|
20
|
+
},
|
|
21
|
+
type: {
|
|
22
|
+
type: "string",
|
|
23
|
+
},
|
|
24
|
+
enabled: {
|
|
25
|
+
type: "boolean",
|
|
26
|
+
},
|
|
27
|
+
path: {
|
|
28
|
+
type: "string",
|
|
29
|
+
},
|
|
30
|
+
archivePath: {
|
|
31
|
+
type: "string",
|
|
32
|
+
},
|
|
33
|
+
maxSize: {
|
|
34
|
+
type: "integer",
|
|
35
|
+
minimum: 10000,
|
|
36
|
+
},
|
|
37
|
+
compress: {
|
|
38
|
+
type: "boolean",
|
|
39
|
+
},
|
|
40
|
+
rotate: {
|
|
41
|
+
type: "string",
|
|
42
|
+
},
|
|
43
|
+
maxArchiveFiles: {
|
|
44
|
+
type: "integer",
|
|
45
|
+
minimum: 1,
|
|
46
|
+
},
|
|
47
|
+
bufferSize: {
|
|
48
|
+
type: "integer",
|
|
49
|
+
minimum: 1000,
|
|
50
|
+
},
|
|
51
|
+
},
|
|
52
|
+
required: ["name", "type"],
|
|
53
|
+
},
|
|
54
|
+
},
|
|
55
|
+
rules: {
|
|
56
|
+
description: "Log rules, what log should be write where",
|
|
57
|
+
type: "array",
|
|
58
|
+
minItems: 1,
|
|
59
|
+
uniqueItems: true,
|
|
60
|
+
items: {
|
|
61
|
+
type: "object",
|
|
62
|
+
properties: {
|
|
63
|
+
name: {
|
|
64
|
+
type: "string",
|
|
65
|
+
},
|
|
66
|
+
level: {
|
|
67
|
+
type: "string",
|
|
68
|
+
enum: [
|
|
69
|
+
"trace",
|
|
70
|
+
"debug",
|
|
71
|
+
"warn",
|
|
72
|
+
"info",
|
|
73
|
+
"error",
|
|
74
|
+
"fatal",
|
|
75
|
+
"security",
|
|
76
|
+
"success",
|
|
77
|
+
],
|
|
78
|
+
},
|
|
79
|
+
target: {
|
|
80
|
+
oneOf: [
|
|
81
|
+
{
|
|
82
|
+
type: "string",
|
|
83
|
+
},
|
|
84
|
+
{
|
|
85
|
+
type: "array",
|
|
86
|
+
items: {
|
|
87
|
+
type: "string",
|
|
88
|
+
},
|
|
89
|
+
},
|
|
90
|
+
],
|
|
91
|
+
},
|
|
92
|
+
},
|
|
93
|
+
required: ["name", "level", "target"],
|
|
94
|
+
},
|
|
95
|
+
},
|
|
96
|
+
},
|
|
97
|
+
};
|
|
98
|
+
export default CONFIGURATION_SCHEMA;
|
|
99
|
+
//# sourceMappingURL=log.configuration.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"log.configuration.js","sourceRoot":"","sources":["../../src/schemas/log.configuration.ts"],"names":[],"mappings":"AAAA,MAAM,oBAAoB,GAAG;IAC3B,GAAG,EAAE,uCAAuC;IAC5C,oBAAoB,EAAE,QAAQ;IAC9B,WAAW,EAAE,wCAAwC;IACrD,IAAI,EAAE,QAAQ;IACd,UAAU,EAAE;QACV,OAAO,EAAE;YACP,WAAW,EACT,wEAAwE;YAC1E,IAAI,EAAE,OAAO;YACb,QAAQ,EAAE,CAAC;YACX,WAAW,EAAE,IAAI;YACjB,KAAK,EAAE;gBACL,IAAI,EAAE,QAAQ;gBACd,UAAU,EAAE;oBACV,MAAM,EAAE;wBACN,IAAI,EAAE,QAAQ;qBACf;oBACD,IAAI,EAAE;wBACJ,IAAI,EAAE,QAAQ;qBACf;oBACD,IAAI,EAAE;wBACJ,IAAI,EAAE,QAAQ;qBACf;oBACD,OAAO,EAAE;wBACP,IAAI,EAAE,SAAS;qBAChB;oBACD,IAAI,EAAE;wBACJ,IAAI,EAAE,QAAQ;qBACf;oBACD,WAAW,EAAE;wBACX,IAAI,EAAE,QAAQ;qBACf;oBACD,OAAO,EAAE;wBACP,IAAI,EAAE,SAAS;wBACf,OAAO,EAAE,KAAK;qBACf;oBACD,QAAQ,EAAE;wBACR,IAAI,EAAE,SAAS;qBAChB;oBACD,MAAM,EAAE;wBACN,IAAI,EAAE,QAAQ;qBACf;oBACD,eAAe,EAAE;wBACf,IAAI,EAAE,SAAS;wBACf,OAAO,EAAE,CAAC;qBACX;oBACD,UAAU,EAAE;wBACV,IAAI,EAAE,SAAS;wBACf,OAAO,EAAE,IAAI;qBACd;iBACF;gBACD,QAAQ,EAAE,CAAC,MAAM,EAAE,MAAM,CAAC;aAC3B;SACF;QACD,KAAK,EAAE;YACL,WAAW,EAAE,2CAA2C;YACxD,IAAI,EAAE,OAAO;YACb,QAAQ,EAAE,CAAC;YACX,WAAW,EAAE,IAAI;YACjB,KAAK,EAAE;gBACL,IAAI,EAAE,QAAQ;gBACd,UAAU,EAAE;oBACV,IAAI,EAAE;wBACJ,IAAI,EAAE,QAAQ;qBACf;oBACD,KAAK,EAAE;wBACL,IAAI,EAAE,QAAQ;wBACd,IAAI,EAAE;4BACJ,OAAO;4BACP,OAAO;4BACP,MAAM;4BACN,MAAM;4BACN,OAAO;4BACP,OAAO;4BACP,UAAU;4BACV,SAAS;yBACV;qBACF;oBACD,MAAM,EAAE;wBACN,KAAK,EAAE;4BACL;gCACE,IAAI,EAAE,QAAQ;6BACf;4BACD;gCACE,IAAI,EAAE,OAAO;gCACb,KAAK,EAAE;oCACL,IAAI,EAAE,QAAQ;iCACf;6BACF;yBACF;qBACF;iBACF;gBACD,QAAQ,EAAE,CAAC,MAAM,EAAE,OAAO,EAAE,QAAQ,CAAC;aACtC;SACF;KACF;CACF,CAAC;AAEF,eAAe,oBAAoB,CAAC"}
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { ICommonTargetOptions, LogTarget } from "@spinajs/log-common";
|
|
2
|
+
/**
|
|
3
|
+
* Empty writer, usefull for tests or when we dont want to get any messages
|
|
4
|
+
*/
|
|
5
|
+
export declare class BlackHoleTarget extends LogTarget<ICommonTargetOptions> {
|
|
6
|
+
write(): Promise<void>;
|
|
7
|
+
}
|
|
8
|
+
//# sourceMappingURL=BlackHoleTarget.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"BlackHoleTarget.d.ts","sourceRoot":"","sources":["../../src/targets/BlackHoleTarget.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,oBAAoB,EAAE,SAAS,EAAE,MAAM,qBAAqB,CAAC;AAGtE;;GAEG;AACH,qBAEa,eAAgB,SAAQ,SAAS,CAAC,oBAAoB,CAAC;IACrD,KAAK,IAAI,OAAO,CAAC,IAAI,CAAC;CAGpC"}
|
|
@@ -0,0 +1,22 @@
|
|
|
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 { LogTarget } from "@spinajs/log-common";
|
|
8
|
+
import { Injectable, Singleton } from "@spinajs/di";
|
|
9
|
+
/**
|
|
10
|
+
* Empty writer, usefull for tests or when we dont want to get any messages
|
|
11
|
+
*/
|
|
12
|
+
let BlackHoleTarget = class BlackHoleTarget extends LogTarget {
|
|
13
|
+
async write() {
|
|
14
|
+
return;
|
|
15
|
+
}
|
|
16
|
+
};
|
|
17
|
+
BlackHoleTarget = __decorate([
|
|
18
|
+
Singleton(),
|
|
19
|
+
Injectable("BlackHoleTarget")
|
|
20
|
+
], BlackHoleTarget);
|
|
21
|
+
export { BlackHoleTarget };
|
|
22
|
+
//# sourceMappingURL=BlackHoleTarget.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"BlackHoleTarget.js","sourceRoot":"","sources":["../../src/targets/BlackHoleTarget.ts"],"names":[],"mappings":";;;;;;AAAA,OAAO,EAAwB,SAAS,EAAE,MAAM,qBAAqB,CAAC;AACtE,OAAO,EAAE,UAAU,EAAE,SAAS,EAAE,MAAM,aAAa,CAAC;AAEpD;;GAEG;AAGI,IAAM,eAAe,GAArB,MAAM,eAAgB,SAAQ,SAA+B;IAC3D,KAAK,CAAC,KAAK;QAChB,OAAO;IACT,CAAC;CACF,CAAA;AAJY,eAAe;IAF3B,SAAS,EAAE;IACX,UAAU,CAAC,iBAAiB,CAAC;GACjB,eAAe,CAI3B;SAJY,eAAe"}
|
|
@@ -0,0 +1,51 @@
|
|
|
1
|
+
import { IColoredConsoleTargetOptions, ILogEntry, LogTarget } from "@spinajs/log-common";
|
|
2
|
+
export declare const DEFAULT_THEME: {
|
|
3
|
+
security: string[];
|
|
4
|
+
fatal: string;
|
|
5
|
+
error: string;
|
|
6
|
+
warn: string;
|
|
7
|
+
success: string;
|
|
8
|
+
info: string;
|
|
9
|
+
debug: string;
|
|
10
|
+
trace: string;
|
|
11
|
+
};
|
|
12
|
+
export declare class ColoredConsoleTarget extends LogTarget<IColoredConsoleTargetOptions> {
|
|
13
|
+
protected theme: any[];
|
|
14
|
+
protected StdConsoleCallbackMap: {
|
|
15
|
+
5: {
|
|
16
|
+
(...data: any[]): void;
|
|
17
|
+
(message?: any, ...optionalParams: any[]): void;
|
|
18
|
+
};
|
|
19
|
+
6: {
|
|
20
|
+
(...data: any[]): void;
|
|
21
|
+
(message?: any, ...optionalParams: any[]): void;
|
|
22
|
+
};
|
|
23
|
+
999: {
|
|
24
|
+
(...data: any[]): void;
|
|
25
|
+
(message?: any, ...optionalParams: any[]): void;
|
|
26
|
+
};
|
|
27
|
+
2: {
|
|
28
|
+
(...data: any[]): void;
|
|
29
|
+
(message?: any, ...optionalParams: any[]): void;
|
|
30
|
+
};
|
|
31
|
+
3: {
|
|
32
|
+
(...data: any[]): void;
|
|
33
|
+
(message?: any, ...optionalParams: any[]): void;
|
|
34
|
+
};
|
|
35
|
+
0: {
|
|
36
|
+
(...data: any[]): void;
|
|
37
|
+
(message?: any, ...optionalParams: any[]): void;
|
|
38
|
+
};
|
|
39
|
+
1: {
|
|
40
|
+
(...data: any[]): void;
|
|
41
|
+
(message?: any, ...optionalParams: any[]): void;
|
|
42
|
+
};
|
|
43
|
+
4: {
|
|
44
|
+
(...data: any[]): void;
|
|
45
|
+
(message?: any, ...optionalParams: any[]): void;
|
|
46
|
+
};
|
|
47
|
+
};
|
|
48
|
+
resolve(): Promise<void>;
|
|
49
|
+
write(data: ILogEntry): Promise<void>;
|
|
50
|
+
}
|
|
51
|
+
//# sourceMappingURL=ColoredConsoleTarget.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ColoredConsoleTarget.d.ts","sourceRoot":"","sources":["../../src/targets/ColoredConsoleTarget.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,4BAA4B,EAC5B,SAAS,EACT,SAAS,EACV,MAAM,qBAAqB,CAAC;AAM7B,eAAO,MAAM,aAAa;;;;;;;;;CASzB,CAAC;AAEF,qBAEa,oBAAqB,SAAQ,SAAS,CAAC,4BAA4B,CAAC;IAC/E,SAAS,CAAC,KAAK,EAAE,GAAG,EAAE,CAAM;IAE5B,SAAS,CAAC,qBAAqB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;MAY7B;IAEW,OAAO;IAaP,KAAK,CAAC,IAAI,EAAE,SAAS,GAAG,OAAO,CAAC,IAAI,CAAC;CAenD"}
|
|
@@ -0,0 +1,65 @@
|
|
|
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 { LogTarget, } from "@spinajs/log-common";
|
|
8
|
+
import { Injectable, Singleton } from "@spinajs/di";
|
|
9
|
+
import { LogLevel } from "./../index.js";
|
|
10
|
+
import chalk from "chalk";
|
|
11
|
+
import { format } from "@spinajs/configuration";
|
|
12
|
+
export const DEFAULT_THEME = {
|
|
13
|
+
security: ["red", "bgBrightWhite"],
|
|
14
|
+
fatal: "red",
|
|
15
|
+
error: "brightRed",
|
|
16
|
+
warn: "yellow",
|
|
17
|
+
success: "green",
|
|
18
|
+
info: "white",
|
|
19
|
+
debug: "gray",
|
|
20
|
+
trace: "gray",
|
|
21
|
+
};
|
|
22
|
+
let ColoredConsoleTarget = class ColoredConsoleTarget extends LogTarget {
|
|
23
|
+
constructor() {
|
|
24
|
+
super(...arguments);
|
|
25
|
+
this.theme = [];
|
|
26
|
+
this.StdConsoleCallbackMap = {
|
|
27
|
+
[LogLevel.Error]: console.error,
|
|
28
|
+
[LogLevel.Fatal]: console.error,
|
|
29
|
+
[LogLevel.Security]: console.error,
|
|
30
|
+
[LogLevel.Info]: console.log,
|
|
31
|
+
[LogLevel.Success]: console.log,
|
|
32
|
+
[LogLevel.Trace]: console.debug,
|
|
33
|
+
[LogLevel.Debug]: console.debug,
|
|
34
|
+
[LogLevel.Warn]: console.warn,
|
|
35
|
+
};
|
|
36
|
+
}
|
|
37
|
+
async resolve() {
|
|
38
|
+
this.theme[LogLevel.Trace] = chalk.gray;
|
|
39
|
+
this.theme[LogLevel.Debug] = chalk.gray;
|
|
40
|
+
this.theme[LogLevel.Info] = chalk.white;
|
|
41
|
+
this.theme[LogLevel.Success] = chalk.white.bgGreen;
|
|
42
|
+
this.theme[LogLevel.Warn] = chalk.yellow;
|
|
43
|
+
this.theme[LogLevel.Error] = chalk.red;
|
|
44
|
+
this.theme[LogLevel.Fatal] = chalk.white.bgRed;
|
|
45
|
+
this.theme[LogLevel.Security] = chalk.yellow.bgRed;
|
|
46
|
+
super.resolve();
|
|
47
|
+
}
|
|
48
|
+
async write(data) {
|
|
49
|
+
if (!this.Options.enabled) {
|
|
50
|
+
return;
|
|
51
|
+
}
|
|
52
|
+
this.StdConsoleCallbackMap[data.Level](
|
|
53
|
+
/**
|
|
54
|
+
* we are safe to call, disable eslint
|
|
55
|
+
*/
|
|
56
|
+
/* eslint-disable */
|
|
57
|
+
this.theme[data.Level](format(data.Variables, this.Options.layout)));
|
|
58
|
+
}
|
|
59
|
+
};
|
|
60
|
+
ColoredConsoleTarget = __decorate([
|
|
61
|
+
Singleton(),
|
|
62
|
+
Injectable("ConsoleTarget")
|
|
63
|
+
], ColoredConsoleTarget);
|
|
64
|
+
export { ColoredConsoleTarget };
|
|
65
|
+
//# sourceMappingURL=ColoredConsoleTarget.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ColoredConsoleTarget.js","sourceRoot":"","sources":["../../src/targets/ColoredConsoleTarget.ts"],"names":[],"mappings":";;;;;;AAAA,OAAO,EAGL,SAAS,GACV,MAAM,qBAAqB,CAAC;AAC7B,OAAO,EAAE,UAAU,EAAE,SAAS,EAAE,MAAM,aAAa,CAAC;AACpD,OAAO,EAAE,QAAQ,EAAE,MAAM,eAAe,CAAC;AACzC,OAAO,KAAK,MAAM,OAAO,CAAC;AAC1B,OAAO,EAAE,MAAM,EAAE,MAAM,wBAAwB,CAAC;AAEhD,MAAM,CAAC,MAAM,aAAa,GAAG;IAC3B,QAAQ,EAAE,CAAC,KAAK,EAAE,eAAe,CAAC;IAClC,KAAK,EAAE,KAAK;IACZ,KAAK,EAAE,WAAW;IAClB,IAAI,EAAE,QAAQ;IACd,OAAO,EAAE,OAAO;IAChB,IAAI,EAAE,OAAO;IACb,KAAK,EAAE,MAAM;IACb,KAAK,EAAE,MAAM;CACd,CAAC;AAIK,IAAM,oBAAoB,GAA1B,MAAM,oBAAqB,SAAQ,SAAuC;IAA1E;;QACK,UAAK,GAAU,EAAE,CAAC;QAElB,0BAAqB,GAAG;YAChC,CAAC,QAAQ,CAAC,KAAK,CAAC,EAAE,OAAO,CAAC,KAAK;YAC/B,CAAC,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CAAC;IAClB,CAAC;IAEM,KAAK,CAAC,KAAK,CAAC,IAAe;QAChC,IAAI,CAAC,IAAI,CAAC,OAAO,CAAC,OAAO,EAAE;YACzB,OAAO;SACR;QAED,IAAI,CAAC,qBAAqB,CAAC,IAAI,CAAC,KAAK,CAAC;QACpC;;WAEG;QACH,oBAAoB;QACnB,IAAI,CAAC,KAAa,CAAC,IAAI,CAAC,KAAK,CAAC,CAC7B,MAAM,CAAC,IAAI,CAAC,SAAS,EAAE,IAAI,CAAC,OAAO,CAAC,MAAM,CAAC,CAC5C,CACF,CAAC;IACJ,CAAC;CACF,CAAA;AA7CY,oBAAoB;IAFhC,SAAS,EAAE;IACX,UAAU,CAAC,eAAe,CAAC;GACf,oBAAoB,CA6ChC;SA7CY,oBAAoB"}
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
/// <reference types="node" resolution-mode="require"/>
|
|
2
|
+
/// <reference types="node" resolution-mode="require"/>
|
|
3
|
+
import { IInstanceCheck } from "@spinajs/di";
|
|
4
|
+
import { IFileTargetOptions, ILog, ILogEntry, LogTarget } from "@spinajs/log-common";
|
|
5
|
+
import * as fs from "fs";
|
|
6
|
+
import "@spinajs/configuration-common";
|
|
7
|
+
declare enum FileTargetStatus {
|
|
8
|
+
WRITTING = 0,
|
|
9
|
+
PENDING = 1,
|
|
10
|
+
IDLE = 2
|
|
11
|
+
}
|
|
12
|
+
export declare class FileTarget extends LogTarget<IFileTargetOptions> implements IInstanceCheck {
|
|
13
|
+
protected Log: ILog;
|
|
14
|
+
LogDirPath: string;
|
|
15
|
+
ArchiveDirPath: string;
|
|
16
|
+
protected WriteStream: fs.WriteStream;
|
|
17
|
+
protected Buffer: string[];
|
|
18
|
+
protected ArchiveTimer: NodeJS.Timer;
|
|
19
|
+
protected FlushTimer: NodeJS.Timer;
|
|
20
|
+
protected Status: FileTargetStatus;
|
|
21
|
+
protected ArchiveStatus: FileTargetStatus;
|
|
22
|
+
__checkInstance__(creationOptions: IFileTargetOptions): boolean;
|
|
23
|
+
resolve(): void;
|
|
24
|
+
protected flush(): void;
|
|
25
|
+
dispose(): Promise<void>;
|
|
26
|
+
write(data: ILogEntry): Promise<void>;
|
|
27
|
+
protected archive(): void;
|
|
28
|
+
}
|
|
29
|
+
export {};
|
|
30
|
+
//# sourceMappingURL=FileTarget.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"FileTarget.d.ts","sourceRoot":"","sources":["../../src/targets/FileTarget.ts"],"names":[],"mappings":";;AAGA,OAAO,EAAE,cAAc,EAAgC,MAAM,aAAa,CAAC;AAC3E,OAAO,EACL,kBAAkB,EAClB,IAAI,EACJ,SAAS,EACT,SAAS,EACV,MAAM,qBAAqB,CAAC;AAC7B,OAAO,KAAK,EAAE,MAAM,IAAI,CAAC;AAQzB,OAAO,+BAA+B,CAAC;AAEvC,aAAK,gBAAgB;IACnB,QAAQ,IAAA;IACR,OAAO,IAAA;IACP,IAAI,IAAA;CACL;AAID,qBAEa,UACX,SAAQ,SAAS,CAAC,kBAAkB,CACpC,YAAW,cAAc;IAGzB,SAAS,CAAC,GAAG,EAAE,IAAI,CAAC;IAEb,UAAU,EAAE,MAAM,CAAC;IACnB,cAAc,EAAE,MAAM,CAAC;IAE9B,SAAS,CAAC,WAAW,EAAE,EAAE,CAAC,WAAW,CAAC;IACtC,SAAS,CAAC,MAAM,EAAE,MAAM,EAAE,CAAM;IAEhC,SAAS,CAAC,YAAY,EAAE,MAAM,CAAC,KAAK,CAAC;IACrC,SAAS,CAAC,UAAU,EAAE,MAAM,CAAC,KAAK,CAAC;IAEnC,SAAS,CAAC,MAAM,EAAE,gBAAgB,CAAyB;IAC3D,SAAS,CAAC,aAAa,EAAE,gBAAgB,CAAyB;IAElE,iBAAiB,CAAC,eAAe,EAAE,kBAAkB,GAAG,OAAO;IAIxD,OAAO;IAsEd,SAAS,CAAC,KAAK;IAkCF,OAAO;IAWP,KAAK,CAAC,IAAI,EAAE,SAAS;IA4BlC,SAAS,CAAC,OAAO;CA2HlB"}
|
|
@@ -0,0 +1,232 @@
|
|
|
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 security/detect-object-injection */
|
|
11
|
+
import { EOL } from "os";
|
|
12
|
+
/* eslint security/detect-non-literal-fs-filename:0 -- Safe as no value holds user input */
|
|
13
|
+
import { Injectable, PerInstanceCheck } from "@spinajs/di";
|
|
14
|
+
import { LogTarget, } from "@spinajs/log-common";
|
|
15
|
+
import * as fs from "fs";
|
|
16
|
+
import * as path from "path";
|
|
17
|
+
import { InvalidOption } from "../../../exceptions/lib/index.js";
|
|
18
|
+
import * as glob from "glob";
|
|
19
|
+
import * as zlib from "zlib";
|
|
20
|
+
import { format } from "@spinajs/configuration";
|
|
21
|
+
import { pipeline } from "stream";
|
|
22
|
+
import { Logger } from "./../decorators.js";
|
|
23
|
+
import "@spinajs/configuration-common";
|
|
24
|
+
var FileTargetStatus;
|
|
25
|
+
(function (FileTargetStatus) {
|
|
26
|
+
FileTargetStatus[FileTargetStatus["WRITTING"] = 0] = "WRITTING";
|
|
27
|
+
FileTargetStatus[FileTargetStatus["PENDING"] = 1] = "PENDING";
|
|
28
|
+
FileTargetStatus[FileTargetStatus["IDLE"] = 2] = "IDLE";
|
|
29
|
+
})(FileTargetStatus || (FileTargetStatus = {}));
|
|
30
|
+
// we mark per instance check becouse we can have multiple file targes
|
|
31
|
+
// for different files/paths/logs but we dont want to create every time writer for same.
|
|
32
|
+
let FileTarget = class FileTarget extends LogTarget {
|
|
33
|
+
constructor() {
|
|
34
|
+
super(...arguments);
|
|
35
|
+
this.Buffer = [];
|
|
36
|
+
this.Status = FileTargetStatus.IDLE;
|
|
37
|
+
this.ArchiveStatus = FileTargetStatus.IDLE;
|
|
38
|
+
}
|
|
39
|
+
__checkInstance__(creationOptions) {
|
|
40
|
+
return this.Options.name === creationOptions.name;
|
|
41
|
+
}
|
|
42
|
+
resolve() {
|
|
43
|
+
this.Options.options = Object.assign({
|
|
44
|
+
compress: true,
|
|
45
|
+
maxSize: 1024 * 1024,
|
|
46
|
+
maxArchiveFiles: 5,
|
|
47
|
+
archiveInterval: 3 * 60,
|
|
48
|
+
}, this.Options.options);
|
|
49
|
+
this.LogDirPath = path.dirname(path.resolve(format(null, this.Options.options.path)));
|
|
50
|
+
this.ArchiveDirPath = this.Options.options.archivePath
|
|
51
|
+
? path.resolve(format(null, this.Options.options.archivePath))
|
|
52
|
+
: this.LogDirPath;
|
|
53
|
+
if (!this.LogDirPath) {
|
|
54
|
+
throw new InvalidOption("Missing LogDirPath log option");
|
|
55
|
+
}
|
|
56
|
+
if (!fs.existsSync(this.LogDirPath)) {
|
|
57
|
+
fs.mkdirSync(this.LogDirPath);
|
|
58
|
+
}
|
|
59
|
+
if (this.ArchiveDirPath) {
|
|
60
|
+
if (!fs.existsSync(this.ArchiveDirPath)) {
|
|
61
|
+
fs.mkdirSync(this.ArchiveDirPath);
|
|
62
|
+
}
|
|
63
|
+
}
|
|
64
|
+
// flush all buffered messages at least once per second
|
|
65
|
+
// we do this, becouse buffer can not be filled
|
|
66
|
+
// and we could wait unknown amount of time before messages are written to file
|
|
67
|
+
this.FlushTimer = setInterval(() => {
|
|
68
|
+
// do not flush, if we already writting to file
|
|
69
|
+
if (this.Status !== FileTargetStatus.IDLE &&
|
|
70
|
+
this.ArchiveStatus !== FileTargetStatus.IDLE) {
|
|
71
|
+
return;
|
|
72
|
+
}
|
|
73
|
+
setImmediate(() => {
|
|
74
|
+
this.flush();
|
|
75
|
+
});
|
|
76
|
+
}, 1000);
|
|
77
|
+
// every 3 minutes try to archive log files
|
|
78
|
+
this.ArchiveTimer = setInterval(() => {
|
|
79
|
+
// do not archive if we already doing it
|
|
80
|
+
if (this.Status !== FileTargetStatus.IDLE &&
|
|
81
|
+
this.ArchiveStatus !== FileTargetStatus.IDLE) {
|
|
82
|
+
return;
|
|
83
|
+
}
|
|
84
|
+
this.ArchiveStatus = FileTargetStatus.PENDING;
|
|
85
|
+
// at end of nodejs event loop
|
|
86
|
+
setImmediate(() => {
|
|
87
|
+
this.archive();
|
|
88
|
+
});
|
|
89
|
+
}, this.Options.options.archiveInterval * 1000);
|
|
90
|
+
super.resolve();
|
|
91
|
+
}
|
|
92
|
+
flush() {
|
|
93
|
+
if (this.Buffer.length === 0) {
|
|
94
|
+
this.Status = FileTargetStatus.IDLE;
|
|
95
|
+
return;
|
|
96
|
+
}
|
|
97
|
+
this.Status = FileTargetStatus.WRITTING;
|
|
98
|
+
// we calculate log path every time to allow for
|
|
99
|
+
// dynamic path creation eg. based on timestamp
|
|
100
|
+
const logFileName = format({ logger: this.Options.name }, path.basename(this.Options.options.path));
|
|
101
|
+
const logPath = path.join(this.LogDirPath, logFileName);
|
|
102
|
+
fs.appendFile(logPath, this.Buffer.join(EOL) + EOL, (err) => {
|
|
103
|
+
// log error message to others if applicable eg. console
|
|
104
|
+
if (err) {
|
|
105
|
+
this.Log.error(err, `Cannot write log messages to file target at path ${logPath}`);
|
|
106
|
+
}
|
|
107
|
+
this.Log.trace(`Wrote buffered messages to log file at path ${logPath}, buffer size: ${this.Options.options.maxBufferSize}`);
|
|
108
|
+
this.Buffer = [];
|
|
109
|
+
this.Status = FileTargetStatus.IDLE;
|
|
110
|
+
});
|
|
111
|
+
}
|
|
112
|
+
async dispose() {
|
|
113
|
+
// stop archiving
|
|
114
|
+
clearInterval(this.ArchiveTimer);
|
|
115
|
+
// stop flush timer
|
|
116
|
+
clearInterval(this.FlushTimer);
|
|
117
|
+
// write all messages from buffer
|
|
118
|
+
this.flush();
|
|
119
|
+
}
|
|
120
|
+
async write(data) {
|
|
121
|
+
if (!this.Options.enabled) {
|
|
122
|
+
return;
|
|
123
|
+
}
|
|
124
|
+
const lEntry = format(data.Variables, this.Options.layout);
|
|
125
|
+
this.Buffer.push(lEntry);
|
|
126
|
+
// if we already writting, skip buffer check & write to file
|
|
127
|
+
// wait until write is finished
|
|
128
|
+
if (this.Status !== FileTargetStatus.IDLE ||
|
|
129
|
+
this.ArchiveStatus !== FileTargetStatus.IDLE) {
|
|
130
|
+
return;
|
|
131
|
+
}
|
|
132
|
+
if (this.Buffer.length >= this.Options.options.maxBufferSize) {
|
|
133
|
+
this.Status = FileTargetStatus.PENDING;
|
|
134
|
+
// write at end of nodejs event loop all buffered messages at once
|
|
135
|
+
setImmediate(() => {
|
|
136
|
+
this.flush();
|
|
137
|
+
});
|
|
138
|
+
}
|
|
139
|
+
}
|
|
140
|
+
archive() {
|
|
141
|
+
const { ext } = path.parse(path.basename(this.Options.options.path));
|
|
142
|
+
const aFiles = glob
|
|
143
|
+
.sync(path.join(this.ArchiveDirPath, `archived_*{${ext},.gzip}`))
|
|
144
|
+
.map((f) => {
|
|
145
|
+
return {
|
|
146
|
+
name: f,
|
|
147
|
+
stat: fs.statSync(f),
|
|
148
|
+
};
|
|
149
|
+
})
|
|
150
|
+
.sort((a, b) => a.stat.mtime.getTime() - b.stat.mtime.getTime());
|
|
151
|
+
const lFiles = glob
|
|
152
|
+
.sync(path.join(this.LogDirPath, `*${ext}`))
|
|
153
|
+
.map((f) => {
|
|
154
|
+
return {
|
|
155
|
+
name: f,
|
|
156
|
+
stat: fs.statSync(f),
|
|
157
|
+
};
|
|
158
|
+
})
|
|
159
|
+
.sort((a, b) => a.stat.mtime.getTime() - b.stat.mtime.getTime());
|
|
160
|
+
// clear archived files above limit
|
|
161
|
+
if (aFiles.length > this.Options.options.maxArchiveFiles) {
|
|
162
|
+
for (let i = 0; i < aFiles.length - this.Options.options.maxArchiveFiles; i++) {
|
|
163
|
+
fs.unlink(aFiles[i].name, (err) => {
|
|
164
|
+
if (err) {
|
|
165
|
+
this.Log.error(err, `Cannot delete archived file at path ${aFiles[i - 1].name}`);
|
|
166
|
+
}
|
|
167
|
+
else {
|
|
168
|
+
this.Log.info(`Deleted archived file at path ${aFiles[i].name}`);
|
|
169
|
+
}
|
|
170
|
+
});
|
|
171
|
+
}
|
|
172
|
+
}
|
|
173
|
+
// now move log files that are above limited file size or old
|
|
174
|
+
const filesToArchive = lFiles.filter((x) => {
|
|
175
|
+
return (x.stat.size > this.Options.options.maxSize ||
|
|
176
|
+
lFiles.indexOf(x) <= lFiles.length - 2);
|
|
177
|
+
});
|
|
178
|
+
if (filesToArchive.length === 0) {
|
|
179
|
+
this.ArchiveStatus = FileTargetStatus.IDLE;
|
|
180
|
+
}
|
|
181
|
+
for (let i = 0; i < filesToArchive.length; i++) {
|
|
182
|
+
const { name, ext } = path.parse(path.basename(lFiles[i].name));
|
|
183
|
+
// get number of files with same name, eg. during a day, multiple log files can be produced
|
|
184
|
+
const lArchiFiles = glob.sync(path
|
|
185
|
+
.join(this.ArchiveDirPath, `archived_${name}*{${ext},.gzip}`)
|
|
186
|
+
.replace(/\\/g, "/"));
|
|
187
|
+
const archPath = path.join(this.ArchiveDirPath, `archived_${name}_${lArchiFiles.length + 1}${ext}`);
|
|
188
|
+
fs.rename(lFiles[i].name, archPath, (err) => {
|
|
189
|
+
if (err) {
|
|
190
|
+
this.Log.error(err, `Cannot move log file ${name} to archive at path ${archPath}`);
|
|
191
|
+
return;
|
|
192
|
+
}
|
|
193
|
+
if (this.Options.options.compress) {
|
|
194
|
+
this.Log.trace(`Compressing archive log at path ${archPath}`);
|
|
195
|
+
const zippedPath = path.join(this.ArchiveDirPath, `archived_${name}_${lArchiFiles.length + 1}${ext}.gzip`);
|
|
196
|
+
const zip = zlib.createGzip();
|
|
197
|
+
const read = fs.createReadStream(archPath);
|
|
198
|
+
const write = fs.createWriteStream(zippedPath);
|
|
199
|
+
pipeline(read, zip, write, (err) => {
|
|
200
|
+
if (err) {
|
|
201
|
+
this.Log.error(err, `Cannot compress archived file at path ${archPath}`);
|
|
202
|
+
fs.unlink(zippedPath, () => {
|
|
203
|
+
return;
|
|
204
|
+
});
|
|
205
|
+
return;
|
|
206
|
+
}
|
|
207
|
+
this.Log.info(`Succesyfully compressed archive log at path ${zippedPath}`);
|
|
208
|
+
fs.unlink(archPath, (err) => {
|
|
209
|
+
if (err) {
|
|
210
|
+
this.Log.error(err, `Cannot delete archived log after compression at path ${archPath}`);
|
|
211
|
+
}
|
|
212
|
+
});
|
|
213
|
+
this.ArchiveStatus = FileTargetStatus.IDLE;
|
|
214
|
+
});
|
|
215
|
+
}
|
|
216
|
+
else {
|
|
217
|
+
this.ArchiveStatus = FileTargetStatus.IDLE;
|
|
218
|
+
}
|
|
219
|
+
});
|
|
220
|
+
}
|
|
221
|
+
}
|
|
222
|
+
};
|
|
223
|
+
__decorate([
|
|
224
|
+
Logger("LogFileTarget"),
|
|
225
|
+
__metadata("design:type", Object)
|
|
226
|
+
], FileTarget.prototype, "Log", void 0);
|
|
227
|
+
FileTarget = __decorate([
|
|
228
|
+
PerInstanceCheck(),
|
|
229
|
+
Injectable("FileTarget")
|
|
230
|
+
], FileTarget);
|
|
231
|
+
export { FileTarget };
|
|
232
|
+
//# sourceMappingURL=FileTarget.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"FileTarget.js","sourceRoot":"","sources":["../../src/targets/FileTarget.ts"],"names":[],"mappings":";;;;;;;;;AAAA,qDAAqD;AACrD,OAAO,EAAE,GAAG,EAAE,MAAM,IAAI,CAAC;AACzB,2FAA2F;AAC3F,OAAO,EAAkB,UAAU,EAAE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AO;4BACT,CAAC,CAAC,CAAC;4BAEH,OAAO;yBACR;wBAED,IAAI,CAAC,GAAG,CAAC,IAAI,CACX,+CAA+C,UAAU,EAAE,CAC5D,CAAC;wBAEF,EAAE,CAAC,MAAM,CAAC,QAAQ,EAAE,CAAC,GAAG,EAAE,EAAE;4BAC1B,IAAI,GAAG,EAAE;gCACP,IAAI,CAAC,GAAG,CAAC,KAAK,CACZ,GAAG,EACH,wDAAwD,QAAQ,EAAE,CACnE,CAAC;6BACH;wBACH,CAAC,CAAC,CAAC;wBAEH,IAAI,CAAC,aAAa,GAAG,gBAAgB,CAAC,IAAI,CAAC;oBAC7C,CAAC,CAAC,CAAC;iBACJ;qBAAM;oBACL,IAAI,CAAC,aAAa,GAAG,gBAAgB,CAAC,IAAI,CAAC;iBAC5C;YACH,CAAC,CAAC,CAAC;SACJ;IACH,CAAC;CACF,CAAA;AA7RC;IAAC,MAAM,CAAC,eAAe,CAAC;;uCACJ;AALT,UAAU;IAFtB,gBAAgB,EAAE;IAClB,UAAU,CAAC,YAAY,CAAC;GACZ,UAAU,CAiStB;SAjSY,UAAU"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/targets/index.ts"],"names":[],"mappings":"AAAA,cAAc,sBAAsB,CAAC;AACrC,cAAc,2BAA2B,CAAC;AAC1C,cAAc,iBAAiB,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/targets/index.ts"],"names":[],"mappings":"AAAA,cAAc,sBAAsB,CAAC;AACrC,cAAc,2BAA2B,CAAC;AAC1C,cAAc,iBAAiB,CAAC"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@spinajs/log",
|
|
3
|
-
"version": "2.0.
|
|
3
|
+
"version": "2.0.54",
|
|
4
4
|
"description": "Log lib for all spinejs related libs",
|
|
5
5
|
"exports": "./lib/index.js",
|
|
6
6
|
"type": "module",
|
|
@@ -8,6 +8,9 @@
|
|
|
8
8
|
"engines": {
|
|
9
9
|
"node": ">=16.11"
|
|
10
10
|
},
|
|
11
|
+
"files": [
|
|
12
|
+
"lib/**/*"
|
|
13
|
+
],
|
|
11
14
|
"scripts": {
|
|
12
15
|
"build": "npm run clean && npm run compile",
|
|
13
16
|
"compile": "tsc -b tsconfig.json",
|
|
@@ -30,11 +33,11 @@
|
|
|
30
33
|
"homepage": "https://github.com/spinajs/log#readme",
|
|
31
34
|
"dependencies": {
|
|
32
35
|
"@colors/colors": "^1.5.0",
|
|
33
|
-
"@spinajs/configuration": "^2.0.
|
|
34
|
-
"@spinajs/di": "^2.0.
|
|
35
|
-
"@spinajs/exceptions": "^2.0.
|
|
36
|
-
"@spinajs/internal-logger": "^2.0.
|
|
37
|
-
"@spinajs/log-common": "^2.0.
|
|
36
|
+
"@spinajs/configuration": "^2.0.54",
|
|
37
|
+
"@spinajs/di": "^2.0.54",
|
|
38
|
+
"@spinajs/exceptions": "^2.0.54",
|
|
39
|
+
"@spinajs/internal-logger": "^2.0.54",
|
|
40
|
+
"@spinajs/log-common": "^2.0.54",
|
|
38
41
|
"ajv": "^8.12.0",
|
|
39
42
|
"chalk": "5.2.0",
|
|
40
43
|
"glob": "^8.1.0",
|
package/.eslintignore
DELETED
package/.eslintrc.cjs
DELETED
|
@@ -1,45 +0,0 @@
|
|
|
1
|
-
/*
|
|
2
|
-
👋 Hi! This file was autogenerated by tslint-to-eslint-config.
|
|
3
|
-
https://github.com/typescript-eslint/tslint-to-eslint-config
|
|
4
|
-
|
|
5
|
-
It represents the closest reasonable ESLint configuration to this
|
|
6
|
-
project's original TSLint configuration.
|
|
7
|
-
|
|
8
|
-
We recommend eventually switching this configuration to extend from
|
|
9
|
-
the recommended rulesets in typescript-eslint.
|
|
10
|
-
https://github.com/typescript-eslint/tslint-to-eslint-config/blob/master/docs/FAQs.md
|
|
11
|
-
|
|
12
|
-
Happy linting! 💖
|
|
13
|
-
*/
|
|
14
|
-
module.exports = {
|
|
15
|
-
root: true,
|
|
16
|
-
env: {
|
|
17
|
-
browser: true,
|
|
18
|
-
es6: true,
|
|
19
|
-
},
|
|
20
|
-
ignorePatterns: ['.eslintrc.js'],
|
|
21
|
-
extends: [
|
|
22
|
-
'plugin:security/recommended',
|
|
23
|
-
'plugin:import/errors',
|
|
24
|
-
'plugin:import/warnings',
|
|
25
|
-
'plugin:import/typescript',
|
|
26
|
-
'plugin:promise/recommended',
|
|
27
|
-
'plugin:@typescript-eslint/recommended',
|
|
28
|
-
'plugin:@typescript-eslint/recommended-requiring-type-checking',
|
|
29
|
-
],
|
|
30
|
-
parser: '@typescript-eslint/parser',
|
|
31
|
-
parserOptions: {
|
|
32
|
-
project: 'tsconfig.json',
|
|
33
|
-
sourceType: 'module',
|
|
34
|
-
},
|
|
35
|
-
plugins: ['promise', 'prettier', 'eslint-plugin-import', 'eslint-plugin-prefer-arrow', '@typescript-eslint', 'tsdoc', 'security'],
|
|
36
|
-
rules: {
|
|
37
|
-
'tsdoc/syntax': 'warn',
|
|
38
|
-
'import/no-unresolved': 'off',
|
|
39
|
-
|
|
40
|
-
"@typescript-eslint/require-await": "off",
|
|
41
|
-
"security/detect-unsafe-regex" : "off",
|
|
42
|
-
'@typescript-eslint/no-explicit-any': 'off',
|
|
43
|
-
},
|
|
44
|
-
};
|
|
45
|
-
|
package/.mocharc.json
DELETED
package/typedoc.json
DELETED
|
@@ -1,16 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"mode": "modules",
|
|
3
|
-
"out": "docs",
|
|
4
|
-
"name": "spine",
|
|
5
|
-
"theme": "default",
|
|
6
|
-
"ignoreCompilerErrors": "true",
|
|
7
|
-
"experimentalDecorators": "true",
|
|
8
|
-
"emitDecoratorMetadata": "true",
|
|
9
|
-
"target": "ES6",
|
|
10
|
-
"moduleResolution": "node",
|
|
11
|
-
"preserveConstEnums": "true",
|
|
12
|
-
"stripInternal": "true",
|
|
13
|
-
"suppressExcessPropertyErrors": "true",
|
|
14
|
-
"suppressImplicitAnyIndexErrors": "true",
|
|
15
|
-
"module": "commonjs"
|
|
16
|
-
}
|