@spinajs/log 1.1.8 → 1.2.9
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/.eslintignore +2 -0
- package/.eslintrc.js +43 -0
- package/lib/bootstrap.d.ts +4 -0
- package/lib/bootstrap.js +30 -0
- package/lib/bootstrap.js.map +1 -0
- package/lib/config/log.js +3 -3
- package/lib/config/log.js.map +1 -1
- package/lib/decorators.d.ts +3 -3
- package/lib/decorators.js +4 -4
- package/lib/decorators.js.map +1 -1
- package/lib/index.d.ts +7 -2
- package/lib/index.js +8 -2
- package/lib/index.js.map +1 -1
- package/lib/log.d.ts +8 -32
- package/lib/log.js +59 -123
- package/lib/log.js.map +1 -1
- package/lib/logger.d.ts +3 -7
- package/lib/logger.js +14 -24
- package/lib/logger.js.map +1 -1
- package/lib/schemas/log.configuration.d.ts +1 -0
- package/lib/schemas/log.configuration.js +91 -97
- package/lib/schemas/log.configuration.js.map +1 -1
- package/lib/targets/BlackHoleTarget.d.ts +3 -3
- package/lib/targets/BlackHoleTarget.js.map +1 -1
- package/lib/targets/ColoredConsoleTarget.d.ts +4 -5
- package/lib/targets/ColoredConsoleTarget.js +18 -14
- package/lib/targets/ColoredConsoleTarget.js.map +1 -1
- package/lib/targets/FileTarget.d.ts +3 -4
- package/lib/targets/FileTarget.js +84 -112
- package/lib/targets/FileTarget.js.map +1 -1
- package/lib/targets/LogTarget.d.ts +10 -5
- package/lib/targets/LogTarget.js +38 -36
- package/lib/targets/LogTarget.js.map +1 -1
- package/lib/targets/index.d.ts +1 -0
- package/lib/targets/index.js +1 -0
- package/lib/targets/index.js.map +1 -1
- package/lib/types.d.ts +13 -10
- package/lib/types.js +8 -8
- package/lib/types.js.map +1 -1
- package/lib/variables/date.d.ts +1 -1
- package/lib/variables/date.js +7 -7
- package/lib/variables/date.js.map +1 -1
- package/lib/variables/env.d.ts +1 -1
- package/lib/variables/env.js +4 -4
- package/lib/variables/env.js.map +1 -1
- package/lib/variables/process.d.ts +2 -3
- package/lib/variables/process.js +4 -16
- package/lib/variables/process.js.map +1 -1
- package/package.json +14 -39
- package/tsconfig.build.json +9 -0
package/.eslintignore
ADDED
package/.eslintrc.js
ADDED
|
@@ -0,0 +1,43 @@
|
|
|
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
|
+
"@typescript-eslint/require-await": "off",
|
|
39
|
+
"security/detect-unsafe-regex" : "off",
|
|
40
|
+
'@typescript-eslint/no-explicit-any': 'off',
|
|
41
|
+
},
|
|
42
|
+
};
|
|
43
|
+
|
package/lib/bootstrap.js
ADDED
|
@@ -0,0 +1,30 @@
|
|
|
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
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
9
|
+
exports.LogBotstrapper = void 0;
|
|
10
|
+
const di_1 = require("@spinajs/di");
|
|
11
|
+
const log_1 = require("./log");
|
|
12
|
+
const log_configuration_1 = require("./schemas/log.configuration");
|
|
13
|
+
let LogBotstrapper = class LogBotstrapper extends di_1.Bootstrapper {
|
|
14
|
+
async bootstrap() {
|
|
15
|
+
di_1.DI.register(log_configuration_1.default).asArrayValue("__configurationSchema__");
|
|
16
|
+
process.on("uncaughtException", (err) => {
|
|
17
|
+
const log = di_1.DI.resolve(log_1.Log, ["process"]);
|
|
18
|
+
log.fatal(err, "Unhandled exception occured");
|
|
19
|
+
});
|
|
20
|
+
process.on("unhandledRejection", (reason, p) => {
|
|
21
|
+
const log = di_1.DI.resolve(log_1.Log, ["process"]);
|
|
22
|
+
log.fatal(reason, "Unhandled rejection at Promise %s", p);
|
|
23
|
+
});
|
|
24
|
+
}
|
|
25
|
+
};
|
|
26
|
+
LogBotstrapper = __decorate([
|
|
27
|
+
(0, di_1.Injectable)(di_1.Bootstrapper)
|
|
28
|
+
], LogBotstrapper);
|
|
29
|
+
exports.LogBotstrapper = LogBotstrapper;
|
|
30
|
+
//# sourceMappingURL=bootstrap.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"bootstrap.js","sourceRoot":"","sources":["../src/bootstrap.ts"],"names":[],"mappings":";;;;;;;;;AAAA,oCAA2D;AAC3D,+BAA4B;AAC5B,mEAA+D;AAG/D,IAAa,cAAc,GAA3B,MAAa,cAAe,SAAQ,iBAAY;IACvC,KAAK,CAAC,SAAS;QACpB,OAAE,CAAC,QAAQ,CAAC,2BAAoB,CAAC,CAAC,YAAY,CAAC,yBAAyB,CAAC,CAAC;QAE1E,OAAO,CAAC,EAAE,CAAC,mBAAmB,EAAE,CAAC,GAAG,EAAE,EAAE;YACtC,MAAM,GAAG,GAAG,OAAE,CAAC,OAAO,CAAC,SAAG,EAAE,CAAC,SAAS,CAAC,CAAC,CAAC;YACzC,GAAG,CAAC,KAAK,CAAC,GAAG,EAAE,6BAA6B,CAAC,CAAC;QAChD,CAAC,CAAC,CAAC;QAEH,OAAO,CAAC,EAAE,CAAC,oBAAoB,EAAE,CAAC,MAAM,EAAE,CAAC,EAAE,EAAE;YAC7C,MAAM,GAAG,GAAG,OAAE,CAAC,OAAO,CAAC,SAAG,EAAE,CAAC,SAAS,CAAC,CAAC,CAAC;YACzC,GAAG,CAAC,KAAK,CAAC,MAAe,EAAE,mCAAmC,EAAE,CAAC,CAAC,CAAC;QACrE,CAAC,CAAC,CAAC;IACL,CAAC;CACF,CAAA;AAdY,cAAc;IAD1B,IAAA,eAAU,EAAC,iBAAY,CAAC;GACZ,cAAc,CAc1B;AAdY,wCAAc"}
|
package/lib/config/log.js
CHANGED
package/lib/config/log.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"log.js","sourceRoot":"","sources":["../../src/config/log.ts"],"names":[],"mappings":";;AAAA,+BAAgD;AAEhD,SAAS,GAAG,CAAC,
|
|
1
|
+
{"version":3,"file":"log.js","sourceRoot":"","sources":["../../src/config/log.ts"],"names":[],"mappings":";;AAAA,+BAAgD;AAEhD,SAAS,GAAG,CAAC,IAAY;IACvB,OAAO,IAAA,cAAO,EAAC,IAAA,gBAAS,EAAC,IAAA,WAAI,EAAC,SAAS,EAAE,IAAI,CAAC,CAAC,CAAC,CAAC;AACnD,CAAC;AAED,MAAM,MAAM,GAAG;IACb,MAAM,EAAE;QACN,IAAI,EAAE;YACJ,OAAO,EAAE,CAAC,GAAG,CAAC,cAAc,CAAC,CAAC;SAC/B;KACF;IACD,GAAG,EAAE,EAAE;CACR,CAAC;AAEF,kBAAe,MAAM,CAAC"}
|
package/lib/decorators.d.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
/**
|
|
2
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
|
|
3
|
+
* @param name - name of logger
|
|
4
|
+
* @param variables - optional log variables
|
|
5
5
|
*/
|
|
6
|
-
export declare function Logger(name: string, variables?:
|
|
6
|
+
export declare function Logger(name: string, variables?: Record<string, unknown>): (target: any, key: string) => any;
|
package/lib/decorators.js
CHANGED
|
@@ -5,8 +5,8 @@ const di_1 = require("@spinajs/di");
|
|
|
5
5
|
const log_1 = require("./log");
|
|
6
6
|
/**
|
|
7
7
|
* Creates ( if not exists ) new logger instance with given name and optional variables
|
|
8
|
-
* @param name name of logger
|
|
9
|
-
* @param variables optional log variables
|
|
8
|
+
* @param name - name of logger
|
|
9
|
+
* @param variables - optional log variables
|
|
10
10
|
*/
|
|
11
11
|
function Logger(name, variables) {
|
|
12
12
|
return (target, key) => {
|
|
@@ -15,7 +15,7 @@ function Logger(name, variables) {
|
|
|
15
15
|
const getter = () => {
|
|
16
16
|
if (!logger) {
|
|
17
17
|
const allLoggers = di_1.DI.get(Array.ofType(log_1.Log));
|
|
18
|
-
const found = allLoggers.find(l => l.Name);
|
|
18
|
+
const found = allLoggers.find((l) => l.Name);
|
|
19
19
|
if (found) {
|
|
20
20
|
logger = found;
|
|
21
21
|
}
|
|
@@ -29,7 +29,7 @@ function Logger(name, variables) {
|
|
|
29
29
|
Object.defineProperty(target, key, {
|
|
30
30
|
get: getter,
|
|
31
31
|
enumerable: false,
|
|
32
|
-
configurable: false
|
|
32
|
+
configurable: false,
|
|
33
33
|
});
|
|
34
34
|
};
|
|
35
35
|
}
|
package/lib/decorators.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"decorators.js","sourceRoot":"","sources":["../src/decorators.ts"],"names":[],"mappings":";;;AAAA,oCAAiC;AACjC,+BAA4B;
|
|
1
|
+
{"version":3,"file":"decorators.js","sourceRoot":"","sources":["../src/decorators.ts"],"names":[],"mappings":";;;AAAA,oCAAiC;AACjC,+BAA4B;AAE5B;;;;GAIG;AACH,SAAgB,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,OAAE,CAAC,GAAG,CAAC,KAAK,CAAC,MAAM,CAAC,SAAG,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,OAAE,CAAC,OAAO,CAAC,SAAG,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;AA1BD,wBA0BC"}
|
package/lib/index.d.ts
CHANGED
|
@@ -6,9 +6,14 @@
|
|
|
6
6
|
* When we export, we can see configuration variable
|
|
7
7
|
* in webpack module cache and webpack config loader can see it
|
|
8
8
|
*/
|
|
9
|
-
export * from "./config/log";
|
|
10
|
-
|
|
9
|
+
export * as config from "./config/log";
|
|
10
|
+
/**
|
|
11
|
+
* Same issue with schemas
|
|
12
|
+
*/
|
|
13
|
+
export * as CONFIGURATION_SCHEMA from "./schemas/log.configuration";
|
|
14
|
+
export * from "@spinajs/log-common";
|
|
11
15
|
export * from "./targets";
|
|
12
16
|
export * from "./variables";
|
|
13
17
|
export * from "./log";
|
|
14
18
|
export * from "./decorators";
|
|
19
|
+
export * from "./bootstrap";
|
package/lib/index.js
CHANGED
|
@@ -10,6 +10,7 @@ var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
|
10
10
|
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
11
11
|
};
|
|
12
12
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
13
|
+
exports.CONFIGURATION_SCHEMA = exports.config = void 0;
|
|
13
14
|
/**
|
|
14
15
|
* We export default configuration for webpack modules
|
|
15
16
|
* Normally we load configuration from disk via filesystem
|
|
@@ -18,10 +19,15 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
18
19
|
* When we export, we can see configuration variable
|
|
19
20
|
* in webpack module cache and webpack config loader can see it
|
|
20
21
|
*/
|
|
21
|
-
|
|
22
|
-
|
|
22
|
+
exports.config = require("./config/log");
|
|
23
|
+
/**
|
|
24
|
+
* Same issue with schemas
|
|
25
|
+
*/
|
|
26
|
+
exports.CONFIGURATION_SCHEMA = require("./schemas/log.configuration");
|
|
27
|
+
__exportStar(require("@spinajs/log-common"), exports);
|
|
23
28
|
__exportStar(require("./targets"), exports);
|
|
24
29
|
__exportStar(require("./variables"), exports);
|
|
25
30
|
__exportStar(require("./log"), exports);
|
|
26
31
|
__exportStar(require("./decorators"), exports);
|
|
32
|
+
__exportStar(require("./bootstrap"), exports);
|
|
27
33
|
//# sourceMappingURL=index.js.map
|
package/lib/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;AAAA;;;;;;;GAOG;AACH,yCAAuC;AAEvC;;GAEG;AACH,sEAAoE;AAEpE,sDAAoC;AACpC,4CAA0B;AAC1B,8CAA4B;AAC5B,wCAAsB;AACtB,+CAA6B;AAC7B,8CAA4B"}
|
package/lib/log.d.ts
CHANGED
|
@@ -1,15 +1,10 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
4
|
-
interface ILogTargetDesc {
|
|
5
|
-
instance: LogTarget<ICommonTargetOptions>;
|
|
6
|
-
options?: ITargetsOption;
|
|
7
|
-
rule: ILogRule;
|
|
8
|
-
}
|
|
1
|
+
import { Container, SyncModule } from "@spinajs/di";
|
|
2
|
+
import { ILogTargetDesc } from "./targets/LogTarget";
|
|
3
|
+
import { ILogOptions, ILogRule, ILogEntry, LogVariables, ILog } from "@spinajs/log-common";
|
|
9
4
|
/**
|
|
10
5
|
* Default log implementation interface. Taken from bunyan. Feel free to implement own.
|
|
11
6
|
*/
|
|
12
|
-
export declare class Log extends SyncModule {
|
|
7
|
+
export declare class Log extends SyncModule implements ILog {
|
|
13
8
|
Name: string;
|
|
14
9
|
Variables?: any;
|
|
15
10
|
protected Parent?: Log;
|
|
@@ -20,31 +15,14 @@ export declare class Log extends SyncModule {
|
|
|
20
15
|
* Prevents from losing log message when initializing modules
|
|
21
16
|
*/
|
|
22
17
|
static Loggers: Map<string, Log>;
|
|
23
|
-
static trace(message: string, name: string, ...args: any[]): void;
|
|
24
|
-
static trace(err: Error, message: string, name: string, ...args: any[]): void;
|
|
25
|
-
static debug(message: string, name: string, ...args: any[]): void;
|
|
26
|
-
static debug(err: Error, message: string, name: string, ...args: any[]): void;
|
|
27
|
-
static info(message: string, name: string, ...args: any[]): void;
|
|
28
|
-
static info(err: Error, message: string, name: string, ...args: any[]): void;
|
|
29
|
-
static warn(message: string, name: string, ...args: any[]): void;
|
|
30
|
-
static warn(err: Error, message: string, name: string, ...args: any[]): void;
|
|
31
|
-
static error(message: string, name: string, ...args: any[]): void;
|
|
32
|
-
static error(err: Error, message: string, name: string, ...args: any[]): void;
|
|
33
|
-
static fatal(message: string, name: string, ...args: any[]): void;
|
|
34
|
-
static fatal(err: Error, message: string, name: string, ...args: any[]): void;
|
|
35
|
-
static security(message: string, name: string, ...args: any[]): void;
|
|
36
|
-
static security(err: Error, message: string, name: string, ...args: any[]): void;
|
|
37
|
-
static success(message: string, name: string, ...args: any[]): void;
|
|
38
|
-
static success(err: Error, message: string, name: string, ...args: any[]): void;
|
|
39
18
|
static clearLoggers(): void;
|
|
40
|
-
protected static LogBuffer: Map<string, ILogTargetData[]>;
|
|
41
19
|
protected static AttachedToExitEvents: boolean;
|
|
42
|
-
protected static write(err: Error | string, message: string | any[], level: LogLevel, name: string, ...args: any[]): void;
|
|
43
20
|
protected Options: ILogOptions;
|
|
44
21
|
protected Rules: ILogRule[];
|
|
45
22
|
protected Targets: ILogTargetDesc[];
|
|
23
|
+
protected Container: Container;
|
|
46
24
|
constructor(Name: string, Variables?: any, Parent?: Log);
|
|
47
|
-
resolve(
|
|
25
|
+
resolve(): void;
|
|
48
26
|
trace(message: string, ...args: any[]): void;
|
|
49
27
|
trace(err: Error, message: string, ...args: any[]): void;
|
|
50
28
|
debug(message: string, ...args: any[]): void;
|
|
@@ -61,10 +39,8 @@ export declare class Log extends SyncModule {
|
|
|
61
39
|
security(err: Error, message: string, ...args: any[]): void;
|
|
62
40
|
success(message: string, ...args: any[]): void;
|
|
63
41
|
success(err: Error, message: string, ...args: any[]): void;
|
|
64
|
-
|
|
65
|
-
|
|
42
|
+
write(entry: ILogEntry): Promise<PromiseSettledResult<void>[]>;
|
|
43
|
+
child(name: string, variables?: LogVariables): Log;
|
|
66
44
|
protected resolveLogTargets(): void;
|
|
67
45
|
protected matchRulesToLogger(): void;
|
|
68
|
-
protected write(err: Error | string, message: string | any[], level: LogLevel, ...args: any[]): void;
|
|
69
46
|
}
|
|
70
|
-
export {};
|
package/lib/log.js
CHANGED
|
@@ -1,65 +1,35 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
-
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
-
if (k2 === undefined) k2 = k;
|
|
4
|
-
Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } });
|
|
5
|
-
}) : (function(o, m, k, k2) {
|
|
6
|
-
if (k2 === undefined) k2 = k;
|
|
7
|
-
o[k2] = m[k];
|
|
8
|
-
}));
|
|
9
|
-
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
|
10
|
-
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
11
|
-
}) : function(o, v) {
|
|
12
|
-
o["default"] = v;
|
|
13
|
-
});
|
|
14
2
|
var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
|
|
15
3
|
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
16
4
|
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
|
|
17
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;
|
|
18
6
|
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
19
7
|
};
|
|
20
|
-
var __importStar = (this && this.__importStar) || function (mod) {
|
|
21
|
-
if (mod && mod.__esModule) return mod;
|
|
22
|
-
var result = {};
|
|
23
|
-
if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
|
|
24
|
-
__setModuleDefault(result, mod);
|
|
25
|
-
return result;
|
|
26
|
-
};
|
|
27
8
|
var __metadata = (this && this.__metadata) || function (k, v) {
|
|
28
9
|
if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
|
|
29
10
|
};
|
|
30
|
-
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
31
|
-
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
32
|
-
};
|
|
33
11
|
var Log_1;
|
|
34
12
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
35
13
|
exports.Log = void 0;
|
|
14
|
+
/* eslint-disable @typescript-eslint/no-unsafe-assignment */
|
|
15
|
+
/* eslint-disable @typescript-eslint/no-unsafe-call */
|
|
16
|
+
/* eslint-disable @typescript-eslint/no-unsafe-argument */
|
|
36
17
|
const types_1 = require("@spinajs/configuration/lib/types");
|
|
37
18
|
const di_1 = require("@spinajs/di");
|
|
38
|
-
const
|
|
39
|
-
const
|
|
40
|
-
const glob_to_regexp_1 = __importDefault(require("glob-to-regexp"));
|
|
19
|
+
const log_common_1 = require("@spinajs/log-common");
|
|
20
|
+
const globToRegexp = require("glob-to-regexp");
|
|
41
21
|
const exceptions_1 = require("@spinajs/exceptions");
|
|
42
|
-
function createLogMessageObject(err, message, level, logger, variables, ...args) {
|
|
43
|
-
const sMsg = (err instanceof Error) ? message : err;
|
|
44
|
-
const tMsg = args.length !== 0 ? util.format(sMsg, ...args) : sMsg;
|
|
45
|
-
const lName = logger !== null && logger !== void 0 ? logger : message;
|
|
46
|
-
return {
|
|
47
|
-
Level: level,
|
|
48
|
-
Variables: Object.assign({ error: (err instanceof Error) ? err : undefined, level: types_2.LogLevelStrings[level].toUpperCase(), logger: lName, message: tMsg }, variables)
|
|
49
|
-
};
|
|
50
|
-
}
|
|
51
22
|
function wrapWrite(level) {
|
|
52
|
-
const self = this;
|
|
53
23
|
return (err, message, ...args) => {
|
|
54
24
|
if (err instanceof Error) {
|
|
55
|
-
|
|
25
|
+
return this.write((0, log_common_1.createLogMessageObject)(err, message, level, this.Name, this.Variables, ...args));
|
|
56
26
|
}
|
|
57
27
|
else {
|
|
58
28
|
if (message) {
|
|
59
|
-
|
|
29
|
+
return this.write((0, log_common_1.createLogMessageObject)(err, null, level, this.Name, this.Variables, ...[message, ...args]));
|
|
60
30
|
}
|
|
61
31
|
else {
|
|
62
|
-
|
|
32
|
+
return this.write((0, log_common_1.createLogMessageObject)(err, null, level, this.Name, this.Variables, ...args));
|
|
63
33
|
}
|
|
64
34
|
}
|
|
65
35
|
};
|
|
@@ -74,120 +44,75 @@ let Log = Log_1 = class Log extends di_1.SyncModule {
|
|
|
74
44
|
this.Variables = Variables;
|
|
75
45
|
this.Parent = Parent;
|
|
76
46
|
}
|
|
77
|
-
static trace(err, message, name, ...args) {
|
|
78
|
-
Log_1.write(err, message, types_2.LogLevel.Trace, name, ...args);
|
|
79
|
-
}
|
|
80
|
-
static debug(err, message, name, ...args) {
|
|
81
|
-
Log_1.write(err, message, types_2.LogLevel.Debug, name, ...args);
|
|
82
|
-
}
|
|
83
|
-
static info(err, message, name, ...args) {
|
|
84
|
-
Log_1.write(err, message, types_2.LogLevel.Info, name, ...args);
|
|
85
|
-
}
|
|
86
|
-
static warn(err, message, name, ...args) {
|
|
87
|
-
Log_1.write(err, message, types_2.LogLevel.Warn, name, ...args);
|
|
88
|
-
}
|
|
89
|
-
static error(err, message, name, ...args) {
|
|
90
|
-
Log_1.write(err, message, types_2.LogLevel.Error, name, ...args);
|
|
91
|
-
}
|
|
92
|
-
static fatal(err, message, name, ...args) {
|
|
93
|
-
Log_1.write(err, message, types_2.LogLevel.Fatal, name, ...args);
|
|
94
|
-
}
|
|
95
|
-
static security(err, message, name, ...args) {
|
|
96
|
-
Log_1.write(err, message, types_2.LogLevel.Security, name, ...args);
|
|
97
|
-
}
|
|
98
|
-
static success(err, message, name, ...args) {
|
|
99
|
-
Log_1.write(err, message, types_2.LogLevel.Success, name, ...args);
|
|
100
|
-
}
|
|
101
47
|
static clearLoggers() {
|
|
102
48
|
Log_1.Loggers.clear();
|
|
103
49
|
}
|
|
104
|
-
|
|
105
|
-
const
|
|
106
|
-
const logName = name !== null && name !== void 0 ? name : message;
|
|
107
|
-
// if we have already created logger write to it
|
|
108
|
-
if (Log_1.Loggers.has(logName)) {
|
|
109
|
-
Log_1.Loggers.get(logName).Targets.forEach(t => t.instance.write(msg));
|
|
110
|
-
return;
|
|
111
|
-
}
|
|
112
|
-
// otherwise store in buffer
|
|
113
|
-
if (Log_1.LogBuffer.has(logName)) {
|
|
114
|
-
Log_1.LogBuffer.get(logName).push(msg);
|
|
115
|
-
}
|
|
116
|
-
else {
|
|
117
|
-
Log_1.LogBuffer.set(logName, [msg]);
|
|
118
|
-
}
|
|
119
|
-
}
|
|
120
|
-
resolve(container) {
|
|
121
|
-
const config = container.get(types_1.Configuration);
|
|
50
|
+
resolve() {
|
|
51
|
+
const config = this.Container.get(types_1.Configuration);
|
|
122
52
|
this.Options = config.get("logger");
|
|
123
53
|
this.matchRulesToLogger();
|
|
124
54
|
this.resolveLogTargets();
|
|
125
|
-
|
|
126
|
-
super.resolve(container);
|
|
55
|
+
super.resolve();
|
|
127
56
|
Log_1.Loggers.set(this.Name, this);
|
|
128
57
|
}
|
|
129
58
|
trace(err, message, ...args) {
|
|
130
|
-
wrapWrite.apply(this, [
|
|
59
|
+
wrapWrite.apply(this, [log_common_1.LogLevel.Trace])(err, message, ...args);
|
|
131
60
|
}
|
|
132
61
|
debug(err, message, ...args) {
|
|
133
|
-
wrapWrite.apply(this, [
|
|
62
|
+
wrapWrite.apply(this, [log_common_1.LogLevel.Debug])(err, message, ...args);
|
|
134
63
|
}
|
|
135
64
|
info(err, message, ...args) {
|
|
136
|
-
wrapWrite.apply(this, [
|
|
65
|
+
wrapWrite.apply(this, [log_common_1.LogLevel.Info])(err, message, ...args);
|
|
137
66
|
}
|
|
138
67
|
warn(err, message, ...args) {
|
|
139
|
-
wrapWrite.apply(this, [
|
|
68
|
+
wrapWrite.apply(this, [log_common_1.LogLevel.Warn])(err, message, ...args);
|
|
140
69
|
}
|
|
141
70
|
error(err, message, ...args) {
|
|
142
|
-
wrapWrite.apply(this, [
|
|
71
|
+
wrapWrite.apply(this, [log_common_1.LogLevel.Error])(err, message, ...args);
|
|
143
72
|
}
|
|
144
73
|
fatal(err, message, ...args) {
|
|
145
|
-
wrapWrite.apply(this, [
|
|
74
|
+
wrapWrite.apply(this, [log_common_1.LogLevel.Fatal])(err, message, ...args);
|
|
146
75
|
}
|
|
147
76
|
security(err, message, ...args) {
|
|
148
|
-
wrapWrite.apply(this, [
|
|
77
|
+
wrapWrite.apply(this, [log_common_1.LogLevel.Security])(err, message, ...args);
|
|
149
78
|
}
|
|
150
79
|
success(err, message, ...args) {
|
|
151
|
-
wrapWrite.apply(this, [
|
|
152
|
-
}
|
|
153
|
-
child(name, variables) {
|
|
154
|
-
return di_1.DI.resolve(Log_1, [`${this.Name}.${name}`, Object.assign(Object.assign({}, this.Variables), variables), this]);
|
|
80
|
+
wrapWrite.apply(this, [log_common_1.LogLevel.Success])(err, message, ...args);
|
|
155
81
|
}
|
|
156
|
-
|
|
157
|
-
if (
|
|
158
|
-
|
|
159
|
-
this.Targets.forEach(t => t.instance.write(msg));
|
|
160
|
-
});
|
|
82
|
+
write(entry) {
|
|
83
|
+
if (entry.Variables.logger === this.Name) {
|
|
84
|
+
return Promise.allSettled(this.Targets.filter((t) => entry.Level >= log_common_1.StrToLogLevel[t.rule.level]).map((t) => t.instance.write(entry)));
|
|
161
85
|
}
|
|
162
86
|
}
|
|
87
|
+
child(name, variables) {
|
|
88
|
+
return di_1.DI.resolve(Log_1, [
|
|
89
|
+
`${this.Name}.${name}`,
|
|
90
|
+
Object.assign(Object.assign({}, this.Variables), variables),
|
|
91
|
+
this,
|
|
92
|
+
]);
|
|
93
|
+
}
|
|
163
94
|
resolveLogTargets() {
|
|
164
|
-
this.Targets = this.Rules.map(r => {
|
|
165
|
-
const found = this.Options.targets.filter(t => {
|
|
166
|
-
return Array.isArray(r.target)
|
|
95
|
+
this.Targets = this.Rules.map((r) => {
|
|
96
|
+
const found = this.Options.targets.filter((t) => {
|
|
97
|
+
return Array.isArray(r.target)
|
|
98
|
+
? r.target.includes(t.name)
|
|
99
|
+
: r.target === t.name;
|
|
167
100
|
});
|
|
168
101
|
if (!found) {
|
|
169
|
-
throw new exceptions_1.InvalidOption(`No target matching rule ${r.
|
|
102
|
+
throw new exceptions_1.InvalidOption(`No target matching rule ${r.name}`);
|
|
170
103
|
}
|
|
171
|
-
return found.map(f => {
|
|
104
|
+
return found.map((f) => {
|
|
172
105
|
return {
|
|
173
106
|
instance: di_1.DI.resolve(f.type, [f]),
|
|
174
107
|
options: f,
|
|
175
|
-
rule: r
|
|
108
|
+
rule: r,
|
|
176
109
|
};
|
|
177
110
|
});
|
|
178
111
|
}).reduce((prev, curr) => prev.concat(...curr), []);
|
|
179
112
|
}
|
|
180
113
|
matchRulesToLogger() {
|
|
181
|
-
this.Rules = this.Options.rules.filter(r => {
|
|
182
|
-
return (
|
|
183
|
-
});
|
|
184
|
-
}
|
|
185
|
-
write(err, message, level, ...args) {
|
|
186
|
-
const lMsg = createLogMessageObject(err, message, level, this.Name, this.Variables, ...args);
|
|
187
|
-
this.Targets.forEach(t => {
|
|
188
|
-
if (level >= types_2.StrToLogLevel[t.rule.level]) {
|
|
189
|
-
t.instance.write(lMsg);
|
|
190
|
-
}
|
|
114
|
+
this.Rules = this.Options.rules.filter((r) => {
|
|
115
|
+
return globToRegexp(r.name).test(this.Name);
|
|
191
116
|
});
|
|
192
117
|
}
|
|
193
118
|
};
|
|
@@ -198,22 +123,33 @@ let Log = Log_1 = class Log extends di_1.SyncModule {
|
|
|
198
123
|
* Prevents from losing log message when initializing modules
|
|
199
124
|
*/
|
|
200
125
|
Log.Loggers = new Map();
|
|
201
|
-
Log.LogBuffer = new Map();
|
|
202
126
|
Log.AttachedToExitEvents = false;
|
|
127
|
+
__decorate([
|
|
128
|
+
(0, di_1.Autoinject)(),
|
|
129
|
+
__metadata("design:type", di_1.Container)
|
|
130
|
+
], Log.prototype, "Container", void 0);
|
|
203
131
|
Log = Log_1 = __decorate([
|
|
204
132
|
(0, di_1.NewInstance)(),
|
|
205
133
|
__metadata("design:paramtypes", [String, Object, Log])
|
|
206
134
|
], Log);
|
|
207
135
|
exports.Log = Log;
|
|
208
|
-
|
|
209
|
-
di_1.DI.register((container, ...args) => {
|
|
210
|
-
if (!args || args.length === 0 || typeof args[0] !== "string") {
|
|
211
|
-
throw new di_1.ResolveException(`invalid arguments for Log constructor (logger name)`);
|
|
212
|
-
}
|
|
213
|
-
const logName = args[0];
|
|
136
|
+
const logFactoryFunction = (container, logName) => {
|
|
214
137
|
if (Log.Loggers.has(logName)) {
|
|
215
138
|
return Log.Loggers.get(logName);
|
|
216
139
|
}
|
|
217
|
-
return container.resolve("__logImplementation__", [
|
|
218
|
-
}
|
|
140
|
+
return container.resolve("__logImplementation__", [logName]);
|
|
141
|
+
};
|
|
142
|
+
// register as string identifier to allow for
|
|
143
|
+
// resolving logs without referencing class
|
|
144
|
+
// to avoid circular dependencies in some @spinajs packages
|
|
145
|
+
// it should not be used in production code
|
|
146
|
+
di_1.DI.register(logFactoryFunction).as("__log__");
|
|
147
|
+
// register log factory function as Log class
|
|
148
|
+
// this way we can create or return already created
|
|
149
|
+
// log objects
|
|
150
|
+
di_1.DI.register(logFactoryFunction).as(Log);
|
|
151
|
+
// register Log class as string literal
|
|
152
|
+
// so we can resolve Log class
|
|
153
|
+
// it should not be used in production code
|
|
154
|
+
di_1.DI.register(Log).as("__logImplementation__");
|
|
219
155
|
//# sourceMappingURL=log.js.map
|
package/lib/log.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"log.js","sourceRoot":"","sources":["../src/log.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"log.js","sourceRoot":"","sources":["../src/log.ts"],"names":[],"mappings":";;;;;;;;;;;;;AAAA,4DAA4D;AAC5D,sDAAsD;AACtD,0DAA0D;AAC1D,4DAAiE;AACjE,oCAOqB;AAErB,oDAU6B;AAC7B,+CAA+C;AAC/C,oDAAoD;AAEpD,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,CAAC;aACH;iBAAM;gBACL,OAAO,IAAI,CAAC,KAAK,CACf,IAAA,mCAAsB,EACpB,GAAG,EACH,IAAI,EACJ,KAAK,EACL,IAAI,CAAC,IAAI,EACT,IAAI,CAAC,SAAS,EACd,GAAG,IAAI,CACR,CACF,CAAC;aACH;SACF;IACH,CAAC,CAAC;AACJ,CAAC;AAED;;GAEG;AAEH,IAAa,GAAG,WAAhB,MAAa,GAAI,SAAQ,eAAU;IAwBjC,YACS,IAAY,EACZ,SAAe,EACZ,MAAY;QAEtB,KAAK,EAAE,CAAC;QAJD,SAAI,GAAJ,IAAI,CAAQ;QACZ,cAAS,GAAT,SAAS,CAAM;QACZ,WAA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1,8 +1,4 @@
|
|
|
1
|
-
import {
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
export declare class LogBootstrap extends AsyncModule {
|
|
5
|
-
protected Validator: DataValidator;
|
|
6
|
-
protected Options: ILogOptions;
|
|
7
|
-
resolveAsync(_: IContainer): Promise<void>;
|
|
1
|
+
import { Bootstrapper } from "@spinajs/di";
|
|
2
|
+
export declare class Logger extends Bootstrapper {
|
|
3
|
+
bootstrap(): Promise<void>;
|
|
8
4
|
}
|