@darksheep/logger 1.0.0
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/CHANGELOG.md +31 -0
- package/README.md +191 -0
- package/package.json +44 -0
- package/src/create-logger.js +36 -0
- package/src/formatter.js +14 -0
- package/src/formatters/formatter-console.js +243 -0
- package/src/formatters/formatter-json.js +7 -0
- package/src/index.js +25 -0
- package/src/logger.js +369 -0
- package/src/replacer.js +68 -0
- package/src/replacers/buffers.js +18 -0
- package/src/replacers/error.js +40 -0
- package/src/replacers/http-client-request.js +18 -0
- package/src/replacers/http-incoming-message.js +26 -0
- package/src/replacers/http-server-response.js +16 -0
- package/src/replacers/index.js +8 -0
- package/src/replacers/long-strings.js +11 -0
- package/src/replacers/net-socket.js +21 -0
- package/src/replacers/secrets.js +50 -0
- package/src/stdout-write.js +7 -0
- package/src/utilities/colour.js +152 -0
- package/src/utilities/environment.js +61 -0
- package/src/utilities/json-path.js +17 -0
- package/src/utilities/last-callsite.js +11 -0
- package/src/utilities/log-filters.js +22 -0
- package/src/utilities/log-types.js +46 -0
- package/src/utilities/parse-filters.js +47 -0
- package/src/utilities/parse-log-level.js +32 -0
- package/src/utilities/stacktrace.js +57 -0
- package/types/assert.zod.d.ts +18 -0
- package/types/create-logger.d.ts +5 -0
- package/types/formatter.d.ts +6 -0
- package/types/formatters/formatter-console.d.ts +9 -0
- package/types/formatters/formatter-json.d.ts +5 -0
- package/types/index.d.ts +11 -0
- package/types/logger.d.ts +184 -0
- package/types/logger.test.d.ts +1 -0
- package/types/replacer.d.ts +45 -0
- package/types/replacer.test.d.ts +1 -0
- package/types/replacers/buffers.d.ts +2 -0
- package/types/replacers/buffers.test.d.ts +1 -0
- package/types/replacers/error.d.ts +37 -0
- package/types/replacers/error.test.d.ts +1 -0
- package/types/replacers/http-client-request.d.ts +3 -0
- package/types/replacers/http-client-request.test.d.ts +1 -0
- package/types/replacers/http-incoming-message.d.ts +15 -0
- package/types/replacers/http-server-response.d.ts +3 -0
- package/types/replacers/index.d.ts +8 -0
- package/types/replacers/long-strings.d.ts +2 -0
- package/types/replacers/net-socket.d.ts +3 -0
- package/types/replacers/secrets.d.ts +4 -0
- package/types/stdout-write.d.ts +5 -0
- package/types/utilities/colour.d.ts +76 -0
- package/types/utilities/environment.d.ts +25 -0
- package/types/utilities/json-path.d.ts +5 -0
- package/types/utilities/last-callsite.d.ts +9 -0
- package/types/utilities/log-filters.d.ts +12 -0
- package/types/utilities/log-types.d.ts +126 -0
- package/types/utilities/parse-filters.d.ts +9 -0
- package/types/utilities/parse-log-level.d.ts +7 -0
- package/types/utilities/stacktrace.d.ts +59 -0
|
@@ -0,0 +1,59 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @typedef {Object} Callsite
|
|
3
|
+
* @property {string} file The file name for the callsite
|
|
4
|
+
* @property {string} [relativePath] The relative path for the callsite.file
|
|
5
|
+
* @property {string} [absolutePath] The absolute path for the callsite.file
|
|
6
|
+
* @property {string} methodName The methodName from the callsite
|
|
7
|
+
* @property {number} line The line number in the file
|
|
8
|
+
* @property {number} column The column number in the file
|
|
9
|
+
*/
|
|
10
|
+
/**
|
|
11
|
+
* Get the callsite that we think is outside the package
|
|
12
|
+
* @param {string} [stack] The stacktrace to parse
|
|
13
|
+
* @returns {Callsite[]}
|
|
14
|
+
*/
|
|
15
|
+
export function parseStack(stack?: string | undefined): Callsite[];
|
|
16
|
+
export type Callsite = {
|
|
17
|
+
/**
|
|
18
|
+
* The file name for the callsite
|
|
19
|
+
*/
|
|
20
|
+
/**
|
|
21
|
+
* The file name for the callsite
|
|
22
|
+
*/
|
|
23
|
+
file: string;
|
|
24
|
+
/**
|
|
25
|
+
* The relative path for the callsite.file
|
|
26
|
+
*/
|
|
27
|
+
/**
|
|
28
|
+
* The relative path for the callsite.file
|
|
29
|
+
*/
|
|
30
|
+
relativePath?: string | undefined;
|
|
31
|
+
/**
|
|
32
|
+
* The absolute path for the callsite.file
|
|
33
|
+
*/
|
|
34
|
+
/**
|
|
35
|
+
* The absolute path for the callsite.file
|
|
36
|
+
*/
|
|
37
|
+
absolutePath?: string | undefined;
|
|
38
|
+
/**
|
|
39
|
+
* The methodName from the callsite
|
|
40
|
+
*/
|
|
41
|
+
/**
|
|
42
|
+
* The methodName from the callsite
|
|
43
|
+
*/
|
|
44
|
+
methodName: string;
|
|
45
|
+
/**
|
|
46
|
+
* The line number in the file
|
|
47
|
+
*/
|
|
48
|
+
/**
|
|
49
|
+
* The line number in the file
|
|
50
|
+
*/
|
|
51
|
+
line: number;
|
|
52
|
+
/**
|
|
53
|
+
* The column number in the file
|
|
54
|
+
*/
|
|
55
|
+
/**
|
|
56
|
+
* The column number in the file
|
|
57
|
+
*/
|
|
58
|
+
column: number;
|
|
59
|
+
};
|