@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.
Files changed (50) hide show
  1. package/.eslintignore +2 -0
  2. package/.eslintrc.js +43 -0
  3. package/lib/bootstrap.d.ts +4 -0
  4. package/lib/bootstrap.js +30 -0
  5. package/lib/bootstrap.js.map +1 -0
  6. package/lib/config/log.js +3 -3
  7. package/lib/config/log.js.map +1 -1
  8. package/lib/decorators.d.ts +3 -3
  9. package/lib/decorators.js +4 -4
  10. package/lib/decorators.js.map +1 -1
  11. package/lib/index.d.ts +7 -2
  12. package/lib/index.js +8 -2
  13. package/lib/index.js.map +1 -1
  14. package/lib/log.d.ts +8 -32
  15. package/lib/log.js +59 -123
  16. package/lib/log.js.map +1 -1
  17. package/lib/logger.d.ts +3 -7
  18. package/lib/logger.js +14 -24
  19. package/lib/logger.js.map +1 -1
  20. package/lib/schemas/log.configuration.d.ts +1 -0
  21. package/lib/schemas/log.configuration.js +91 -97
  22. package/lib/schemas/log.configuration.js.map +1 -1
  23. package/lib/targets/BlackHoleTarget.d.ts +3 -3
  24. package/lib/targets/BlackHoleTarget.js.map +1 -1
  25. package/lib/targets/ColoredConsoleTarget.d.ts +4 -5
  26. package/lib/targets/ColoredConsoleTarget.js +18 -14
  27. package/lib/targets/ColoredConsoleTarget.js.map +1 -1
  28. package/lib/targets/FileTarget.d.ts +3 -4
  29. package/lib/targets/FileTarget.js +84 -112
  30. package/lib/targets/FileTarget.js.map +1 -1
  31. package/lib/targets/LogTarget.d.ts +10 -5
  32. package/lib/targets/LogTarget.js +38 -36
  33. package/lib/targets/LogTarget.js.map +1 -1
  34. package/lib/targets/index.d.ts +1 -0
  35. package/lib/targets/index.js +1 -0
  36. package/lib/targets/index.js.map +1 -1
  37. package/lib/types.d.ts +13 -10
  38. package/lib/types.js +8 -8
  39. package/lib/types.js.map +1 -1
  40. package/lib/variables/date.d.ts +1 -1
  41. package/lib/variables/date.js +7 -7
  42. package/lib/variables/date.js.map +1 -1
  43. package/lib/variables/env.d.ts +1 -1
  44. package/lib/variables/env.js +4 -4
  45. package/lib/variables/env.js.map +1 -1
  46. package/lib/variables/process.d.ts +2 -3
  47. package/lib/variables/process.js +4 -16
  48. package/lib/variables/process.js.map +1 -1
  49. package/package.json +14 -39
  50. package/tsconfig.build.json +9 -0
