@spinajs/log 1.2.74 → 1.2.81

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.
Files changed (48) hide show
  1. package/lib/bootstrap.js +4 -1
  2. package/lib/bootstrap.js.map +1 -1
  3. package/lib/index.js +5 -1
  4. package/lib/index.js.map +1 -1
  5. package/lib/log.d.ts +2 -3
  6. package/lib/log.js +9 -4
  7. package/lib/log.js.map +1 -1
  8. package/lib/schemas/log.configuration.d.ts +0 -29
  9. package/lib/schemas/log.configuration.js +0 -29
  10. package/lib/schemas/log.configuration.js.map +1 -1
  11. package/lib/targets/BlackHoleTarget.d.ts +1 -2
  12. package/lib/targets/BlackHoleTarget.js +2 -2
  13. package/lib/targets/BlackHoleTarget.js.map +1 -1
  14. package/lib/targets/ColoredConsoleTarget.d.ts +4 -3
  15. package/lib/targets/ColoredConsoleTarget.js +16 -7
  16. package/lib/targets/ColoredConsoleTarget.js.map +1 -1
  17. package/lib/targets/FileTarget.d.ts +16 -13
  18. package/lib/targets/FileTarget.js +126 -67
  19. package/lib/targets/FileTarget.js.map +1 -1
  20. package/lib/targets/index.d.ts +0 -1
  21. package/lib/targets/index.js +5 -2
  22. package/lib/targets/index.js.map +1 -1
  23. package/package.json +10 -8
  24. package/lib/config/log.d.ts +0 -8
  25. package/lib/config/log.js +0 -15
  26. package/lib/config/log.js.map +0 -1
  27. package/lib/logger.d.ts +0 -4
  28. package/lib/logger.js +0 -30
  29. package/lib/logger.js.map +0 -1
  30. package/lib/targets/LogTarget.d.ts +0 -14
  31. package/lib/targets/LogTarget.js +0 -20
  32. package/lib/targets/LogTarget.js.map +0 -1
  33. package/lib/types.d.ts +0 -148
  34. package/lib/types.js +0 -38
  35. package/lib/types.js.map +0 -1
  36. package/lib/variables/date.d.ts +0 -17
  37. package/lib/variables/date.js +0 -62
  38. package/lib/variables/date.js.map +0 -1
  39. package/lib/variables/env.d.ts +0 -5
  40. package/lib/variables/env.js +0 -25
  41. package/lib/variables/env.js.map +0 -1
  42. package/lib/variables/index.d.ts +0 -3
  43. package/lib/variables/index.js +0 -16
  44. package/lib/variables/index.js.map +0 -1
  45. package/lib/variables/process.d.ts +0 -5
  46. package/lib/variables/process.js +0 -24
  47. package/lib/variables/process.js.map +0 -1
  48. package/yarn-error.log +0 -2383
