@grest-ts/logger 0.0.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.
Files changed (64) hide show
  1. package/LICENSE +21 -0
  2. package/README.md +38 -0
  3. package/dist/src/GGLog.d.ts +50 -0
  4. package/dist/src/GGLog.d.ts.map +1 -0
  5. package/dist/src/GGLog.js +150 -0
  6. package/dist/src/GGLog.js.map +1 -0
  7. package/dist/src/GGLogger.d.ts +9 -0
  8. package/dist/src/GGLogger.d.ts.map +1 -0
  9. package/dist/src/GGLogger.js +2 -0
  10. package/dist/src/GGLogger.js.map +1 -0
  11. package/dist/src/IAsyncLocalStorage.d.ts +8 -0
  12. package/dist/src/IAsyncLocalStorage.d.ts.map +1 -0
  13. package/dist/src/IAsyncLocalStorage.js +38 -0
  14. package/dist/src/IAsyncLocalStorage.js.map +1 -0
  15. package/dist/src/index-browser.d.ts +5 -0
  16. package/dist/src/index-browser.d.ts.map +1 -0
  17. package/dist/src/index-browser.js +5 -0
  18. package/dist/src/index-browser.js.map +1 -0
  19. package/dist/src/index-node.d.ts +5 -0
  20. package/dist/src/index-node.d.ts.map +1 -0
  21. package/dist/src/index-node.js +5 -0
  22. package/dist/src/index-node.js.map +1 -0
  23. package/dist/src/tsconfig.json +17 -0
  24. package/dist/src/types.d.ts +23 -0
  25. package/dist/src/types.d.ts.map +1 -0
  26. package/dist/src/types.js +12 -0
  27. package/dist/src/types.js.map +1 -0
  28. package/dist/testkit/GGLogCommands.d.ts +19 -0
  29. package/dist/testkit/GGLogCommands.d.ts.map +1 -0
  30. package/dist/testkit/GGLogCommands.js +31 -0
  31. package/dist/testkit/GGLogCommands.js.map +1 -0
  32. package/dist/testkit/GGLogCursor.d.ts +30 -0
  33. package/dist/testkit/GGLogCursor.d.ts.map +1 -0
  34. package/dist/testkit/GGLogCursor.js +62 -0
  35. package/dist/testkit/GGLogCursor.js.map +1 -0
  36. package/dist/testkit/GGLogInterceptor.d.ts +24 -0
  37. package/dist/testkit/GGLogInterceptor.d.ts.map +1 -0
  38. package/dist/testkit/GGLogInterceptor.js +109 -0
  39. package/dist/testkit/GGLogInterceptor.js.map +1 -0
  40. package/dist/testkit/GGLogSelector.d.ts +44 -0
  41. package/dist/testkit/GGLogSelector.d.ts.map +1 -0
  42. package/dist/testkit/GGLogSelector.js +55 -0
  43. package/dist/testkit/GGLogSelector.js.map +1 -0
  44. package/dist/testkit/GGLogWith.d.ts +13 -0
  45. package/dist/testkit/GGLogWith.d.ts.map +1 -0
  46. package/dist/testkit/GGLogWith.js +18 -0
  47. package/dist/testkit/GGLogWith.js.map +1 -0
  48. package/dist/testkit/GGTestLogger.d.ts +51 -0
  49. package/dist/testkit/GGTestLogger.d.ts.map +1 -0
  50. package/dist/testkit/GGTestLogger.js +102 -0
  51. package/dist/testkit/GGTestLogger.js.map +1 -0
  52. package/dist/testkit/index-testkit.d.ts +7 -0
  53. package/dist/testkit/index-testkit.d.ts.map +1 -0
  54. package/dist/testkit/index-testkit.js +18 -0
  55. package/dist/testkit/index-testkit.js.map +1 -0
  56. package/dist/tsconfig.publish.tsbuildinfo +1 -0
  57. package/package.json +62 -0
  58. package/src/GGLog.ts +197 -0
  59. package/src/GGLogger.ts +9 -0
  60. package/src/IAsyncLocalStorage.ts +53 -0
  61. package/src/index-browser.ts +5 -0
  62. package/src/index-node.ts +4 -0
  63. package/src/tsconfig.json +17 -0
  64. package/src/types.ts +23 -0
