Skip to content
This repository was archived by the owner on Dec 27, 2025. It is now read-only.

Commit 92e9ebe

Browse files
committed
fix: use console.warn for usage warnings in CLI layer
- Change "No scenario files found" etc. from logger/console.error to console.warn - Change "Unknown command" from logger.error to console.warn - Remove redundant logger.error before throw in resolveReporter These are normal operational warnings, not errors.
1 parent daf5806 commit 92e9ebe

File tree

3 files changed

+5
-9
lines changed

3 files changed

+5
-9
lines changed

src/commands/run.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -141,7 +141,7 @@ export async function runCommand(
141141
);
142142

143143
if (scenarioFiles.length === 0) {
144-
logger.error("No scenario files found", { paths, includes, excludes });
144+
console.warn("No scenario files found");
145145
return EXIT_CODE.NOT_FOUND;
146146
}
147147

@@ -161,7 +161,7 @@ export async function runCommand(
161161
logger.debug("Scenarios loaded", { scenarioCount: scenarios.length });
162162

163163
if (scenarios.length === 0) {
164-
logger.error("No scenarios found in files");
164+
console.warn("No scenarios found in files");
165165
return EXIT_CODE.NOT_FOUND;
166166
}
167167

@@ -173,7 +173,7 @@ export async function runCommand(
173173
}
174174

175175
if (scenarios.length === 0) {
176-
logger.error("No scenarios matched the filter", { selectors });
176+
console.warn("No scenarios matched the filter");
177177
return EXIT_CODE.NOT_FOUND;
178178
}
179179

src/main.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -68,8 +68,8 @@ export async function main(args: string[]): Promise<number> {
6868
return await listCommand(commandArgs, cwd);
6969

7070
default:
71-
logger.error("Unknown command", { command });
72-
logger.error("Run 'probitas --help' for usage information");
71+
console.warn(`Unknown command: ${command}`);
72+
console.warn("Run 'probitas --help' for usage information");
7373
return EXIT_CODE.USAGE_ERROR;
7474
}
7575
}

src/utils.ts

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -50,10 +50,6 @@ export function resolveReporter(
5050

5151
const fn = reporterMap[reporter];
5252
if (!fn) {
53-
logger.error("Unknown reporter", {
54-
reporter,
55-
availableReporters: Object.keys(reporterMap),
56-
});
5753
throw new Error(`Unknown reporter: ${reporter}`);
5854
}
5955

0 commit comments

Comments
 (0)