package/lib/types.js DELETED
@@ -1,38 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.LogVariable = exports.LogLevelStrings = exports.StrToLogLevel = exports.LogLevel = void 0;
4
- var LogLevel;
5
- (function (LogLevel) {
6
- LogLevel[LogLevel["Security"] = 999] = "Security";
7
- LogLevel[LogLevel["Fatal"] = 6] = "Fatal";
8
- LogLevel[LogLevel["Error"] = 5] = "Error";
9
- LogLevel[LogLevel["Warn"] = 4] = "Warn";
10
- LogLevel[LogLevel["Success"] = 3] = "Success";
11
- LogLevel[LogLevel["Info"] = 2] = "Info";
12
- LogLevel[LogLevel["Debug"] = 1] = "Debug";
13
- LogLevel[LogLevel["Trace"] = 0] = "Trace";
14
- })(LogLevel = exports.LogLevel || (exports.LogLevel = {}));
15
- exports.StrToLogLevel = {
16
- trace: LogLevel.Trace,
17
- debug: LogLevel.Debug,
18
- info: LogLevel.Info,
19
- success: LogLevel.Success,
20
- warn: LogLevel.Warn,
21
- error: LogLevel.Error,
22
- fatal: LogLevel.Fatal,
23
- security: LogLevel.Security,
24
- };
25
- exports.LogLevelStrings = {
26
- [LogLevel.Debug]: "debug",
27
- [LogLevel.Error]: "error",
28
- [LogLevel.Fatal]: "fatal",
29
- [LogLevel.Info]: "info",
30
- [LogLevel.Security]: "security",
31
- [LogLevel.Success]: "success",
32
- [LogLevel.Trace]: "trace",
33
- [LogLevel.Warn]: "warn",
34
- };
35
- class LogVariable {
36
- }
37
- exports.LogVariable = LogVariable;
38
- //# sourceMappingURL=types.js.map
package/lib/types.js.map DELETED
@@ -1 +0,0 @@
1
- {"version":3,"file":"types.js","sourceRoot":"","sources":["../src/types.ts"],"names":[],"mappings":";;;AAAA,IAAY,QAgBX;AAhBD,WAAY,QAAQ;IAClB,iDAAc,CAAA;IAEd,yCAAS,CAAA;IAET,yCAAS,CAAA;IAET,uCAAQ,CAAA;IAER,6CAAW,CAAA;IAEX,uCAAQ,CAAA;IAER,yCAAS,CAAA;IAET,yCAAS,CAAA;AACX,CAAC,EAhBW,QAAQ,GAAR,gBAAQ,KAAR,gBAAQ,QAgBnB;AAEY,QAAA,aAAa,GAAG;IAC3B,KAAK,EAAE,QAAQ,CAAC,KAAK;IACrB,KAAK,EAAE,QAAQ,CAAC,KAAK;IACrB,IAAI,EAAE,QAAQ,CAAC,IAAI;IACnB,OAAO,EAAE,QAAQ,CAAC,OAAO;IACzB,IAAI,EAAE,QAAQ,CAAC,IAAI;IACnB,KAAK,EAAE,QAAQ,CAAC,KAAK;IACrB,KAAK,EAAE,QAAQ,CAAC,KAAK;IACrB,QAAQ,EAAE,QAAQ,CAAC,QAAQ;CAC5B,CAAC;AAEW,QAAA,eAAe,GAAG;IAC7B,CAAC,QAAQ,CAAC,KAAK,CAAC,EAAE,OAAO;IACzB,CAAC,QAAQ,CAAC,KAAK,CAAC,EAAE,OAAO;IACzB,CAAC,QAAQ,CAAC,KAAK,CAAC,EAAE,OAAO;IACzB,CAAC,QAAQ,CAAC,IAAI,CAAC,EAAE,MAAM;IACvB,CAAC,QAAQ,CAAC,QAAQ,CAAC,EAAE,UAAU;IAC/B,CAAC,QAAQ,CAAC,OAAO,CAAC,EAAE,SAAS;IAC7B,CAAC,QAAQ,CAAC,KAAK,CAAC,EAAE,OAAO;IACzB,CAAC,QAAQ,CAAC,IAAI,CAAC,EAAE,MAAM;CACxB,CAAC;AAEF,MAAsB,WAAW;CAGhC;AAHD,kCAGC"}
@@ -1,17 +0,0 @@
1
- import { LogVariable } from "@spinajs/log-common";
2
- export declare class DateTimeLogVariable extends LogVariable {
3
- get Name(): string;
4
- Value(option?: string): string;
5
- }
6
- export declare class DateLogVariable extends LogVariable {
7
- protected format?: string;
8
- constructor(format?: string);
9
- get Name(): string;
10
- Value(option?: string): string;
11
- }
12
- export declare class TimeLogVariable extends LogVariable {
13
- protected format?: string;
14
- constructor(format?: string);
15
- get Name(): string;
16
- Value(option?: string): string;
17
- }
@@ -1,62 +0,0 @@
1
- "use strict";
2
- var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
3
- var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
4
- if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
5
- else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
6
- return c > 3 && r && Object.defineProperty(target, key, r), r;
7
- };
8
- var __metadata = (this && this.__metadata) || function (k, v) {
9
- if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
10
- };
11
- Object.defineProperty(exports, "__esModule", { value: true });
12
- exports.TimeLogVariable = exports.DateLogVariable = exports.DateTimeLogVariable = void 0;
13
- const di_1 = require("@spinajs/di");
14
- const luxon_1 = require("luxon");
15
- const log_common_1 = require("@spinajs/log-common");
16
- let DateTimeLogVariable = class DateTimeLogVariable extends log_common_1.LogVariable {
17
- get Name() {
18
- return "datetime";
19
- }
20
- Value(option) {
21
- return luxon_1.DateTime.now().toFormat(option !== null && option !== void 0 ? option : "dd/MM/yyyy HH:mm:ss.SSS ZZ");
22
- }
23
- };
24
- DateTimeLogVariable = __decorate([
25
- (0, di_1.Injectable)(log_common_1.LogVariable)
26
- ], DateTimeLogVariable);
27
- exports.DateTimeLogVariable = DateTimeLogVariable;
28
- let DateLogVariable = class DateLogVariable extends log_common_1.LogVariable {
29
- constructor(format) {
30
- super();
31
- this.format = format;
32
- }
33
- get Name() {
34
- return "date";
35
- }
36
- Value(option) {
37
- return luxon_1.DateTime.now().toFormat(option !== null && option !== void 0 ? option : "dd/MM/yyyy");
38
- }
39
- };
40
- DateLogVariable = __decorate([
41
- (0, di_1.Injectable)(log_common_1.LogVariable),
42
- __metadata("design:paramtypes", [String])
43
- ], DateLogVariable);
44
- exports.DateLogVariable = DateLogVariable;
45
- let TimeLogVariable = class TimeLogVariable extends log_common_1.LogVariable {
46
- constructor(format) {
47
- super();
48
- this.format = format;
49
- }
50
- get Name() {
51
- return "time";
52
- }
53
- Value(option) {
54
- return luxon_1.DateTime.now().toFormat(option !== null && option !== void 0 ? option : "HH:mm:ss.SSS");
55
- }
56
- };
57
- TimeLogVariable = __decorate([
58
- (0, di_1.Injectable)(log_common_1.LogVariable),
59
- __metadata("design:paramtypes", [String])
60
- ], TimeLogVariable);
61
- exports.TimeLogVariable = TimeLogVariable;
62
- //# sourceMappingURL=date.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"date.js","sourceRoot":"","sources":["../../src/variables/date.ts"],"names":[],"mappings":";;;;;;;;;;;;AAAA,oCAAyC;AACzC,iCAAiC;AACjC,oDAAkD;AAGlD,IAAa,mBAAmB,GAAhC,MAAa,mBAAoB,SAAQ,wBAAW;IAClD,IAAW,IAAI;QACb,OAAO,UAAU,CAAC;IACpB,CAAC;IACM,KAAK,CAAC,MAAe;QAC1B,OAAO,gBAAQ,CAAC,GAAG,EAAE,CAAC,QAAQ,CAAC,MAAM,aAAN,MAAM,cAAN,MAAM,GAAI,4BAA4B,CAAC,CAAC;IACzE,CAAC;CACF,CAAA;AAPY,mBAAmB;IAD/B,IAAA,eAAU,EAAC,wBAAW,CAAC;GACX,mBAAmB,CAO/B;AAPY,kDAAmB;AAUhC,IAAa,eAAe,GAA5B,MAAa,eAAgB,SAAQ,wBAAW;IAC9C,YAAsB,MAAe;QACnC,KAAK,EAAE,CAAC;QADY,WAAM,GAAN,MAAM,CAAS;IAErC,CAAC;IAED,IAAW,IAAI;QACb,OAAO,MAAM,CAAC;IAChB,CAAC;IACM,KAAK,CAAC,MAAe;QAC1B,OAAO,gBAAQ,CAAC,GAAG,EAAE,CAAC,QAAQ,CAAC,MAAM,aAAN,MAAM,cAAN,MAAM,GAAI,YAAY,CAAC,CAAC;IACzD,CAAC;CACF,CAAA;AAXY,eAAe;IAD3B,IAAA,eAAU,EAAC,wBAAW,CAAC;;GACX,eAAe,CAW3B;AAXY,0CAAe;AAc5B,IAAa,eAAe,GAA5B,MAAa,eAAgB,SAAQ,wBAAW;IAC9C,YAAsB,MAAe;QACnC,KAAK,EAAE,CAAC;QADY,WAAM,GAAN,MAAM,CAAS;IAErC,CAAC;IAED,IAAW,IAAI;QACb,OAAO,MAAM,CAAC;IAChB,CAAC;IACM,KAAK,CAAC,MAAe;QAC1B,OAAO,gBAAQ,CAAC,GAAG,EAAE,CAAC,QAAQ,CAAC,MAAM,aAAN,MAAM,cAAN,MAAM,GAAI,cAAc,CAAC,CAAC;IAC3D,CAAC;CACF,CAAA;AAXY,eAAe;IAD3B,IAAA,eAAU,EAAC,wBAAW,CAAC;;GACX,eAAe,CAW3B;AAXY,0CAAe"}
@@ -1,5 +0,0 @@
1
- import { LogVariable } from "@spinajs/log-common";
2
- export declare class EnvVariable extends LogVariable {
3
- get Name(): string;
4
- Value(option: string): string;
5
- }
@@ -1,25 +0,0 @@
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.EnvVariable = void 0;
10
- const di_1 = require("@spinajs/di");
11
- const log_common_1 = require("@spinajs/log-common");
12
- let EnvVariable = class EnvVariable extends log_common_1.LogVariable {
13
- get Name() {
14
- return "env";
15
- }
16
- Value(option) {
17
- var _a;
18
- return (_a = process.env[`${option}`]) !== null && _a !== void 0 ? _a : "";
19
- }
20
- };
21
- EnvVariable = __decorate([
22
- (0, di_1.Injectable)(log_common_1.LogVariable)
23
- ], EnvVariable);
24
- exports.EnvVariable = EnvVariable;
25
- //# sourceMappingURL=env.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"env.js","sourceRoot":"","sources":["../../src/variables/env.ts"],"names":[],"mappings":";;;;;;;;;AAAA,oCAAyC;AACzC,oDAAkD;AAGlD,IAAa,WAAW,GAAxB,MAAa,WAAY,SAAQ,wBAAW;IAC1C,IAAW,IAAI;QACb,OAAO,KAAK,CAAC;IACf,CAAC;IACM,KAAK,CAAC,MAAc;;QACzB,OAAO,MAAA,OAAO,CAAC,GAAG,CAAC,GAAG,MAAM,EAAE,CAAC,mCAAI,EAAE,CAAC;IACxC,CAAC;CACF,CAAA;AAPY,WAAW;IADvB,IAAA,eAAU,EAAC,wBAAW,CAAC;GACX,WAAW,CAOvB;AAPY,kCAAW"}
@@ -1,3 +0,0 @@
1
- export * from "./date";
2
- export * from "./env";
3
- export * from "./process";
@@ -1,16 +0,0 @@
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 __exportStar = (this && this.__exportStar) || function(m, exports) {
10
- for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
11
- };
12
- Object.defineProperty(exports, "__esModule", { value: true });
13
- __exportStar(require("./date"), exports);
14
- __exportStar(require("./env"), exports);
15
- __exportStar(require("./process"), exports);
16
- //# sourceMappingURL=index.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/variables/index.ts"],"names":[],"mappings":";;;;;;;;;;;;AAAA,yCAAuB;AACvB,wCAAsB;AACtB,4CAA0B"}
@@ -1,5 +0,0 @@
1
- import { LogVariable } from "@spinajs/log-common";
2
- export declare class ProcVariable extends LogVariable {
3
- get Name(): string;
4
- Value(option: "title" | "version" | "pid" | "platform"): string;
5
- }
@@ -1,24 +0,0 @@
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.ProcVariable = void 0;
10
- const di_1 = require("@spinajs/di");
11
- const log_common_1 = require("@spinajs/log-common");
12
- let ProcVariable = class ProcVariable extends log_common_1.LogVariable {
13
- get Name() {
14
- return "proc";
15
- }
16
- Value(option) {
17
- return process[`${option}`];
18
- }
19
- };
20
- ProcVariable = __decorate([
21
- (0, di_1.Injectable)(log_common_1.LogVariable)
22
- ], ProcVariable);
23
- exports.ProcVariable = ProcVariable;
24
- //# sourceMappingURL=process.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"process.js","sourceRoot":"","sources":["../../src/variables/process.ts"],"names":[],"mappings":";;;;;;;;;AAAA,oCAAyC;AACzC,oDAAkD;AAGlD,IAAa,YAAY,GAAzB,MAAa,YAAa,SAAQ,wBAAW;IAC3C,IAAW,IAAI;QACb,OAAO,MAAM,CAAC;IAChB,CAAC;IACM,KAAK,CAAC,MAAgD;QAC3D,OAAO,OAAO,CAAC,GAAG,MAAM,EAAE,CAAW,CAAC;IACxC,CAAC;CACF,CAAA;AAPY,YAAY;IADxB,IAAA,eAAU,EAAC,wBAAW,CAAC;GACX,YAAY,CAOxB;AAPY,oCAAY"}