@@ -0,0 +1,24 @@
1
+ import { LogLevel } from "@grest-ts/logger";
2
+ import { GGTestRuntime, IGGTestInterceptor } from "@grest-ts/testkit";
3
+ import { LogMatcher } from "./GGLogCursor";
4
+ export declare class GGLogInterceptor implements IGGTestInterceptor {
5
+ private readonly runtimes;
6
+ private readonly matcher;
7
+ private readonly minLevel?;
8
+ private readonly definedInSourceFile;
9
+ private cursors;
10
+ private found;
11
+ private polling;
12
+ private validationError?;
13
+ constructor(runtimes: GGTestRuntime[], matcher: LogMatcher, minLevel: LogLevel | undefined, definedInSourceFile: string);
14
+ register(): void;
15
+ unregister(): void;
16
+ validate(): Promise<void>;
17
+ getMockValidationError(): Error | undefined;
18
+ isCalled(): boolean;
19
+ private pollForMatch;
20
+ private retrieveAllLogs;
21
+ private toSerializable;
22
+ private describeExpectation;
23
+ }
24
+ //# sourceMappingURL=GGLogInterceptor.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"GGLogInterceptor.d.ts","sourceRoot":"","sources":["../../testkit/GGLogInterceptor.ts"],"names":[],"mappings":"AAAA,OAAO,EAAC,QAAQ,EAAC,MAAM,kBAAkB,CAAC;AAC1C,OAAO,EAAc,aAAa,EAAE,kBAAkB,EAAC,MAAM,mBAAmB,CAAC;AAEjF,OAAO,EAAC,UAAU,EAAC,MAAM,eAAe,CAAC;AAGzC,qBAAa,gBAAiB,YAAW,kBAAkB;IAEvD,OAAO,CAAC,QAAQ,CAAC,QAAQ,CAAkB;IAC3C,OAAO,CAAC,QAAQ,CAAC,OAAO,CAAa;IACrC,OAAO,CAAC,QAAQ,CAAC,QAAQ,CAAC,CAAW;IACrC,OAAO,CAAC,QAAQ,CAAC,mBAAmB,CAAS;IAE7C,OAAO,CAAC,OAAO,CAAyC;IACxD,OAAO,CAAC,KAAK,CAAkB;IAC/B,OAAO,CAAC,OAAO,CAAkB;IACjC,OAAO,CAAC,eAAe,CAAC,CAAQ;gBAEpB,QAAQ,EAAE,aAAa,EAAE,EAAE,OAAO,EAAE,UAAU,EAAE,QAAQ,EAAE,QAAQ,GAAG,SAAS,EAAE,mBAAmB,EAAE,MAAM;IAOvH,QAAQ,IAAI,IAAI;IAShB,UAAU,IAAI,IAAI;IAGZ,QAAQ,IAAI,OAAO,CAAC,IAAI,CAAC;IAkB/B,sBAAsB,IAAI,KAAK,GAAG,SAAS;IAI3C,QAAQ,IAAI,OAAO;YAcL,YAAY;YAsBZ,eAAe;IAiB7B,OAAO,CAAC,cAAc;IAUtB,OAAO,CAAC,mBAAmB;CAS9B"}
@@ -0,0 +1,109 @@
1
+ import { LogLevel } from "@grest-ts/logger";
2
+ import { GGTestError } from "@grest-ts/testkit";
3
+ import { GGLogIPC } from "./GGLogCommands.js";
4
+ export class GGLogInterceptor {
5
+ runtimes;
6
+ matcher;
7
+ minLevel;
8
+ definedInSourceFile;
9
+ cursors = new Map();
10
+ found = false;
11
+ polling = false;
12
+ validationError;
13
+ constructor(runtimes, matcher, minLevel, definedInSourceFile) {
14
+ this.runtimes = runtimes;
15
+ this.matcher = matcher;
16
+ this.minLevel = minLevel;
17
+ this.definedInSourceFile = definedInSourceFile;
18
+ }
19
+ register() {
20
+ // Get cursor positions from each runtime
21
+ for (const runtime of this.runtimes) {
22
+ runtime.sendCommand(GGLogIPC.worker.getCursor, undefined).then(index => {
23
+ this.cursors.set(runtime, index);
24
+ });
25
+ }
26
+ }
27
+ unregister() {
28
+ }
29
+ async validate() {
30
+ // Do a final poll to catch any logs we might have missed
31
+ await this.pollForMatch();
32
+ if (!this.found) {
33
+ // Get all logs for error message
34
+ const allLogs = await this.retrieveAllLogs();
35
+ this.validationError = new GGTestError({
36
+ test: "Expected log entry not found",
37
+ expected: this.describeExpectation(),
38
+ received: allLogs.length === 0
39
+ ? "No logs captured"
40
+ : allLogs.map(l => `[${LogLevel[l.level]}] ${l.contextName}: ${l.message}`).join("\n"),
41
+ sourceFile: this.definedInSourceFile
42
+ });
43
+ }
44
+ }
45
+ getMockValidationError() {
46
+ return this.validationError;
47
+ }
48
+ isCalled() {
49
+ if (this.found) {
50
+ return true;
51
+ }
52
+ // Trigger async poll if not already polling
53
+ if (!this.polling) {
54
+ this.polling = true;
55
+ this.pollForMatch().finally(() => {
56
+ this.polling = false;
57
+ });
58
+ }
59
+ return this.found;
60
+ }
61
+ async pollForMatch() {
62
+ if (this.found)
63
+ return;
64
+ const serializable = this.toSerializable(this.matcher);
65
+ const results = await Promise.all(this.runtimes.map(async (runtime) => {
66
+ const fromIndex = this.cursors.get(runtime) ?? 0;
67
+ return runtime.sendCommand(GGLogIPC.worker.findFrom, {
68
+ fromIndex,
69
+ matcher: serializable,
70
+ minLevel: this.minLevel
71
+ });
72
+ }));
73
+ const match = results.find((r) => r !== null);
74
+ if (match) {
75
+ this.found = true;
76
+ }
77
+ }
78
+ async retrieveAllLogs() {
79
+ const allLogs = [];
80
+ await Promise.all(this.runtimes.map(async (runtime) => {
81
+ const fromIndex = this.cursors.get(runtime) ?? 0;
82
+ const logs = await runtime.sendCommand(GGLogIPC.worker.retrieveFrom, {
83
+ fromIndex,
84
+ minLevel: this.minLevel
85
+ });
86
+ allLogs.push(...logs);
87
+ }));
88
+ return allLogs.sort((a, b) => a.timestamp - b.timestamp);
89
+ }
90
+ toSerializable(matcher) {
91
+ if (typeof matcher === 'string') {
92
+ return { type: 'string', value: matcher };
93
+ }
94
+ if (matcher instanceof RegExp) {
95
+ return { type: 'regex', pattern: matcher.source, flags: matcher.flags };
96
+ }
97
+ return { type: 'object', value: matcher };
98
+ }
99
+ describeExpectation() {
100
+ if (typeof this.matcher === 'string') {
101
+ return `Log containing: "${this.matcher}"`;
102
+ }
103
+ if (this.matcher instanceof RegExp) {
104
+ return `Log matching: ${this.matcher}`;
105
+ }
106
+ return `Log matching: ${JSON.stringify(this.matcher)}`;
107
+ }
108
+ }
109
+ //# sourceMappingURL=GGLogInterceptor.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"GGLogInterceptor.js","sourceRoot":"","sources":["../../testkit/GGLogInterceptor.ts"],"names":[],"mappings":"AAAA,OAAO,EAAC,QAAQ,EAAC,MAAM,kBAAkB,CAAC;AAC1C,OAAO,EAAC,WAAW,EAAoC,MAAM,mBAAmB,CAAC;AAGjF,OAAO,EAAC,QAAQ,EAAC,MAAM,iBAAiB,CAAC;AAEzC,MAAM,OAAO,gBAAgB;IAER,QAAQ,CAAkB;IAC1B,OAAO,CAAa;IACpB,QAAQ,CAAY;IACpB,mBAAmB,CAAS;IAErC,OAAO,GAA+B,IAAI,GAAG,EAAE,CAAC;IAChD,KAAK,GAA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nC,OAAO,oBAAoB,IAAI,CAAC,OAAO,GAAG,CAAC;QAC/C,CAAC;QACD,IAAI,IAAI,CAAC,OAAO,YAAY,MAAM,EAAE,CAAC;YACjC,OAAO,iBAAiB,IAAI,CAAC,OAAO,EAAE,CAAC;QAC3C,CAAC;QACD,OAAO,iBAAiB,IAAI,CAAC,SAAS,CAAC,IAAI,CAAC,OAAO,CAAC,EAAE,CAAC;IAC3D,CAAC;CACJ"}
@@ -0,0 +1,44 @@
1
+ import { LogLevel } from "@grest-ts/logger";
2
+ import { RuntimeConstructor, GGTestSelectorExtension } from "@grest-ts/testkit";
3
+ import { GGLogWith } from "./GGLogWith";
4
+ import { GGLogCursor, LogMatcher } from "./GGLogCursor";
5
+ /**
6
+ * Logs accessor for selected runtimes.
7
+ * Provides methods to query and search logs during tests.
8
+ *
9
+ * @example
10
+ * // Get a cursor, do action, search for log
11
+ * const checklist = t.get(ChecklistRuntime);
12
+ * const cursor = await checklist.logs.cursor();
13
+ * await alice.doSomething();
14
+ * const match = await cursor.find("expected message");
15
+ * expect(match).toBeDefined();
16
+ *
17
+ * // Or use with() pattern for inline expectations
18
+ * await alice.doSomething()
19
+ * .with(checklist.logs.expect("expected message"));
20
+ */
21
+ export declare class GGLogSelector extends GGTestSelectorExtension {
22
+ static readonly PROPERTY_NAME = "logs";
23
+ /**
24
+ * Get a cursor marking the current log position.
25
+ * Use this to query logs that occur after this point.
26
+ */
27
+ cursor(): Promise<GGLogCursor>;
28
+ /**
29
+ * Get a cursor positioned at the start (index 0) to retrieve all logs
30
+ * including those from startup. Useful for testing startup order.
31
+ */
32
+ fromStart(): GGLogCursor;
33
+ /**
34
+ * Create a log expectation for use with .with() pattern.
35
+ */
36
+ expect(matcher: LogMatcher, minLevel?: LogLevel): GGLogWith;
37
+ }
38
+ declare module "@grest-ts/testkit" {
39
+ interface SelectorExtensions<T extends RuntimeConstructor[]> {
40
+ logs: GGLogSelector;
41
+ }
42
+ }
43
+ export type _RuntimeConstructorRef = RuntimeConstructor;
44
+ //# sourceMappingURL=GGLogSelector.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"GGLogSelector.d.ts","sourceRoot":"","sources":["../../testkit/GGLogSelector.ts"],"names":[],"mappings":"AAAA,OAAO,EAAC,QAAQ,EAAC,MAAM,kBAAkB,CAAC;AAC1C,OAAO,EAAC,kBAAkB,EAAkB,uBAAuB,EAAC,MAAM,mBAAmB,CAAC;AAC9F,OAAO,EAAC,SAAS,EAAC,MAAM,aAAa,CAAC;AACtC,OAAO,EAAC,WAAW,EAAE,UAAU,EAAC,MAAM,eAAe,CAAC;AAGtD;;;;;;;;;;;;;;;GAeG;AACH,qBAAa,aAAc,SAAQ,uBAAuB;IAEtD,gBAAuB,aAAa,UAAU;IAE9C;;;OAGG;IACG,MAAM,IAAI,OAAO,CAAC,WAAW,CAAC;IAapC;;;OAGG;IACH,SAAS,IAAI,WAAW;IAQxB;;OAEG;IACH,MAAM,CAAC,OAAO,EAAE,UAAU,EAAE,QAAQ,CAAC,EAAE,QAAQ,GAAG,SAAS;CAG9D;AAGD,OAAO,QAAQ,mBAAmB,CAAC;IAE/B,UAAU,kBAAkB,CAAC,CAAC,SAAS,kBAAkB,EAAE;QACvD,IAAI,EAAE,aAAa,CAAC;KACvB;CACJ;AAGD,MAAM,MAAM,sBAAsB,GAAG,kBAAkB,CAAC"}
@@ -0,0 +1,55 @@
1
+ import { GGTestSelector, GGTestSelectorExtension } from "@grest-ts/testkit";
2
+ import { GGLogWith } from "./GGLogWith.js";
3
+ import { GGLogCursor } from "./GGLogCursor.js";
4
+ import { GGLogIPC } from "./GGLogCommands.js";
5
+ /**
6
+ * Logs accessor for selected runtimes.
7
+ * Provides methods to query and search logs during tests.
8
+ *
9
+ * @example
10
+ * // Get a cursor, do action, search for log
11
+ * const checklist = t.get(ChecklistRuntime);
12
+ * const cursor = await checklist.logs.cursor();
13
+ * await alice.doSomething();
14
+ * const match = await cursor.find("expected message");
15
+ * expect(match).toBeDefined();
16
+ *
17
+ * // Or use with() pattern for inline expectations
18
+ * await alice.doSomething()
19
+ * .with(checklist.logs.expect("expected message"));
20
+ */
21
+ export class GGLogSelector extends GGTestSelectorExtension {
22
+ static PROPERTY_NAME = "logs";
23
+ /**
24
+ * Get a cursor marking the current log position.
25
+ * Use this to query logs that occur after this point.
26
+ */
27
+ async cursor() {
28
+ const cursors = new Map();
29
+ await Promise.all(this.runtimes.map(async (runtime) => {
30
+ const index = await runtime.sendCommand(GGLogIPC.worker.getCursor, undefined);
31
+ cursors.set(runtime, index);
32
+ }));
33
+ return new GGLogCursor(this.runtimes, cursors);
34
+ }
35
+ /**
36
+ * Get a cursor positioned at the start (index 0) to retrieve all logs
37
+ * including those from startup. Useful for testing startup order.
38
+ */
39
+ fromStart() {
40
+ const cursors = new Map();
41
+ for (const runtime of this.runtimes) {
42
+ cursors.set(runtime, 0);
43
+ }
44
+ return new GGLogCursor(this.runtimes, cursors);
45
+ }
46
+ /**
47
+ * Create a log expectation for use with .with() pattern.
48
+ */
49
+ expect(matcher, minLevel) {
50
+ return new GGLogWith(this.runtimes, matcher, minLevel);
51
+ }
52
+ }
53
+ // Register the extension
54
+ GGTestSelector.addExtension(GGLogSelector);
55
+ //# sourceMappingURL=GGLogSelector.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"GGLogSelector.js","sourceRoot":"","sources":["../../testkit/GGLogSelector.ts"],"names":[],"mappings":"AACA,OAAO,EAAqB,cAAc,EAAE,uBAAuB,EAAC,MAAM,mBAAmB,CAAC;AAC9F,OAAO,EAAC,SAAS,EAAC,MAAM,aAAa,CAAC;AACtC,OAAO,EAAC,WAAW,EAAa,MAAM,eAAe,CAAC;AACtD,OAAO,EAAC,QAAQ,EAAC,MAAM,iBAAiB,CAAC;AAEzC;;;;;;;;;;;;;;;GAeG;AACH,MAAM,OAAO,aAAc,SAAQ,uBAAuB;IAE/C,MAAM,CAAU,aAAa,GAAG,MAAM,CAAC;IAE9C;;;OAGG;IACH,KAAK,CAAC,MAAM;QACR,MAAM,OAAO,GAAG,IAAI,GAAG,EAAwC,CAAC;QAEhE,MAAM,OAAO,CAAC,GAAG,CACb,IAAI,CAAC,QAAQ,CAAC,GAAG,CAAC,KAAK,EAAE,OAAO,EAAE,EAAE;YAChC,MAAM,KAAK,GAAG,MAAM,OAAO,CAAC,WAAW,CAAC,QAAQ,CAAC,MAAM,CAAC,SAAS,EAAE,SAAS,CAAC,CAAC;YAC9E,OAAO,CAAC,GAAG,CAAC,OAAO,EAAE,KAAK,CAAC,CAAC;QAChC,CAAC,CAAC,CACL,CAAC;QAEF,OAAO,IAAI,WAAW,CAAC,IAAI,CAAC,QAAQ,EAAE,OAAO,CAAC,CAAC;IACnD,CAAC;IAED;;;OAGG;IACH,SAAS;QACL,MAAM,OAAO,GAAG,IAAI,GAAG,EAAwC,CAAC;QAChE,KAAK,MAAM,OAAO,IAAI,IAAI,CAAC,QAAQ,EAAE,CAAC;YAClC,OAAO,CAAC,GAAG,CAAC,OAAO,EAAE,CAAC,CAAC,CAAC;QAC5B,CAAC;QACD,OAAO,IAAI,WAAW,CAAC,IAAI,CAAC,QAAQ,EAAE,OAAO,CAAC,CAAC;IACnD,CAAC;IAED;;OAEG;IACH,MAAM,CAAC,OAAmB,EAAE,QAAmB;QAC3C,OAAO,IAAI,SAAS,CAAC,IAAI,CAAC,QAAQ,EAAE,OAAO,EAAE,QAAQ,CAAC,CAAC;IAC3D,CAAC;;AAcL,yBAAyB;AACzB,cAAc,CAAC,YAAY,CAAC,aAAa,CAAC,CAAC"}
@@ -0,0 +1,13 @@
1
+ import { LogLevel } from "@grest-ts/logger";
2
+ import { IGGTestWith, GGTestRuntime } from "@grest-ts/testkit";
3
+ import { GGLogInterceptor } from "./GGLogInterceptor";
4
+ import { LogMatcher } from "./GGLogCursor";
5
+ export declare class GGLogWith implements IGGTestWith {
6
+ private readonly runtimes;
7
+ private readonly matcher;
8
+ private readonly minLevel?;
9
+ private readonly definedInSourceFile;
10
+ constructor(runtimes: GGTestRuntime[], matcher: LogMatcher, minLevel?: LogLevel);
11
+ createInterceptor(): GGLogInterceptor;
12
+ }
13
+ //# sourceMappingURL=GGLogWith.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"GGLogWith.d.ts","sourceRoot":"","sources":["../../testkit/GGLogWith.ts"],"names":[],"mappings":"AAAA,OAAO,EAAC,QAAQ,EAAC,MAAM,kBAAkB,CAAC;AAC1C,OAAO,EAAC,WAAW,EAA0B,aAAa,EAAC,MAAM,mBAAmB,CAAC;AACrF,OAAO,EAAC,gBAAgB,EAAC,MAAM,oBAAoB,CAAC;AACpD,OAAO,EAAC,UAAU,EAAC,MAAM,eAAe,CAAC;AAEzC,qBAAa,SAAU,YAAW,WAAW;IAEzC,OAAO,CAAC,QAAQ,CAAC,QAAQ,CAAkB;IAC3C,OAAO,CAAC,QAAQ,CAAC,OAAO,CAAa;IACrC,OAAO,CAAC,QAAQ,CAAC,QAAQ,CAAC,CAAW;IACrC,OAAO,CAAC,QAAQ,CAAC,mBAAmB,CAAS;gBAEjC,QAAQ,EAAE,aAAa,EAAE,EAAE,OAAO,EAAE,UAAU,EAAE,QAAQ,CAAC,EAAE,QAAQ;IAO/E,iBAAiB,IAAI,gBAAgB;CAGxC"}
@@ -0,0 +1,18 @@
1
+ import { captureStackSourceFile } from "@grest-ts/testkit";
2
+ import { GGLogInterceptor } from "./GGLogInterceptor.js";
3
+ export class GGLogWith {
4
+ runtimes;
5
+ matcher;
6
+ minLevel;
7
+ definedInSourceFile;
8
+ constructor(runtimes, matcher, minLevel) {
9
+ this.runtimes = runtimes;
10
+ this.matcher = matcher;
11
+ this.minLevel = minLevel;
12
+ this.definedInSourceFile = captureStackSourceFile();
13
+ }
14
+ createInterceptor() {
15
+ return new GGLogInterceptor(this.runtimes, this.matcher, this.minLevel, this.definedInSourceFile);
16
+ }
17
+ }
18
+ //# sourceMappingURL=GGLogWith.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"GGLogWith.js","sourceRoot":"","sources":["../../testkit/GGLogWith.ts"],"names":[],"mappings":"AACA,OAAO,EAAc,sBAAsB,EAAgB,MAAM,mBAAmB,CAAC;AACrF,OAAO,EAAC,gBAAgB,EAAC,MAAM,oBAAoB,CAAC;AAGpD,MAAM,OAAO,SAAS;IAED,QAAQ,CAAkB;IAC1B,OAAO,CAAa;IACpB,QAAQ,CAAY;IACpB,mBAAmB,CAAS;IAE7C,YAAY,QAAyB,EAAE,OAAmB,EAAE,QAAmB;QAC3E,IAAI,CAAC,QAAQ,GAAG,QAAQ,CAAC;QACzB,IAAI,CAAC,OAAO,GAAG,OAAO,CAAC;QACvB,IAAI,CAAC,QAAQ,GAAG,QAAQ,CAAC;QACzB,IAAI,CAAC,mBAAmB,GAAG,sBAAsB,EAAE,CAAC;IACxD,CAAC;IAED,iBAAiB;QACb,OAAO,IAAI,gBAAgB,CAAC,IAAI,CAAC,QAAQ,EAAE,IAAI,CAAC,OAAO,EAAE,IAAI,CAAC,QAAQ,EAAE,IAAI,CAAC,mBAAmB,CAAC,CAAC;IACtG,CAAC;CACJ"}
@@ -0,0 +1,51 @@
1
+ import { GGLogger, LogEntry, LogLevel } from "@grest-ts/logger";
2
+ export interface CapturedLogEntry {
3
+ index: number;
4
+ timestamp: number;
5
+ level: LogLevel;
6
+ contextName?: string;
7
+ message?: string;
8
+ data?: any;
9
+ errorMessage?: string;
10
+ errorStack?: string;
11
+ traceId?: string;
12
+ }
13
+ /**
14
+ * Serializable log matcher for IPC.
15
+ * RegExp is converted to {type: 'regex', pattern, flags} for transmission.
16
+ */
17
+ export type SerializableLogMatcher = {
18
+ type: 'string';
19
+ value: string;
20
+ } | {
21
+ type: 'regex';
22
+ pattern: string;
23
+ flags: string;
24
+ } | {
25
+ type: 'object';
26
+ value: Record<string, unknown>;
27
+ };
28
+ export declare class GGTestLogger implements GGLogger {
29
+ private buffer;
30
+ private nextIndex;
31
+ private readonly maxBufferSize;
32
+ get minLevel(): LogLevel;
33
+ /**
34
+ * Returns the current log index (cursor position).
35
+ * Use this to mark a starting point for later queries.
36
+ */
37
+ getCursor(): number;
38
+ /**
39
+ * Find a log entry matching the given matcher, starting from fromIndex.
40
+ * Returns the first matching entry or null if not found.
41
+ */
42
+ findFrom(fromIndex: number, matcher: SerializableLogMatcher, minLevel?: LogLevel): CapturedLogEntry | null;
43
+ /**
44
+ * Retrieve all log entries from fromIndex onwards.
45
+ */
46
+ retrieveFrom(fromIndex: number, minLevel?: LogLevel): CapturedLogEntry[];
47
+ log(entry: LogEntry): void;
48
+ private matches;
49
+ private safeSerialize;
50
+ }
51
+ //# sourceMappingURL=GGTestLogger.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"GGTestLogger.d.ts","sourceRoot":"","sources":["../../testkit/GGTestLogger.ts"],"names":[],"mappings":"AAAA,OAAO,EAAC,QAAQ,EAAE,QAAQ,EAAE,QAAQ,EAAC,MAAM,kBAAkB,CAAC;AAE9D,MAAM,WAAW,gBAAgB;IAC7B,KAAK,EAAE,MAAM,CAAC;IACd,SAAS,EAAE,MAAM,CAAC;IAClB,KAAK,EAAE,QAAQ,CAAC;IAChB,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,IAAI,CAAC,EAAE,GAAG,CAAC;IACX,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,OAAO,CAAC,EAAE,MAAM,CAAC;CACpB;AAED;;;GAGG;AACH,MAAM,MAAM,sBAAsB,GAC5B;IAAE,IAAI,EAAE,QAAQ,CAAC;IAAC,KAAK,EAAE,MAAM,CAAA;CAAE,GACjC;IAAE,IAAI,EAAE,OAAO,CAAC;IAAC,OAAO,EAAE,MAAM,CAAC;IAAC,KAAK,EAAE,MAAM,CAAA;CAAE,GACjD;IAAE,IAAI,EAAE,QAAQ,CAAC;IAAC,KAAK,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAA;CAAE,CAAC;AAEzD,qBAAa,YAAa,YAAW,QAAQ;IAEzC,OAAO,CAAC,MAAM,CAA0B;IACxC,OAAO,CAAC,SAAS,CAAa;IAC9B,OAAO,CAAC,QAAQ,CAAC,aAAa,CAAiB;IAE/C,IAAW,QAAQ,IAAI,QAAQ,CAE9B;IAED;;;OAGG;IACI,SAAS,IAAI,MAAM;IAI1B;;;OAGG;IACI,QAAQ,CAAC,SAAS,EAAE,MAAM,EAAE,OAAO,EAAE,sBAAsB,EAAE,QAAQ,CAAC,EAAE,QAAQ,GAAG,gBAAgB,GAAG,IAAI;IAWjH;;OAEG;IACI,YAAY,CAAC,SAAS,EAAE,MAAM,EAAE,QAAQ,CAAC,EAAE,QAAQ,GAAG,gBAAgB,EAAE;IAUxE,GAAG,CAAC,KAAK,EAAE,QAAQ,GAAG,IAAI;IA4BjC,OAAO,CAAC,OAAO;IAmBf,OAAO,CAAC,aAAa;CAQxB"}
@@ -0,0 +1,102 @@
1
+ import { LogLevel } from "@grest-ts/logger";
2
+ export class GGTestLogger {
3
+ buffer = [];
4
+ nextIndex = 0;
5
+ maxBufferSize = 10000;
6
+ get minLevel() {
7
+ return LogLevel.DEBUG;
8
+ }
9
+ /**
10
+ * Returns the current log index (cursor position).
11
+ * Use this to mark a starting point for later queries.
12
+ */
13
+ getCursor() {
14
+ return this.nextIndex;
15
+ }
16
+ /**
17
+ * Find a log entry matching the given matcher, starting from fromIndex.
18
+ * Returns the first matching entry or null if not found.
19
+ */
20
+ findFrom(fromIndex, matcher, minLevel) {
21
+ for (const entry of this.buffer) {
22
+ if (entry.index < fromIndex)
23
+ continue;
24
+ if (minLevel !== undefined && entry.level < minLevel)
25
+ continue;
26
+ if (this.matches(entry, matcher)) {
27
+ return entry;
28
+ }
29
+ }
30
+ return null;
31
+ }
32
+ /**
33
+ * Retrieve all log entries from fromIndex onwards.
34
+ */
35
+ retrieveFrom(fromIndex, minLevel) {
36
+ const result = [];
37
+ for (const entry of this.buffer) {
38
+ if (entry.index < fromIndex)
39
+ continue;
40
+ if (minLevel !== undefined && entry.level < minLevel)
41
+ continue;
42
+ result.push(entry);
43
+ }
44
+ return result;
45
+ }
46
+ log(entry) {
47
+ const captured = {
48
+ index: this.nextIndex++,
49
+ timestamp: entry.timestamp.getTime(),
50
+ level: entry.level,
51
+ contextName: entry.contextName,
52
+ message: entry.message,
53
+ data: this.safeSerialize(entry.data),
54
+ traceId: entry.requestContext?.currentTraceId
55
+ };
56
+ if (entry.error) {
57
+ if (entry.error instanceof Error) {
58
+ captured.errorMessage = entry.error.message;
59
+ captured.errorStack = entry.error.stack;
60
+ }
61
+ else if (typeof entry.error === 'string') {
62
+ captured.errorMessage = entry.error;
63
+ }
64
+ else {
65
+ captured.errorMessage = String(entry.error);
66
+ }
67
+ }
68
+ this.buffer.push(captured);
69
+ if (this.buffer.length > this.maxBufferSize) {
70
+ this.buffer.shift();
71
+ }
72
+ }
73
+ matches(entry, matcher) {
74
+ switch (matcher.type) {
75
+ case 'string':
76
+ return entry.message?.includes(matcher.value) ?? false;
77
+ case 'regex': {
78
+ const regex = new RegExp(matcher.pattern, matcher.flags);
79
+ return regex.test(entry.message ?? '');
80
+ }
81
+ case 'object':
82
+ return Object.entries(matcher.value).every(([key, value]) => {
83
+ const entryValue = entry[key];
84
+ if (value instanceof RegExp) {
85
+ return value.test(String(entryValue));
86
+ }
87
+ return entryValue === value;
88
+ });
89
+ }
90
+ }
91
+ safeSerialize(data) {
92
+ if (data === undefined || data === null)
93
+ return data;
94
+ try {
95
+ return JSON.parse(JSON.stringify(data));
96
+ }
97
+ catch {
98
+ return String(data);
99
+ }
100
+ }
101
+ }
102
+ //# sourceMappingURL=GGTestLogger.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"GGTestLogger.js","sourceRoot":"","sources":["../../testkit/GGTestLogger.ts"],"names":[],"mappings":"AAAA,OAAO,EAAqB,QAAQ,EAAC,MAAM,kBAAkB,CAAC;AAuB9D,MAAM,OAAO,YAAY;IAEb,MAAM,GAAu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AC,KAAK,CAAC,OAAO,IAAI,EAAE,CAAC,CAAC;YAC3C,CAAC;YACD,KAAK,QAAQ;gBACT,OAAO,MAAM,CAAC,OAAO,CAAC,OAAO,CAAC,KAAK,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,GAAG,EAAE,KAAK,CAAC,EAAE,EAAE;oBACxD,MAAM,UAAU,GAAG,KAAK,CAAC,GAA6B,CAAC,CAAC;oBACxD,IAAI,KAAK,YAAY,MAAM,EAAE,CAAC;wBAC1B,OAAO,KAAK,CAAC,IAAI,CAAC,MAAM,CAAC,UAAU,CAAC,CAAC,CAAC;oBAC1C,CAAC;oBACD,OAAO,UAAU,KAAK,KAAK,CAAC;gBAChC,CAAC,CAAC,CAAC;QACX,CAAC;IACL,CAAC;IAEO,aAAa,CAAC,IAAa;QAC/B,IAAI,IAAI,KAAK,SAAS,IAAI,IAAI,KAAK,IAAI;YAAE,OAAO,IAAI,CAAC;QACrD,IAAI,CAAC;YACD,OAAO,IAAI,CAAC,KAAK,CAAC,IAAI,CAAC,SAAS,CAAC,IAAI,CAAC,CAAC,CAAC;QAC5C,CAAC;QAAC,MAAM,CAAC;YACL,OAAO,MAAM,CAAC,IAAI,CAAC,CAAC;QACxB,CAAC;IACL,CAAC;CACJ"}
@@ -0,0 +1,7 @@
1
+ export * from "./GGTestLogger";
2
+ export * from "./GGLogCommands";
3
+ export * from "./GGLogCursor";
4
+ export * from "./GGLogSelector";
5
+ export * from "./GGLogWith";
6
+ export * from "./GGLogInterceptor";
7
+ //# sourceMappingURL=index-testkit.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index-testkit.d.ts","sourceRoot":"","sources":["../../testkit/index-testkit.ts"],"names":[],"mappings":"AAIA,cAAc,gBAAgB,CAAC;AAC/B,cAAc,iBAAiB,CAAC;AAChC,cAAc,eAAe,CAAC;AAC9B,cAAc,iBAAiB,CAAC;AAChC,cAAc,aAAa,CAAC;AAC5B,cAAc,oBAAoB,CAAC"}
@@ -0,0 +1,18 @@
1
+ import { GG_LOG, GGLog } from "@grest-ts/logger";
2
+ import { GGTestLogger } from "./GGTestLogger.js";
3
+ export * from "./GGTestLogger.js";
4
+ export * from "./GGLogCommands.js";
5
+ export * from "./GGLogCursor.js";
6
+ export * from "./GGLogSelector.js";
7
+ export * from "./GGLogWith.js";
8
+ export * from "./GGLogInterceptor.js";
9
+ const originalInit = GGLog.init.bind(GGLog);
10
+ GGLog.init = function (scope) {
11
+ originalInit();
12
+ GGLog.add(new GGTestLogger());
13
+ return originalInit;
14
+ };
15
+ if (GG_LOG.tryGet()) {
16
+ GGLog.add(new GGTestLogger());
17
+ }
18
+ //# sourceMappingURL=index-testkit.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index-testkit.js","sourceRoot":"","sources":["../../testkit/index-testkit.ts"],"names":[],"mappings":"AAAA,OAAO,EAAC,MAAM,EAAE,KAAK,EAAC,MAAM,kBAAkB,CAAC;AAC/C,OAAO,EAAC,YAAY,EAAC,MAAM,gBAAgB,CAAC;AAG5C,cAAc,gBAAgB,CAAC;AAC/B,cAAc,iBAAiB,CAAC;AAChC,cAAc,eAAe,CAAC;AAC9B,cAAc,iBAAiB,CAAC;AAChC,cAAc,aAAa,CAAC;AAC5B,cAAc,oBAAoB,CAAC;AAEnC,MAAM,YAAY,GAAG,KAAK,CAAC,IAAI,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC;AAC5C,KAAK,CAAC,IAAI,GAAG,UAAU,KAAsB;IACzC,YAAY,EAAE,CAAC;IACf,KAAK,CAAC,GAAG,CAAC,IAAI,YAAY,EAAE,CAAC,CAAC;IAC9B,OAAO,YAAY,CAAA;AACvB,CAAC,CAAC;AAEF,IAAI,MAAM,CAAC,MAAM,EAAE,EAAE,CAAC;IAClB,KAAK,CAAC,GAAG,CAAC,IAAI,YAAY,EAAE,CAAC,CAAC;AAClC,CAAC"}