@@ -8,18 +8,18 @@ var __decorate = (this && this.__decorate) || function (decorators, target, key,
8
8
  Object.defineProperty(exports, "__esModule", { value: true });
9
9
  exports.EnvVariable = void 0;
10
10
  const di_1 = require("@spinajs/di");
11
- const types_1 = require("../types");
12
- let EnvVariable = class EnvVariable extends types_1.LogVariable {
11
+ const log_common_1 = require("@spinajs/log-common");
12
+ let EnvVariable = class EnvVariable extends log_common_1.LogVariable {
13
13
  get Name() {
14
14
  return "env";
15
15
  }
16
16
  Value(option) {
17
17
  var _a;
18
- return (_a = process.env[option]) !== null && _a !== void 0 ? _a : "";
18
+ return (_a = process.env[`${option}`]) !== null && _a !== void 0 ? _a : "";
19
19
  }
20
20
  };
21
21
  EnvVariable = __decorate([
22
- (0, di_1.Injectable)(types_1.LogVariable)
22
+ (0, di_1.Injectable)(log_common_1.LogVariable)
23
23
  ], EnvVariable);
24
24
  exports.EnvVariable = EnvVariable;
25
25
  //# sourceMappingURL=env.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"env.js","sourceRoot":"","sources":["../../src/variables/env.ts"],"names":[],"mappings":";;;;;;;;;AAAA,oCAAyC;AACzC,oCAAuC;AAIvC,IAAa,WAAW,GAAxB,MAAa,WAAY,SAAQ,mBAAW;IACxC,IAAW,IAAI;QACX,OAAO,KAAK,CAAC;IACjB,CAAC;IACM,KAAK,CAAC,MAAc;;QACvB,OAAO,MAAA,OAAO,CAAC,GAAG,CAAC,MAAM,CAAC,mCAAI,EAAE,CAAC;IACrC,CAAC;CACJ,CAAA;AAPY,WAAW;IADvB,IAAA,eAAU,EAAC,mBAAW,CAAC;GACX,WAAW,CAOvB;AAPY,kCAAW"}
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,6 +1,5 @@
1
- import { LogVariable } from "../types";
1
+ import { LogVariable } from "@spinajs/log-common";
2
2
  export declare class ProcVariable extends LogVariable {
3
- protected ALLOWED_PROPS: string[];
4
3
  get Name(): string;
5
- Value(option: string): string;
4
+ Value(option: "title" | "version" | "pid" | "platform"): string;
6
5
  }
@@ -8,29 +8,17 @@ var __decorate = (this && this.__decorate) || function (decorators, target, key,
8
8
  Object.defineProperty(exports, "__esModule", { value: true });
9
9
  exports.ProcVariable = void 0;
10
10
  const di_1 = require("@spinajs/di");
11
- const types_1 = require("../types");
12
- let ProcVariable = class ProcVariable extends types_1.LogVariable {
13
- constructor() {
14
- super(...arguments);
15
- this.ALLOWED_PROPS = [
16
- "title",
17
- "version",
18
- "pid",
19
- "platform",
20
- ];
21
- }
11
+ const log_common_1 = require("@spinajs/log-common");
12
+ let ProcVariable = class ProcVariable extends log_common_1.LogVariable {
22
13
  get Name() {
23
14
  return "proc";
24
15
  }
25
16
  Value(option) {
26
- if (this.ALLOWED_PROPS.indexOf(option) !== -1) {
27
- return process[option];
28
- }
29
- return `[${option} is undefined]`;
17
+ return process[`${option}`];
30
18
  }
31
19
  };
32
20
  ProcVariable = __decorate([
33
- (0, di_1.Injectable)(types_1.LogVariable)
21
+ (0, di_1.Injectable)(log_common_1.LogVariable)
34
22
  ], ProcVariable);
35
23
  exports.ProcVariable = ProcVariable;
36
24
  //# sourceMappingURL=process.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"process.js","sourceRoot":"","sources":["../../src/variables/process.ts"],"names":[],"mappings":";;;;;;;;;AAAA,oCAAyC;AACzC,oCAAuC;AAIvC,IAAa,YAAY,GAAzB,MAAa,YAAa,SAAQ,mBAAW;IAA7C;;QAEc,kBAAa,GAAG;YACtB,OAAO;YACP,SAAS;YACT,KAAK;YACL,UAAU;SAEb,CAAA;IAaL,CAAC;IAZG,IAAW,IAAI;QACX,OAAO,MAAM,CAAC;IAClB,CAAC;IACM,KAAK,CAAC,MAAc;QAEvB,IAAI,IAAI,CAAC,aAAa,CAAC,OAAO,CAAC,MAAM,CAAC,KAAK,CAAC,CAAC,EAAE;YAC3C,OAAQ,OAAe,CAAC,MAAM,CAAC,CAAC;SACnC;QAED,OAAO,IAAI,MAAM,gBAAgB,CAAC;IACtC,CAAC;CAEJ,CAAA;AArBY,YAAY;IADxB,IAAA,eAAU,EAAC,mBAAW,CAAC;GACX,YAAY,CAqBxB;AArBY,oCAAY"}
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"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@spinajs/log",
3
- "version": "1.1.8",
3
+ "version": "1.2.9",
4
4
  "description": "Log lib for all spinejs related libs",
5
5
  "main": "lib/index.js",
6
6
  "private": false,
@@ -8,11 +8,12 @@
8
8
  "test": "ts-mocha -p tsconfig.json test/**/*.test.ts",
9
9
  "coverage": "nyc npm run test",
10
10
  "build-docs": "rimraf docs && typedoc --options typedoc.json src/",
11
- "build": "tsc",
12
- "build-watch": "tsc -w",
11
+ "build": "npm run clean && npm run compile",
12
+ "compile": "tsc -p tsconfig.build.json",
13
+ "clean": "",
13
14
  "prepare": "npm run build",
14
- "format": "prettier --write \"src/**/*.ts\" \"src/**/*.js\"",
15
- "lint": "tslint -p tsconfig.json",
15
+ "format": "prettier --write \"src/**/*.ts\"",
16
+ "lint": "eslint -c .eslintrc.js --ext .ts src",
16
17
  "prepublishOnly": "npm test && npm run lint",
17
18
  "preversion": "npm run lint",
18
19
  "version": "npm run format && git add -A src",
@@ -25,10 +26,11 @@
25
26
  },
26
27
  "homepage": "https://github.com/spinajs/log#readme",
27
28
  "dependencies": {
28
- "@spinajs/configuration": "^1.1.8",
29
- "@spinajs/di": "^1.1.7",
30
- "@spinajs/exceptions": "^1.0.5",
31
- "@spinajs/validation": "^1.1.8",
29
+ "@spinajs/configuration": "^1.2.7",
30
+ "@spinajs/di": "^1.2.7",
31
+ "@spinajs/exceptions": "^1.2.7",
32
+ "@spinajs/log-common": "^1.2.7",
33
+ "ajv": "^8.8.2",
32
34
  "colors": "^1.4.0",
33
35
  "glob": "^7.2.0",
34
36
  "glob-to-regexp": "^0.4.1",
@@ -37,34 +39,7 @@
37
39
  "node-schedule": "^2.1.0"
38
40
  },
39
41
  "devDependencies": {
40
- "@types/bunyan": "^1.8.6",
41
- "@types/chai": "^4.1.7",
42
- "@types/chai-as-promised": "^7.1.0",
43
- "@types/chai-subset": "^1.3.3",
44
- "@types/colors": "^1.2.1",
45
- "@types/glob": "^7.2.0",
46
- "@types/glob-to-regexp": "^0.4.1",
47
- "@types/lodash": "^4.14.136",
48
- "@types/luxon": "^2.0.8",
49
- "@types/mocha": "^5.2.7",
50
- "@types/node": "^17.0.8",
51
- "@types/node-schedule": "^1.3.2",
52
- "@types/sinon": "^10.0.6",
53
- "chai": "^4.2.0",
54
- "chai-as-promised": "^7.1.1",
55
- "chai-subset": "^1.6.0",
56
- "mocha": "^6.1.4",
57
- "nyc": "^14.1.1",
58
- "prettier": "^1.18.2",
59
- "sinon": "^12.0.1",
60
- "ts-mocha": "^6.0.0",
61
- "ts-node": "^8.3.0",
62
- "tslint": "^5.20.1",
63
- "tslint-circular-dependencies": "^0.1.0",
64
- "tslint-config-prettier": "^1.18.0",
65
- "tslint-config-standard": "^8.0.1",
66
- "tslint-no-unused-expression-chai": "^0.1.4",
67
- "typedoc": "^0.14.2",
68
- "typescript": "^4.2.3"
69
- }
42
+ "@types/color": "^3.0.3"
43
+ },
44
+ "gitHead": "ece3619ffa482e1aaba0064e200626abc0f447bf"
70
45
  }
@@ -0,0 +1,9 @@
1
+ {
2
+ "extends": "../../tsconfig.build.json",
3
+
4
+ "compilerOptions": {
5
+ "outDir": "./lib"
6
+ },
7
+
8
+ "include": ["src/**/*"]
9
+ }