Skip to content

Commit 7c5658b

Browse files
committed
docs: document diagnostics logs handlers
1 parent 3e9a55f commit 7c5658b

2 files changed

Lines changed: 6 additions & 0 deletions

File tree

src/gateway/server-methods/diagnostics.ts

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,9 +5,12 @@ import {
55
} from "../../logging/diagnostic-stability.js";
66
import type { GatewayRequestHandlers } from "./types.js";
77

8+
/** Gateway handler for payload-free stability diagnostics. */
89
export const diagnosticsHandlers: GatewayRequestHandlers = {
910
"diagnostics.stability": async ({ params, respond }) => {
1011
try {
12+
// Normalization owns parameter bounds so malformed diagnostic requests
13+
// return a client error instead of leaking logging internals.
1114
const query = normalizeDiagnosticStabilityQuery(params);
1215
respond(true, getDiagnosticStabilitySnapshot(query), undefined);
1316
} catch (err) {

src/gateway/server-methods/logs.ts

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@ import {
77
import { readConfiguredLogTail } from "../../logging/log-tail.js";
88
import type { GatewayRequestHandlers } from "./types.js";
99

10+
/** Gateway handler for bounded reads from the configured gateway log. */
1011
export const logsHandlers: GatewayRequestHandlers = {
1112
"logs.tail": async ({ params, respond }) => {
1213
if (!validateLogsTailParams(params)) {
@@ -23,6 +24,8 @@ export const logsHandlers: GatewayRequestHandlers = {
2324

2425
const p = params as { cursor?: number; limit?: number; maxBytes?: number };
2526
try {
27+
// The log-tail reader enforces cursor/byte limits and source selection;
28+
// the handler only maps protocol params and failure shape.
2629
const result = await readConfiguredLogTail({
2730
cursor: p.cursor,
2831
limit: p.limit,

0 commit comments

Comments
 (0)