Skip to content

Commit 3335d9d

Browse files
committed
feat: add fixture-match debug logging to all remaining handlers
Add logger.debug calls at the fixture match point in cohere, ollama (both chat and generate), embeddings, images, speech, transcription, and video handlers. Logs the matched fixture pattern on success, or a no-match message otherwise.
1 parent ba845c9 commit 3335d9d

7 files changed

Lines changed: 24 additions & 0 deletions

File tree

src/cohere.ts

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -786,6 +786,9 @@ export async function handleCohere(
786786

787787
if (fixture) {
788788
journal.incrementFixtureMatchCount(fixture, fixtures, testId);
789+
logger.debug(`Fixture matched: ${JSON.stringify(fixture.match).slice(0, 120)}`);
790+
} else {
791+
logger.debug(`No fixture matched for request`);
789792
}
790793

791794
if (

src/embeddings.ts

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -126,6 +126,9 @@ export async function handleEmbeddings(
126126

127127
if (fixture) {
128128
journal.incrementFixtureMatchCount(fixture, fixtures, testId);
129+
logger.debug(`Fixture matched: ${JSON.stringify(fixture.match).slice(0, 120)}`);
130+
} else {
131+
logger.debug(`No fixture matched for request`);
129132
}
130133

131134
if (

src/images.ts

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -106,6 +106,9 @@ export async function handleImages(
106106

107107
if (fixture) {
108108
journal.incrementFixtureMatchCount(fixture, fixtures, testId);
109+
defaults.logger.debug(`Fixture matched: ${JSON.stringify(fixture.match).slice(0, 120)}`);
110+
} else {
111+
defaults.logger.debug(`No fixture matched for request`);
109112
}
110113

111114
if (

src/ollama.ts

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -498,6 +498,9 @@ export async function handleOllama(
498498

499499
if (fixture) {
500500
journal.incrementFixtureMatchCount(fixture, fixtures, testId);
501+
logger.debug(`Fixture matched: ${JSON.stringify(fixture.match).slice(0, 120)}`);
502+
} else {
503+
logger.debug(`No fixture matched for request`);
501504
}
502505

503506
if (
@@ -800,6 +803,9 @@ export async function handleOllamaGenerate(
800803

801804
if (fixture) {
802805
journal.incrementFixtureMatchCount(fixture, fixtures, testId);
806+
defaults.logger.debug(`Fixture matched: ${JSON.stringify(fixture.match).slice(0, 120)}`);
807+
} else {
808+
defaults.logger.debug(`No fixture matched for request`);
803809
}
804810

805811
if (

src/speech.ts

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -93,6 +93,9 @@ export async function handleSpeech(
9393

9494
if (fixture) {
9595
journal.incrementFixtureMatchCount(fixture, fixtures, testId);
96+
defaults.logger.debug(`Fixture matched: ${JSON.stringify(fixture.match).slice(0, 120)}`);
97+
} else {
98+
defaults.logger.debug(`No fixture matched for request`);
9699
}
97100

98101
if (

src/transcription.ts

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -56,6 +56,9 @@ export async function handleTranscription(
5656

5757
if (fixture) {
5858
journal.incrementFixtureMatchCount(fixture, fixtures, testId);
59+
defaults.logger.debug(`Fixture matched: ${JSON.stringify(fixture.match).slice(0, 120)}`);
60+
} else {
61+
defaults.logger.debug(`No fixture matched for request`);
5962
}
6063

6164
if (

src/video.ts

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -137,6 +137,9 @@ export async function handleVideoCreate(
137137

138138
if (fixture) {
139139
journal.incrementFixtureMatchCount(fixture, fixtures, testId);
140+
defaults.logger.debug(`Fixture matched: ${JSON.stringify(fixture.match).slice(0, 120)}`);
141+
} else {
142+
defaults.logger.debug(`No fixture matched for request`);
140143
}
141144

142145
if (

0 commit comments

Comments
 (0)