simple-log-methods 0.6.3 → 0.6.5
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/dist/domain/LogTrail.d.ts +2 -2
- package/dist/index.d.ts +4 -3
- package/dist/index.js.map +1 -1
- package/dist/logic/formatLogContentsForEnvironment.d.ts +1 -1
- package/dist/logic/formatLogContentsForEnvironment.js.map +1 -1
- package/dist/logic/generateLogMethods.d.ts +1 -1
- package/dist/logic/generateLogMethods.js.map +1 -1
- package/dist/logic/withLogTrail.d.ts +3 -3
- package/dist/logic/withLogTrail.js +3 -3
- package/dist/logic/withLogTrail.js.map +1 -1
- package/package.json +35 -33
- package/dist/logic/formatLogContentsForEnvironment.test.d.ts +0 -1
- package/dist/logic/formatLogContentsForEnvironment.test.js +0 -50
- package/dist/logic/formatLogContentsForEnvironment.test.js.map +0 -1
- package/dist/logic/generateLogMethod.test.d.ts +0 -1
- package/dist/logic/generateLogMethod.test.js +0 -50
- package/dist/logic/generateLogMethod.test.js.map +0 -1
- package/dist/logic/generateLogMethods.test.d.ts +0 -1
- package/dist/logic/generateLogMethods.test.js +0 -13
- package/dist/logic/generateLogMethods.test.js.map +0 -1
- package/dist/logic/withLogTrail.test.d.ts +0 -1
- package/dist/logic/withLogTrail.test.js +0 -211
- package/dist/logic/withLogTrail.test.js.map +0 -1
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { Procedure, ProcedureContext } from 'domain-glossary-procedure';
|
|
2
|
-
import { LogMethods } from '../logic/generateLogMethods';
|
|
1
|
+
import type { Procedure, ProcedureContext } from 'domain-glossary-procedure';
|
|
2
|
+
import type { LogMethods } from '../logic/generateLogMethods';
|
|
3
3
|
/**
|
|
4
4
|
* .what = the procedure invocation trail
|
|
5
5
|
*/
|
package/dist/index.d.ts
CHANGED
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
export { LogLevel } from './domain/constants';
|
|
2
|
-
export {
|
|
3
|
-
export {
|
|
4
|
-
export {
|
|
2
|
+
export type { ContextLogTrail, HasContextLogTrail, LogTrail, } from './domain/LogTrail';
|
|
3
|
+
export type { LogMethod } from './logic/generateLogMethod';
|
|
4
|
+
export type { LogMethods } from './logic/generateLogMethods';
|
|
5
|
+
export { generateLogMethods } from './logic/generateLogMethods';
|
|
5
6
|
export { withLogTrail } from './logic/withLogTrail';
|
package/dist/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":";;;AAAA,gDAA8C;AAArC,qGAAA,QAAQ,OAAA;
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":";;;AAAA,gDAA8C;AAArC,qGAAA,QAAQ,OAAA;AAQjB,iEAAgE;AAAvD,wHAAA,kBAAkB,OAAA;AAC3B,qDAAoD;AAA3C,4GAAA,YAAY,OAAA"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"formatLogContentsForEnvironment.js","sourceRoot":"","sources":["../../src/logic/formatLogContentsForEnvironment.ts"],"names":[],"mappings":";;;AAAA,
|
|
1
|
+
{"version":3,"file":"formatLogContentsForEnvironment.js","sourceRoot":"","sources":["../../src/logic/formatLogContentsForEnvironment.ts"],"names":[],"mappings":";;;AAAA,mDAA0E;AAC1E,+DAA4D;AAErD,MAAM,+BAA+B,GAAG,CAAC,EAC9C,KAAK,EACL,SAAS,EACT,OAAO,EACP,QAAQ,GAMT,EAAE,EAAE;IACH,MAAM,GAAG,GAAG,IAAA,yCAAmB,GAAE,CAAC;IAElC,0HAA0H;IAC1H,IAAI,GAAG,KAAK,gCAAoB,CAAC,KAAK,EAAE,CAAC;QACvC,OAAO;YACL,KAAK;YACL,SAAS;YACT,OAAO;YACP,QAAQ,EAAE,IAAI,CAAC,SAAS,CAAC,QAAQ,CAAC,EAAE,mEAAmE;SACxG,CAAC;IACJ,CAAC;IAED,qKAAqK;IACrK,IAAI,GAAG,KAAK,gCAAoB,CAAC,UAAU,EAAE,CAAC;QAC5C,OAAO,IAAI,CAAC,SAAS,CAAC;YACpB,KAAK;YACL,SAAS;YACT,OAAO;YACP,QAAQ;SACT,CAAC,CAAC;IACL,CAAC;IAED,wJAAwJ;IACxJ,IAAI,GAAG,KAAK,gCAAoB,CAAC,WAAW,EAAE,CAAC;QAC7C,OAAO;YACL,KAAK;YACL,SAAS;YACT,OAAO;YACP,QAAQ;SACT,CAAC;IACJ,CAAC;IAED,6EAA6E;IAC7E,MAAM,IAAI,KAAK,CACb,oGAAoG,CACrG,CAAC,CAAC,YAAY;AACjB,CAAC,CAAC;AA/CW,QAAA,+BAA+B,mCA+C1C"}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { LogLevel } from '../domain/constants';
|
|
2
|
-
import { LogMethod } from './generateLogMethod';
|
|
2
|
+
import { type LogMethod } from './generateLogMethod';
|
|
3
3
|
export interface LogMethods {
|
|
4
4
|
/**
|
|
5
5
|
* `error` level logs are used to indicate a critical and urgent failure that requires immediate resolution
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"generateLogMethods.js","sourceRoot":"","sources":["../../src/logic/generateLogMethods.ts"],"names":[],"mappings":";;;AAAA,mDAA+C;AAC/C,
|
|
1
|
+
{"version":3,"file":"generateLogMethods.js","sourceRoot":"","sources":["../../src/logic/generateLogMethods.ts"],"names":[],"mappings":";;;AAAA,mDAA+C;AAC/C,2DAAwE;AACxE,+GAA4G;AAgC5G;;;;GAIG;AACI,MAAM,kBAAkB,GAAG,CAAC,EACjC,eAAe,GAAG,IAAA,yFAA2C,GAAE,MAG7D,EAAE,EAAc,EAAE;IACpB,uBAAuB;IACvB,OAAO;QACL,KAAK,EAAE,IAAA,qCAAiB,EAAC,EAAE,KAAK,EAAE,oBAAQ,CAAC,KAAK,EAAE,eAAe,EAAE,CAAC;QACpE,IAAI,EAAE,IAAA,qCAAiB,EAAC,EAAE,KAAK,EAAE,oBAAQ,CAAC,IAAI,EAAE,eAAe,EAAE,CAAC;QAClE,IAAI,EAAE,IAAA,qCAAiB,EAAC,EAAE,KAAK,EAAE,oBAAQ,CAAC,IAAI,EAAE,eAAe,EAAE,CAAC;QAClE,KAAK,EAAE,IAAA,qCAAiB,EAAC,EAAE,KAAK,EAAE,oBAAQ,CAAC,KAAK,EAAE,eAAe,EAAE,CAAC;KACrE,CAAC;AACJ,CAAC,CAAC;AAZW,QAAA,kBAAkB,sBAY7B"}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { UniDuration } from '@ehmpathy/uni-time';
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
1
|
+
import { type UniDuration } from '@ehmpathy/uni-time';
|
|
2
|
+
import type { LogLevel } from '../domain/constants';
|
|
3
|
+
import type { ContextLogTrail } from '../domain/LogTrail';
|
|
4
4
|
/**
|
|
5
5
|
* enables input output logging and tracing for a method
|
|
6
6
|
*
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.withLogTrail = void 0;
|
|
4
|
-
const error_fns_1 = require("@ehmpathy/error-fns");
|
|
5
4
|
const uni_time_1 = require("@ehmpathy/uni-time");
|
|
5
|
+
const helpful_errors_1 = require("helpful-errors");
|
|
6
6
|
const type_fns_1 = require("type-fns");
|
|
7
7
|
const noOp = (...input) => input;
|
|
8
8
|
const omitContext = (...input) => input[0]; // standard pattern for args = [input, context]
|
|
@@ -28,10 +28,10 @@ const withLogTrail = (logic, { name: declaredName, log: logOptions, duration = {
|
|
|
28
28
|
const name = logic.name || declaredName || null; // use `\\` since `logic.name` returns `""` for anonymous functions
|
|
29
29
|
// if no name is identifiable, throw an error here to fail fast
|
|
30
30
|
if (!name)
|
|
31
|
-
throw new
|
|
31
|
+
throw new helpful_errors_1.UnexpectedCodePathError('could not identify name for wrapped function');
|
|
32
32
|
// if the name specified does not match the name of the function, throw an error here to fail fast
|
|
33
33
|
if (declaredName && name !== declaredName)
|
|
34
|
-
throw new
|
|
34
|
+
throw new helpful_errors_1.UnexpectedCodePathError('the natural name of the function is different than the declared name', { declaredName, naturalName: name });
|
|
35
35
|
// extract the log levels per operation
|
|
36
36
|
const logLevelInput = (typeof logOptions?.level === 'object'
|
|
37
37
|
? logOptions.level.input
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"withLogTrail.js","sourceRoot":"","sources":["../../src/logic/withLogTrail.ts"],"names":[],"mappings":";;;AAAA,
|
|
1
|
+
{"version":3,"file":"withLogTrail.js","sourceRoot":"","sources":["../../src/logic/withLogTrail.ts"],"names":[],"mappings":";;;AAAA,iDAAsE;AAMtE,mDAAyD;AACzD,uCAAuD;AAMvD,MAAM,IAAI,GAAG,CAAC,GAAG,KAAU,EAAE,EAAE,CAAC,KAAK,CAAC;AACtC,MAAM,WAAW,GAAG,CAAC,GAAG,KAAU,EAAE,EAAE,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,CAAC,+CAA+C;AAChG,MAAM,gBAAgB,GAAG,CAAC,KAAY,EAAE,EAAE,CAAC,CAAC;IAC1C,KAAK,EAAE,EAAE,OAAO,EAAE,KAAK,CAAC,OAAO,EAAE;CAClC,CAAC,CAAC;AACH,MAAM,iBAAiB,GAAG,CAAC,GAAW,EAAE,EAAE,CAAC,IAAI,CAAC,KAAK,CAAC,GAAG,GAAG,GAAG,CAAC,GAAG,GAAG,CAAC,CAAC,+CAA+C;AAEvH,MAAM,iCAAiC,GAAG,OAAO,CAAC,GAAG;KAClD,6BAA6B;IAC9B,CAAC,CAAC,QAAQ,CAAC,OAAO,CAAC,GAAG,CAAC,6BAA6B,CAAC;IACrD,CAAC,CAAC,IAAA,yBAAc,EAAC,EAAE,OAAO,EAAE,CAAC,EAAE,CAAC,CAAC;AAEnC;;;;;;GAMG;AACI,MAAM,YAAY,GAAG,CAC1B,KAAoD,EACpD,EACE,IAAI,EAAE,YAAY,EAClB,GAAG,EAAE,UAAU,EAC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AC;iBACD,KAAK,CAAC,CAAC,KAAY,EAAE,EAAE;gBACtB,QAAQ,CAAC,KAAK,CAAC,CAAC;gBAChB,MAAM,KAAK,CAAC;YACd,CAAC,CAAY,CAAC;QAElB,8EAA8E;QAC9E,SAAS,CAAC,MAAgD,CAAC,CAAC;QAC5D,OAAO,MAAM,CAAC;IAChB,CAAC,CAAC;AACJ,CAAC,CAAC;AA9NW,QAAA,YAAY,gBA8NvB"}
|
package/package.json
CHANGED
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
"name": "simple-log-methods",
|
|
3
3
|
"author": "ehmpathy",
|
|
4
4
|
"description": "a simple and opinionated logging library. plays well with aws lambda + cloudwatch.",
|
|
5
|
-
"version": "0.6.
|
|
5
|
+
"version": "0.6.5",
|
|
6
6
|
"repository": "ehmpathy/simple-log-methods",
|
|
7
7
|
"homepage": "https://github.com/ehmpathy/simple-log-methods",
|
|
8
8
|
"keywords": [
|
|
@@ -28,19 +28,21 @@
|
|
|
28
28
|
"scripts": {
|
|
29
29
|
"build:ts": "tsc -p ./tsconfig.build.json",
|
|
30
30
|
"commit:with-cli": "npx cz",
|
|
31
|
-
"fix:format:
|
|
32
|
-
"fix:format": "npm run fix:format:
|
|
33
|
-
"fix:lint": "
|
|
31
|
+
"fix:format:biome": "biome check --write src",
|
|
32
|
+
"fix:format": "npm run fix:format:biome",
|
|
33
|
+
"fix:lint": "biome check --write src",
|
|
34
|
+
"fix": "npm run fix:format && npm run fix:lint",
|
|
34
35
|
"build:clean": "rm dist/ -rf",
|
|
35
36
|
"build:compile": "tsc -p ./tsconfig.build.json",
|
|
36
37
|
"build": "npm run build:clean && npm run build:compile",
|
|
37
38
|
"test:commits": "LAST_TAG=$(git describe --tags --abbrev=0 @^ 2> /dev/null || git rev-list --max-parents=0 HEAD) && npx commitlint --from $LAST_TAG --to HEAD --verbose",
|
|
38
|
-
"test:types": "tsc -p ./tsconfig.
|
|
39
|
-
"test:format
|
|
40
|
-
"test:
|
|
41
|
-
"test:
|
|
42
|
-
"test:lint:
|
|
43
|
-
"test:lint": "
|
|
39
|
+
"test:types": "tsc -p ./tsconfig.json --noEmit",
|
|
40
|
+
"test:format": "npm run test:format:biome",
|
|
41
|
+
"test:lint:deps": "npx depcheck -c ./.depcheckrc.yml",
|
|
42
|
+
"test:format:biome": "biome format src",
|
|
43
|
+
"test:lint:biome": "biome check src --diagnostic-level=error",
|
|
44
|
+
"test:lint:biome:all": "biome check src",
|
|
45
|
+
"test:lint": "npm run test:lint:biome && npm run test:lint:deps",
|
|
44
46
|
"test:unit": "jest -c ./jest.unit.config.ts --forceExit --verbose --passWithNoTests $([ -z $THOROUGH ] && echo '--changedSince=main')",
|
|
45
47
|
"test:integration": "jest -c ./jest.integration.config.ts --forceExit --verbose --passWithNoTests $([ -z $THOROUGH ] && echo '--changedSince=main')",
|
|
46
48
|
"test:acceptance:locally": "npm run build && LOCALLY=true jest -c ./jest.acceptance.config.ts --forceExit --verbose --runInBand --passWithNoTests",
|
|
@@ -50,46 +52,46 @@
|
|
|
50
52
|
"prepublish": "npm run build",
|
|
51
53
|
"preversion": "npm run prepush",
|
|
52
54
|
"postversion": "git push origin HEAD --tags --no-verify",
|
|
53
|
-
"
|
|
54
|
-
"prepare
|
|
55
|
+
"prepare:husky": "npx husky install && chmod ug+x .husky/*",
|
|
56
|
+
"prepare": "[ -e .git ] && npm run prepare:husky || exit 0"
|
|
55
57
|
},
|
|
56
58
|
"dependencies": {
|
|
57
59
|
"@ehmpathy/error-fns": "^1.3.7",
|
|
58
60
|
"@ehmpathy/uni-time": "^1.7.4",
|
|
59
61
|
"domain-glossary-procedure": "^1.0.0",
|
|
60
|
-
"
|
|
62
|
+
"domain-objects": "0.31.3",
|
|
63
|
+
"helpful-errors": "1.5.3",
|
|
64
|
+
"type-fns": "1.21.0"
|
|
61
65
|
},
|
|
62
66
|
"devDependencies": {
|
|
63
|
-
"@
|
|
64
|
-
"@commitlint/
|
|
65
|
-
"@
|
|
66
|
-
"@
|
|
67
|
-
"@
|
|
68
|
-
"@
|
|
69
|
-
"@
|
|
70
|
-
"
|
|
67
|
+
"@biomejs/biome": "2.3.8",
|
|
68
|
+
"@commitlint/cli": "19.5.0",
|
|
69
|
+
"@commitlint/config-conventional": "19.5.0",
|
|
70
|
+
"@swc/core": "1.15.3",
|
|
71
|
+
"@swc/jest": "0.2.39",
|
|
72
|
+
"@tsconfig/node20": "20.1.5",
|
|
73
|
+
"@tsconfig/strictest": "2.0.5",
|
|
74
|
+
"@types/jest": "30.0.0",
|
|
75
|
+
"@types/node": "22.15.21",
|
|
71
76
|
"cz-conventional-changelog": "3.3.0",
|
|
72
|
-
"declapract": "^0.
|
|
73
|
-
"declapract-typescript-ehmpathy": "^0.
|
|
77
|
+
"declapract": "^0.13.0",
|
|
78
|
+
"declapract-typescript-ehmpathy": "^0.43.12",
|
|
79
|
+
"declastruct": "1.5.1",
|
|
80
|
+
"declastruct-github": "1.0.7",
|
|
74
81
|
"depcheck": "1.4.3",
|
|
75
|
-
"
|
|
76
|
-
"eslint-config-airbnb-typescript": "18.0.0",
|
|
77
|
-
"eslint-config-prettier": "8.5.0",
|
|
78
|
-
"eslint-plugin-import": "2.26.0",
|
|
79
|
-
"eslint-plugin-prettier": "4.2.1",
|
|
82
|
+
"esbuild-register": "3.6.0",
|
|
80
83
|
"husky": "8.0.3",
|
|
81
|
-
"jest": "
|
|
82
|
-
"prettier": "2.8.1",
|
|
84
|
+
"jest": "30.2.0",
|
|
83
85
|
"rhachet": "^1.13.1",
|
|
84
86
|
"rhachet-roles-ehmpathy": "^1.13.3",
|
|
85
87
|
"test-fns": "1.4.2",
|
|
86
|
-
"
|
|
87
|
-
"ts-node": "10.9.2",
|
|
88
|
+
"tsx": "4.20.6",
|
|
88
89
|
"typescript": "5.4.5"
|
|
89
90
|
},
|
|
90
91
|
"config": {
|
|
91
92
|
"commitizen": {
|
|
92
93
|
"path": "./node_modules/cz-conventional-changelog"
|
|
93
94
|
}
|
|
94
|
-
}
|
|
95
|
+
},
|
|
96
|
+
"packageManager": "pnpm@10.24.0"
|
|
95
97
|
}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export {};
|
|
@@ -1,50 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
const __1 = require("..");
|
|
4
|
-
const constants_1 = require("../domain/constants");
|
|
5
|
-
const formatLogContentsForEnvironment_1 = require("./formatLogContentsForEnvironment");
|
|
6
|
-
const identifyEnvironment_1 = require("./identifyEnvironment");
|
|
7
|
-
jest.mock('./identifyEnvironment');
|
|
8
|
-
const identifyEnvironmentMock = identifyEnvironment_1.identifyEnvironment;
|
|
9
|
-
describe('formatMetadataForEnvironment', () => {
|
|
10
|
-
it('should not stringify the contents - but should stringify the metadata - if in the local environment', () => {
|
|
11
|
-
identifyEnvironmentMock.mockReturnValue(constants_1.SupportedEnvironment.LOCAL);
|
|
12
|
-
const metadata = { name: 'bob', likes: ['oranges', 'apples'] };
|
|
13
|
-
const logContents = {
|
|
14
|
-
level: __1.LogLevel.INFO,
|
|
15
|
-
timestamp: new Date().toISOString(),
|
|
16
|
-
message: 'hello world!',
|
|
17
|
-
metadata,
|
|
18
|
-
};
|
|
19
|
-
const formatted = (0, formatLogContentsForEnvironment_1.formatLogContentsForEnvironment)(logContents);
|
|
20
|
-
expect(formatted).toEqual({
|
|
21
|
-
...logContents,
|
|
22
|
-
metadata: JSON.stringify(metadata),
|
|
23
|
-
});
|
|
24
|
-
});
|
|
25
|
-
it('should stringify the contents in the aws lambda environment', () => {
|
|
26
|
-
identifyEnvironmentMock.mockReturnValue(constants_1.SupportedEnvironment.AWS_LAMBDA);
|
|
27
|
-
const metadata = { name: 'bob', likes: ['oranges', 'apples'] };
|
|
28
|
-
const logContents = {
|
|
29
|
-
level: __1.LogLevel.INFO,
|
|
30
|
-
timestamp: new Date().toISOString(),
|
|
31
|
-
message: 'hello world!',
|
|
32
|
-
metadata,
|
|
33
|
-
};
|
|
34
|
-
const formatted = (0, formatLogContentsForEnvironment_1.formatLogContentsForEnvironment)(logContents);
|
|
35
|
-
expect(formatted).toEqual(JSON.stringify(logContents));
|
|
36
|
-
});
|
|
37
|
-
it('should not stringify the contents nor the metadata if in web browser environment', () => {
|
|
38
|
-
identifyEnvironmentMock.mockReturnValue(constants_1.SupportedEnvironment.WEB_BROWSER);
|
|
39
|
-
const metadata = { name: 'bob', likes: ['oranges', 'apples'] };
|
|
40
|
-
const logContents = {
|
|
41
|
-
level: __1.LogLevel.INFO,
|
|
42
|
-
timestamp: new Date().toISOString(),
|
|
43
|
-
message: 'hello world!',
|
|
44
|
-
metadata,
|
|
45
|
-
};
|
|
46
|
-
const formatted = (0, formatLogContentsForEnvironment_1.formatLogContentsForEnvironment)(logContents);
|
|
47
|
-
expect(formatted).toEqual(logContents);
|
|
48
|
-
});
|
|
49
|
-
});
|
|
50
|
-
//# sourceMappingURL=formatLogContentsForEnvironment.test.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"formatLogContentsForEnvironment.test.js","sourceRoot":"","sources":["../../src/logic/formatLogContentsForEnvironment.test.ts"],"names":[],"mappings":";;AAAA,0BAA8B;AAC9B,mDAA2D;AAC3D,uFAAoF;AACpF,+DAA4D;AAE5D,IAAI,CAAC,IAAI,CAAC,uBAAuB,CAAC,CAAC;AACnC,MAAM,uBAAuB,GAAG,yCAAgC,CAAC;AAEjE,QAAQ,CAAC,8BAA8B,EAAE,GAAG,EAAE;IAC5C,EAAE,CAAC,qGAAqG,EAAE,GAAG,EAAE;QAC7G,uBAAuB,CAAC,eAAe,CAAC,gCAAoB,CAAC,KAAK,CAAC,CAAC;QACpE,MAAM,QAAQ,GAAG,EAAE,IAAI,EAAE,KAAK,EAAE,KAAK,EAAE,CAAC,SAAS,EAAE,QAAQ,CAAC,EAAE,CAAC;QAC/D,MAAM,WAAW,GAAG;YAClB,KAAK,EAAE,YAAQ,CAAC,IAAI;YACpB,SAAS,EAAE,IAA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c;YACvB,QAAQ;SACT,CAAC;QACF,MAAM,SAAS,GAAG,IAAA,iEAA+B,EAAC,WAAW,CAAC,CAAC;QAC/D,MAAM,CAAC,SAAS,CAAC,CAAC,OAAO,CAAC,WAAW,CAAC,CAAC;IACzC,CAAC,CAAC,CAAC;AACL,CAAC,CAAC,CAAC"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export {};
|
|
@@ -1,50 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
const constants_1 = require("../domain/constants");
|
|
4
|
-
const generateLogMethod_1 = require("./generateLogMethod");
|
|
5
|
-
describe('generateLogMethod', () => {
|
|
6
|
-
beforeEach(() => jest.clearAllMocks());
|
|
7
|
-
it('should generate a method that outputs to console.log if below warn level', () => {
|
|
8
|
-
const spy = jest.spyOn(console, 'log');
|
|
9
|
-
const logError = (0, generateLogMethod_1.generateLogMethod)({
|
|
10
|
-
level: constants_1.LogLevel.INFO,
|
|
11
|
-
minimalLogLevel: constants_1.LogLevel.DEBUG,
|
|
12
|
-
});
|
|
13
|
-
logError('testMessage');
|
|
14
|
-
expect(spy).toHaveBeenCalledTimes(1);
|
|
15
|
-
});
|
|
16
|
-
it('should generate a method that outputs to console.warn if at or above warn level', () => {
|
|
17
|
-
const spy = jest.spyOn(console, 'warn');
|
|
18
|
-
const logError = (0, generateLogMethod_1.generateLogMethod)({
|
|
19
|
-
level: constants_1.LogLevel.ERROR,
|
|
20
|
-
minimalLogLevel: constants_1.LogLevel.DEBUG,
|
|
21
|
-
});
|
|
22
|
-
logError('testMessage');
|
|
23
|
-
expect(spy).toHaveBeenCalledTimes(1);
|
|
24
|
-
});
|
|
25
|
-
it('should generate a method that outputs timestamp, level, message, and metadata', () => {
|
|
26
|
-
const spy = jest.spyOn(console, 'warn');
|
|
27
|
-
const logError = (0, generateLogMethod_1.generateLogMethod)({
|
|
28
|
-
level: constants_1.LogLevel.ERROR,
|
|
29
|
-
minimalLogLevel: constants_1.LogLevel.DEBUG,
|
|
30
|
-
});
|
|
31
|
-
logError('testMessage', { nested: { object: true } });
|
|
32
|
-
expect(spy).toHaveBeenCalledTimes(1);
|
|
33
|
-
expect(spy).toHaveBeenCalledWith(expect.objectContaining({
|
|
34
|
-
level: constants_1.LogLevel.ERROR,
|
|
35
|
-
message: 'testMessage',
|
|
36
|
-
metadata: JSON.stringify({ nested: { object: true } }),
|
|
37
|
-
}));
|
|
38
|
-
expect(spy.mock.calls[0][0]).toHaveProperty('timestamp');
|
|
39
|
-
});
|
|
40
|
-
it('should not output anything if level is below minimum', () => {
|
|
41
|
-
const spy = jest.spyOn(console, 'log');
|
|
42
|
-
const logDebug = (0, generateLogMethod_1.generateLogMethod)({
|
|
43
|
-
level: constants_1.LogLevel.DEBUG,
|
|
44
|
-
minimalLogLevel: constants_1.LogLevel.WARN,
|
|
45
|
-
});
|
|
46
|
-
logDebug('testMessage');
|
|
47
|
-
expect(spy).not.toHaveBeenCalled();
|
|
48
|
-
});
|
|
49
|
-
});
|
|
50
|
-
//# sourceMappingURL=generateLogMethod.test.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"generateLogMethod.test.js","sourceRoot":"","sources":["../../src/logic/generateLogMethod.test.ts"],"names":[],"mappings":";;AAAA,mDAA+C;AAC/C,2DAAwD;AAExD,QAAQ,CAAC,mBAAmB,EAAE,GAAG,EAAE;IACjC,UAAU,CAAC,GAAG,EAAE,CAAC,IAAI,CAAC,aAAa,EAAE,CAAC,CAAC;IACvC,EAAE,CAAC,0EAA0E,EAAE,GAAG,EAAE;QAClF,MAAM,GAAG,GAAG,IAAI,CAAC,KAAK,CAAC,OAAO,EAAE,KAAK,CAAC,CAAC;QACvC,MAAM,QAAQ,GAAG,IAAA,qCAAiB,EAAC;YACjC,KAAK,EAAE,oBAAQ,CAAC,IAAI;YACpB,eAAe,EAAE,oBAAQ,CAAC,KAAK;SAChC,CAAC,CAAC;QACH,QAAQ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IAAI,CAAC,KAAK,CAAC,CAAC,CAAE,CAAC,CAAC,CAAC,CAAC,CAAC,cAAc,CAAC,WAAW,CAAC,CAAC;IAC5D,CAAC,CAAC,CAAC;IACH,EAAE,CAAC,sDAAsD,EAAE,GAAG,EAAE;QAC9D,MAAM,GAAG,GAAG,IAAI,CAAC,KAAK,CAAC,OAAO,EAAE,KAAK,CAAC,CAAC;QACvC,MAAM,QAAQ,GAAG,IAAA,qCAAiB,EAAC;YACjC,KAAK,EAAE,oBAAQ,CAAC,KAAK;YACrB,eAAe,EAAE,oBAAQ,CAAC,IAAI;SAC/B,CAAC,CAAC;QACH,QAAQ,CAAC,aAAa,CAAC,CAAC;QACxB,MAAM,CAAC,GAAG,CAAC,CAAC,GAAG,CAAC,gBAAgB,EAAE,CAAC;IACrC,CAAC,CAAC,CAAC;AACL,CAAC,CAAC,CAAC"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export {};
|
|
@@ -1,13 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
const generateLogMethods_1 = require("./generateLogMethods");
|
|
4
|
-
describe('generateLogMethods', () => {
|
|
5
|
-
it('should create the log methods', () => {
|
|
6
|
-
const log = (0, generateLogMethods_1.generateLogMethods)();
|
|
7
|
-
expect(log).toHaveProperty('error');
|
|
8
|
-
expect(log).toHaveProperty('warn');
|
|
9
|
-
expect(log).toHaveProperty('info');
|
|
10
|
-
expect(log).toHaveProperty('debug');
|
|
11
|
-
});
|
|
12
|
-
});
|
|
13
|
-
//# sourceMappingURL=generateLogMethods.test.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"generateLogMethods.test.js","sourceRoot":"","sources":["../../src/logic/generateLogMethods.test.ts"],"names":[],"mappings":";;AAAA,6DAA0D;AAE1D,QAAQ,CAAC,oBAAoB,EAAE,GAAG,EAAE;IAClC,EAAE,CAAC,+BAA+B,EAAE,GAAG,EAAE;QACvC,MAAM,GAAG,GAAG,IAAA,uCAAkB,GAAE,CAAC;QACjC,MAAM,CAAC,GAAG,CAAC,CAAC,cAAc,CAAC,OAAO,CAAC,CAAC;QACpC,MAAM,CAAC,GAAG,CAAC,CAAC,cAAc,CAAC,MAAM,CAAC,CAAC;QACnC,MAAM,CAAC,GAAG,CAAC,CAAC,cAAc,CAAC,MAAM,CAAC,CAAC;QACnC,MAAM,CAAC,GAAG,CAAC,CAAC,cAAc,CAAC,OAAO,CAAC,CAAC;IACtC,CAAC,CAAC,CAAC;AACL,CAAC,CAAC,CAAC"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export {};
|
|
@@ -1,211 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
const constants_1 = require("../domain/constants");
|
|
4
|
-
const withLogTrail_1 = require("./withLogTrail");
|
|
5
|
-
const createMockLogMethods = () => ({
|
|
6
|
-
debug: jest.fn(),
|
|
7
|
-
info: jest.fn(),
|
|
8
|
-
warn: jest.fn(),
|
|
9
|
-
error: jest.fn(),
|
|
10
|
-
});
|
|
11
|
-
describe('withLogTrail', () => {
|
|
12
|
-
beforeEach(() => jest.clearAllMocks());
|
|
13
|
-
describe('log.level', () => {
|
|
14
|
-
describe('default behavior (no level specified)', () => {
|
|
15
|
-
it('should use debug level for input logging', () => {
|
|
16
|
-
const mockLog = createMockLogMethods();
|
|
17
|
-
const testFn = function testFunction(input) {
|
|
18
|
-
return input.toUpperCase();
|
|
19
|
-
};
|
|
20
|
-
const wrapped = (0, withLogTrail_1.withLogTrail)(testFn, {});
|
|
21
|
-
wrapped('hello', { log: mockLog });
|
|
22
|
-
expect(mockLog.debug).toHaveBeenCalledWith('testFunction.input', expect.any(Object));
|
|
23
|
-
});
|
|
24
|
-
it('should use debug level for output logging', () => {
|
|
25
|
-
const mockLog = createMockLogMethods();
|
|
26
|
-
const testFn = function testFunction(input) {
|
|
27
|
-
return input.toUpperCase();
|
|
28
|
-
};
|
|
29
|
-
const wrapped = (0, withLogTrail_1.withLogTrail)(testFn, {});
|
|
30
|
-
wrapped('hello', { log: mockLog });
|
|
31
|
-
expect(mockLog.debug).toHaveBeenCalledWith('testFunction.output', expect.any(Object));
|
|
32
|
-
});
|
|
33
|
-
it('should use warn level for error logging', () => {
|
|
34
|
-
const mockLog = createMockLogMethods();
|
|
35
|
-
const testFn = function testFunction(_input) {
|
|
36
|
-
throw new Error('test error');
|
|
37
|
-
};
|
|
38
|
-
const wrapped = (0, withLogTrail_1.withLogTrail)(testFn, {});
|
|
39
|
-
expect(() => wrapped('hello', { log: mockLog })).toThrow('test error');
|
|
40
|
-
expect(mockLog.warn).toHaveBeenCalledWith('testFunction.error', expect.any(Object));
|
|
41
|
-
});
|
|
42
|
-
});
|
|
43
|
-
describe('single level specified', () => {
|
|
44
|
-
it('should use the specified level for input logging', () => {
|
|
45
|
-
const mockLog = createMockLogMethods();
|
|
46
|
-
const testFn = function testFunction(input) {
|
|
47
|
-
return input.toUpperCase();
|
|
48
|
-
};
|
|
49
|
-
const wrapped = (0, withLogTrail_1.withLogTrail)(testFn, { log: { level: constants_1.LogLevel.INFO } });
|
|
50
|
-
wrapped('hello', { log: mockLog });
|
|
51
|
-
expect(mockLog.info).toHaveBeenCalledWith('testFunction.input', expect.any(Object));
|
|
52
|
-
expect(mockLog.debug).not.toHaveBeenCalled();
|
|
53
|
-
});
|
|
54
|
-
it('should use the specified level for output logging', () => {
|
|
55
|
-
const mockLog = createMockLogMethods();
|
|
56
|
-
const testFn = function testFunction(input) {
|
|
57
|
-
return input.toUpperCase();
|
|
58
|
-
};
|
|
59
|
-
const wrapped = (0, withLogTrail_1.withLogTrail)(testFn, { log: { level: constants_1.LogLevel.INFO } });
|
|
60
|
-
wrapped('hello', { log: mockLog });
|
|
61
|
-
expect(mockLog.info).toHaveBeenCalledWith('testFunction.output', expect.any(Object));
|
|
62
|
-
});
|
|
63
|
-
it('should not allow single level to downgrade error logging from warn', () => {
|
|
64
|
-
const mockLog = createMockLogMethods();
|
|
65
|
-
const testFn = function testFunction(_input) {
|
|
66
|
-
throw new Error('test error');
|
|
67
|
-
};
|
|
68
|
-
// even though we specify INFO level, error logs should remain at WARN
|
|
69
|
-
const wrapped = (0, withLogTrail_1.withLogTrail)(testFn, { log: { level: constants_1.LogLevel.INFO } });
|
|
70
|
-
expect(() => wrapped('hello', { log: mockLog })).toThrow('test error');
|
|
71
|
-
expect(mockLog.warn).toHaveBeenCalledWith('testFunction.error', expect.any(Object));
|
|
72
|
-
expect(mockLog.info).not.toHaveBeenCalledWith('testFunction.error', expect.any(Object));
|
|
73
|
-
});
|
|
74
|
-
it('should not allow single debug level to downgrade error logging from warn', () => {
|
|
75
|
-
const mockLog = createMockLogMethods();
|
|
76
|
-
const testFn = function testFunction(_input) {
|
|
77
|
-
throw new Error('test error');
|
|
78
|
-
};
|
|
79
|
-
// even though we specify DEBUG level, error logs should remain at WARN
|
|
80
|
-
const wrapped = (0, withLogTrail_1.withLogTrail)(testFn, {
|
|
81
|
-
log: { level: constants_1.LogLevel.DEBUG },
|
|
82
|
-
});
|
|
83
|
-
expect(() => wrapped('hello', { log: mockLog })).toThrow('test error');
|
|
84
|
-
expect(mockLog.warn).toHaveBeenCalledWith('testFunction.error', expect.any(Object));
|
|
85
|
-
expect(mockLog.debug).not.toHaveBeenCalledWith('testFunction.error', expect.any(Object));
|
|
86
|
-
});
|
|
87
|
-
});
|
|
88
|
-
describe('object with individual levels', () => {
|
|
89
|
-
it('should use the specified input level', () => {
|
|
90
|
-
const mockLog = createMockLogMethods();
|
|
91
|
-
const testFn = function testFunction(input) {
|
|
92
|
-
return input.toUpperCase();
|
|
93
|
-
};
|
|
94
|
-
const wrapped = (0, withLogTrail_1.withLogTrail)(testFn, {
|
|
95
|
-
log: { level: { input: constants_1.LogLevel.INFO } },
|
|
96
|
-
});
|
|
97
|
-
wrapped('hello', { log: mockLog });
|
|
98
|
-
expect(mockLog.info).toHaveBeenCalledWith('testFunction.input', expect.any(Object));
|
|
99
|
-
});
|
|
100
|
-
it('should use the specified output level', () => {
|
|
101
|
-
const mockLog = createMockLogMethods();
|
|
102
|
-
const testFn = function testFunction(input) {
|
|
103
|
-
return input.toUpperCase();
|
|
104
|
-
};
|
|
105
|
-
const wrapped = (0, withLogTrail_1.withLogTrail)(testFn, {
|
|
106
|
-
log: { level: { output: constants_1.LogLevel.WARN } },
|
|
107
|
-
});
|
|
108
|
-
wrapped('hello', { log: mockLog });
|
|
109
|
-
expect(mockLog.warn).toHaveBeenCalledWith('testFunction.output', expect.any(Object));
|
|
110
|
-
});
|
|
111
|
-
it('should use the specified error level', () => {
|
|
112
|
-
const mockLog = createMockLogMethods();
|
|
113
|
-
const testFn = function testFunction(_input) {
|
|
114
|
-
throw new Error('test error');
|
|
115
|
-
};
|
|
116
|
-
const wrapped = (0, withLogTrail_1.withLogTrail)(testFn, {
|
|
117
|
-
log: { level: { error: constants_1.LogLevel.ERROR } },
|
|
118
|
-
});
|
|
119
|
-
expect(() => wrapped('hello', { log: mockLog })).toThrow('test error');
|
|
120
|
-
expect(mockLog.error).toHaveBeenCalledWith('testFunction.error', expect.any(Object));
|
|
121
|
-
});
|
|
122
|
-
it('should allow specifying different levels for each operation', () => {
|
|
123
|
-
const mockLog = createMockLogMethods();
|
|
124
|
-
const testFn = function testFunction(input) {
|
|
125
|
-
return input.toUpperCase();
|
|
126
|
-
};
|
|
127
|
-
const wrapped = (0, withLogTrail_1.withLogTrail)(testFn, {
|
|
128
|
-
log: {
|
|
129
|
-
level: {
|
|
130
|
-
input: constants_1.LogLevel.DEBUG,
|
|
131
|
-
output: constants_1.LogLevel.INFO,
|
|
132
|
-
error: constants_1.LogLevel.ERROR,
|
|
133
|
-
},
|
|
134
|
-
},
|
|
135
|
-
});
|
|
136
|
-
wrapped('hello', { log: mockLog });
|
|
137
|
-
expect(mockLog.debug).toHaveBeenCalledWith('testFunction.input', expect.any(Object));
|
|
138
|
-
expect(mockLog.info).toHaveBeenCalledWith('testFunction.output', expect.any(Object));
|
|
139
|
-
});
|
|
140
|
-
it('should default to debug for input when not specified in object', () => {
|
|
141
|
-
const mockLog = createMockLogMethods();
|
|
142
|
-
const testFn = function testFunction(input) {
|
|
143
|
-
return input.toUpperCase();
|
|
144
|
-
};
|
|
145
|
-
const wrapped = (0, withLogTrail_1.withLogTrail)(testFn, {
|
|
146
|
-
log: { level: { output: constants_1.LogLevel.INFO } },
|
|
147
|
-
});
|
|
148
|
-
wrapped('hello', { log: mockLog });
|
|
149
|
-
expect(mockLog.debug).toHaveBeenCalledWith('testFunction.input', expect.any(Object));
|
|
150
|
-
});
|
|
151
|
-
it('should default to debug for output when not specified in object', () => {
|
|
152
|
-
const mockLog = createMockLogMethods();
|
|
153
|
-
const testFn = function testFunction(input) {
|
|
154
|
-
return input.toUpperCase();
|
|
155
|
-
};
|
|
156
|
-
const wrapped = (0, withLogTrail_1.withLogTrail)(testFn, {
|
|
157
|
-
log: { level: { input: constants_1.LogLevel.INFO } },
|
|
158
|
-
});
|
|
159
|
-
wrapped('hello', { log: mockLog });
|
|
160
|
-
expect(mockLog.debug).toHaveBeenCalledWith('testFunction.output', expect.any(Object));
|
|
161
|
-
});
|
|
162
|
-
it('should default to warn for error when not specified in object', () => {
|
|
163
|
-
const mockLog = createMockLogMethods();
|
|
164
|
-
const testFn = function testFunction(_input) {
|
|
165
|
-
throw new Error('test error');
|
|
166
|
-
};
|
|
167
|
-
const wrapped = (0, withLogTrail_1.withLogTrail)(testFn, {
|
|
168
|
-
log: { level: { input: constants_1.LogLevel.INFO, output: constants_1.LogLevel.INFO } },
|
|
169
|
-
});
|
|
170
|
-
expect(() => wrapped('hello', { log: mockLog })).toThrow('test error');
|
|
171
|
-
expect(mockLog.warn).toHaveBeenCalledWith('testFunction.error', expect.any(Object));
|
|
172
|
-
});
|
|
173
|
-
});
|
|
174
|
-
describe('async functions', () => {
|
|
175
|
-
it('should use specified levels for async function input', async () => {
|
|
176
|
-
const mockLog = createMockLogMethods();
|
|
177
|
-
const testFn = async function testAsyncFunction(input) {
|
|
178
|
-
return input.toUpperCase();
|
|
179
|
-
};
|
|
180
|
-
const wrapped = (0, withLogTrail_1.withLogTrail)(testFn, {
|
|
181
|
-
log: { level: { input: constants_1.LogLevel.INFO } },
|
|
182
|
-
});
|
|
183
|
-
await wrapped('hello', { log: mockLog });
|
|
184
|
-
expect(mockLog.info).toHaveBeenCalledWith('testAsyncFunction.input', expect.any(Object));
|
|
185
|
-
});
|
|
186
|
-
it('should use specified levels for async function output', async () => {
|
|
187
|
-
const mockLog = createMockLogMethods();
|
|
188
|
-
const testFn = async function testAsyncFunction(input) {
|
|
189
|
-
return input.toUpperCase();
|
|
190
|
-
};
|
|
191
|
-
const wrapped = (0, withLogTrail_1.withLogTrail)(testFn, {
|
|
192
|
-
log: { level: { output: constants_1.LogLevel.INFO } },
|
|
193
|
-
});
|
|
194
|
-
await wrapped('hello', { log: mockLog });
|
|
195
|
-
expect(mockLog.info).toHaveBeenCalledWith('testAsyncFunction.output', expect.any(Object));
|
|
196
|
-
});
|
|
197
|
-
it('should use specified levels for async function error', async () => {
|
|
198
|
-
const mockLog = createMockLogMethods();
|
|
199
|
-
const testFn = async function testAsyncFunction(_input) {
|
|
200
|
-
throw new Error('async test error');
|
|
201
|
-
};
|
|
202
|
-
const wrapped = (0, withLogTrail_1.withLogTrail)(testFn, {
|
|
203
|
-
log: { level: { error: constants_1.LogLevel.ERROR } },
|
|
204
|
-
});
|
|
205
|
-
await expect(wrapped('hello', { log: mockLog })).rejects.toThrow('async test error');
|
|
206
|
-
expect(mockLog.error).toHaveBeenCalledWith('testAsyncFunction.error', expect.any(Object));
|
|
207
|
-
});
|
|
208
|
-
});
|
|
209
|
-
});
|
|
210
|
-
});
|
|
211
|
-
//# sourceMappingURL=withLogTrail.test.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"withLogTrail.test.js","sourceRoot":"","sources":["../../src/logic/withLogTrail.test.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