Skip to content

Commit ad3ace1

Browse files
committed
chore: shorten stdio logging comments
1 parent c643aab commit ad3ace1

3 files changed

Lines changed: 3 additions & 14 deletions

File tree

src/cli/index.ts

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,6 @@ export async function runCli(args: string[] = process.argv.slice(2)): Promise<vo
77
return;
88
}
99

10-
// Stdio JSON-RPC is on stdout; quiet logging before the first startup info line.
1110
if (!args.includes('--httpStream')) {
1211
configureStdioTransportLogging();
1312
}

src/logger.ts

Lines changed: 2 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -4,21 +4,15 @@ import {isStdioTransportLoggingConfigured, markStdioTransportLoggingConfigured}
44

55
const log = logger.getLogger('appium-mcp');
66

7-
/**
8-
* Move npmlog off stdout when that is the current sink. Leave custom streams
9-
* (file, Winston, …) and stderr alone so host apps are not rewritten.
10-
*/
7+
/** npmlog must not write to stdout (stdio JSON-RPC). Skip if the host already set a custom stream. */
118
export function ensureLoggerWritesToStderr(): void {
129
const root = log.unwrap();
1310
if (root.stream === process.stdout) {
1411
root.stream = process.stderr;
1512
}
1613
}
1714

18-
/**
19-
* Quiet stdio MCP processes so info/debug driver and tool logs cannot mix with
20-
* JSON-RPC. Call only from the stdio startup path, before the first `log.info`.
21-
*/
15+
/** stdio CLI only: drop info/debug so they cannot sit on stdout. */
2216
export function configureStdioTransportLogging(): void {
2317
if (isStdioTransportLoggingConfigured()) {
2418
return;

src/utils/webdriver-client-options.ts

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,8 @@
11
import {isStdioTransportLoggingConfigured} from '../stdio-logging-state.js';
22

3-
/** Keep WebDriver client protocol logs off stdout (MCP stdio uses stdout for JSON-RPC). */
43
export const QUIET_WEBDRIVER_LOG_LEVEL = 'warn' as const;
54

6-
/**
7-
* Adds `logLevel: warn` only after the stdio CLI path has opted in.
8-
* httpStream and `appium-mcp/core` hosts keep the existing / `WDIO_LOG_LEVEL` setting.
9-
*/
5+
/** `logLevel: warn` only after the stdio CLI path ran. */
106
export function withQuietWebDriverLogging<T extends Record<string, unknown>>(
117
options: T,
128
): T | (T & {logLevel: typeof QUIET_WEBDRIVER_LOG_LEVEL}) {

0 commit comments

Comments
 (0)