MCPcopy Create free account
hub / github.com/NativeScript/SimDeck / fetchSimulatorLogs

Function fetchSimulatorLogs

packages/client/src/api/simulators.ts:101–135  ·  view source on GitHub ↗
(
  udid: string,
  options: {
    levels?: string[];
    limit?: number;
    processes?: string[];
    query?: string;
    seconds?: number;
    backfill?: boolean;
  } = {},
)

Source from the content-addressed store, hash-verified

99}
100
101export async function fetchSimulatorLogs(
102 udid: string,
103 options: {
104 levels?: string[];
105 limit?: number;
106 processes?: string[];
107 query?: string;
108 seconds?: number;
109 backfill?: boolean;
110 } = {},
111): Promise<SimulatorLogsResponse> {
112 const params = new URLSearchParams();
113 if (options.backfill) {
114 params.set("backfill", "true");
115 }
116 if (options.seconds) {
117 params.set("seconds", String(options.seconds));
118 }
119 if (options.limit) {
120 params.set("limit", String(options.limit));
121 }
122 if (options.levels?.length) {
123 params.set("levels", options.levels.join(","));
124 }
125 if (options.processes?.length) {
126 params.set("processes", options.processes.join(","));
127 }
128 if (options.query?.trim()) {
129 params.set("q", options.query.trim());
130 }
131 const query = params.size > 0 ? `?${params}` : "";
132 return apiRequest<SimulatorLogsResponse>(
133 `/api/simulators/${udid}/logs${query}`,
134 );
135}
136
137export async function fetchSimulatorProcesses(
138 udid: string,

Callers 1

loadLogsFunction · 0.90

Calls 2

apiRequestFunction · 0.90
setMethod · 0.80

Tested by

no test coverage detected