@golemio/validator 0.2.4 → 0.2.5-dev.695207902
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/README.md +2 -2
- package/dist/Logger.d.ts +7 -8
- package/dist/Logger.js +27 -29
- package/dist/Logger.js.map +1 -1
- package/package.json +3 -5
package/README.md
CHANGED
|
@@ -51,9 +51,9 @@ import { Validator } from "@golemio/validator";
|
|
|
51
51
|
|
|
52
52
|
## Logging
|
|
53
53
|
|
|
54
|
-
Logging uses `
|
|
54
|
+
Logging uses `pino` for standard logging with levels and `debug` (https://www.npmjs.com/package/debug) for debugging.
|
|
55
55
|
|
|
56
|
-
All logs with `silly` and `debug` level are printed as standard log (if appropriate log level is set) using
|
|
56
|
+
All logs with `silly` and `debug` level are printed as standard log (if appropriate log level is set) using `pino` as well as using `debug` module with `"golemio:validator"` settings.
|
|
57
57
|
|
|
58
58
|
You can set both `LOG_LEVEL` and `DEBUG` settings in ENV variables.
|
|
59
59
|
|
package/dist/Logger.d.ts
CHANGED
|
@@ -1,10 +1,9 @@
|
|
|
1
|
-
import
|
|
2
|
-
export
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
}
|
|
1
|
+
import pino from "pino";
|
|
2
|
+
export declare type ILogger = pino.Logger<{
|
|
3
|
+
customLevels: {
|
|
4
|
+
verbose: number;
|
|
5
|
+
silly: number;
|
|
6
|
+
};
|
|
7
|
+
}>;
|
|
9
8
|
declare const logger: ILogger;
|
|
10
9
|
export { logger as log };
|
package/dist/Logger.js
CHANGED
|
@@ -1,38 +1,36 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
+
var _a;
|
|
2
3
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
4
|
exports.log = void 0;
|
|
4
|
-
/// Setup for logger - uses Winston logger for standard logging output and debug module for debugging logs
|
|
5
|
-
const config_1 = require("./config");
|
|
6
5
|
const debug = require("debug");
|
|
7
|
-
const
|
|
8
|
-
const
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
}
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
6
|
+
const pino_1 = require("pino");
|
|
7
|
+
const config_1 = require("./config");
|
|
8
|
+
const logger = (0, pino_1.default)({
|
|
9
|
+
level: ((_a = config_1.default.log_level) === null || _a === void 0 ? void 0 : _a.toLowerCase()) || "info",
|
|
10
|
+
customLevels: {
|
|
11
|
+
silly: 5,
|
|
12
|
+
verbose: 25,
|
|
13
|
+
},
|
|
14
|
+
base: undefined,
|
|
15
|
+
formatters: {
|
|
16
|
+
level: (label) => {
|
|
17
|
+
return { level: label };
|
|
18
|
+
},
|
|
19
|
+
},
|
|
20
|
+
errorKey: "error",
|
|
21
|
+
messageKey: "message",
|
|
22
|
+
timestamp: pino_1.default.stdTimeFunctions.isoTime,
|
|
23
23
|
});
|
|
24
|
-
const logger = winstonLogger;
|
|
25
24
|
exports.log = logger;
|
|
26
|
-
const
|
|
27
|
-
const
|
|
28
|
-
|
|
29
|
-
logger.silly = (
|
|
30
|
-
debugLog(
|
|
31
|
-
|
|
25
|
+
const loggerDebugLog = logger.debug.bind(logger);
|
|
26
|
+
const loggerSillyLog = logger.silly.bind(logger);
|
|
27
|
+
const debugLog = debug("golemio:validator");
|
|
28
|
+
logger.silly = (...args) => {
|
|
29
|
+
debugLog.apply(null, args);
|
|
30
|
+
loggerSillyLog.apply(null, args);
|
|
32
31
|
};
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
winstonDebugLog(formatter);
|
|
32
|
+
logger.debug = (...args) => {
|
|
33
|
+
debugLog.apply(null, args);
|
|
34
|
+
loggerDebugLog.apply(null, args);
|
|
37
35
|
};
|
|
38
36
|
//# sourceMappingURL=Logger.js.map
|
package/dist/Logger.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Logger.js","sourceRoot":"","sources":["../src/Logger.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"Logger.js","sourceRoot":"","sources":["../src/Logger.ts"],"names":[],"mappings":";;;;AAAA,+BAA+B;AAC/B,+BAAwB;AACxB,qCAA8B;AAI9B,MAAM,MAAM,GAAY,IAAA,cAAI,EAAC;IACzB,KAAK,EAAE,CAAA,MAAA,gBAAM,CAAC,SAAS,0CAAE,WAAW,EAAE,KAAI,MAAM;IAChD,YAAY,EAAE;QACV,KAAK,EAAE,CAAC;QACR,OAAO,EAAE,EAAE;KACd;IACD,IAAI,EAAE,SAAS;IACf,UAAU,EAAE;QACR,KAAK,EAAE,CAAC,KAAa,EAAE,EAAE;YACrB,OAAO,EAAE,KAAK,EAAE,KAAK,EAAE,CAAC;QAC5B,CAAC;KACJ;IACD,QAAQ,EAAE,OAAO;IACjB,UAAU,EAAE,SAAS;IACrB,SAAS,EAAE,cAAI,CAAC,gBAAgB,CAAC,OAAO;CAC3C,CAAC,CAAC;AAiBgB,qBAAG;AAftB,MAAM,cAAc,GAAG,MAAM,CAAC,KAAK,CAAC,IAAI,CAAC,MAAM,CAAC,CAAC;AACjD,MAAM,cAAc,GAAG,MAAM,CAAC,KAAK,CAAC,IAAI,CAAC,MAAM,CAAC,CAAC;AAEjD,MAAM,QAAQ,GAAmB,KAAK,CAAC,mBAAmB,CAAC,CAAC;AAE5D,MAAM,CAAC,KAAK,GAAG,CAAC,GAAG,IAAS,EAAQ,EAAE;IAClC,QAAQ,CAAC,KAAK,CAAC,IAAI,EAAE,IAAI,CAAC,CAAC;IAC3B,cAAc,CAAC,KAAK,CAAC,IAAI,EAAE,IAAI,CAAC,CAAC;AACrC,CAAC,CAAC;AAEF,MAAM,CAAC,KAAK,GAAG,CAAC,GAAG,IAAS,EAAQ,EAAE;IAClC,QAAQ,CAAC,KAAK,CAAC,IAAI,EAAE,IAAI,CAAC,CAAC;IAC3B,cAAc,CAAC,KAAK,CAAC,IAAI,EAAE,IAAI,CAAC,CAAC;AACrC,CAAC,CAAC"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@golemio/validator",
|
|
3
|
-
"version": "0.2.
|
|
3
|
+
"version": "0.2.5-dev.695207902",
|
|
4
4
|
"description": "Library of Validator classes of the Golemio Data Platform System",
|
|
5
5
|
"main": "dist/index.js",
|
|
6
6
|
"types": "dist/index.d.ts",
|
|
@@ -29,7 +29,6 @@
|
|
|
29
29
|
"@types/mocha": "^5.2.5",
|
|
30
30
|
"@types/node": "^14.17.15",
|
|
31
31
|
"@types/sinon": "^7.0.13",
|
|
32
|
-
"@types/winston": "^2.4.4",
|
|
33
32
|
"chai": "^4.2.0",
|
|
34
33
|
"chai-as-promised": "^7.1.1",
|
|
35
34
|
"eslint": "^8.13.0",
|
|
@@ -47,11 +46,10 @@
|
|
|
47
46
|
"debug": "^4.1.1",
|
|
48
47
|
"dotenv": "^8.0.0",
|
|
49
48
|
"mongoose": "^6.5.3",
|
|
50
|
-
"
|
|
49
|
+
"pino": "^8.7.0"
|
|
51
50
|
},
|
|
52
51
|
"resolutions": {
|
|
53
|
-
"minimist": "^1.2.6"
|
|
54
|
-
"winston": "^3.2.2"
|
|
52
|
+
"minimist": "^1.2.6"
|
|
55
53
|
},
|
|
56
54
|
"nyc": {
|
|
57
55
|
"check-coverage": true,
|