MCPcopy
hub / github.com/simstudioai/sim / Logs

Function Logs

apps/sim/app/workspace/[workspaceId]/logs/logs.tsx:208–1172  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

206 * @returns The logs page view with table and sidebar details
207 */
208export default function Logs() {
209 const params = useParams()
210 const workspaceId = params.workspaceId as string
211
212 const {
213 timeRange,
214 startDate,
215 endDate,
216 level,
217 workflowIds,
218 folderIds,
219 setWorkflowIds,
220 searchQuery: urlSearchQuery,
221 setSearchQuery: setUrlSearchQuery,
222 triggers,
223 resetFilters,
224 setLevel,
225 setFolderIds,
226 setTriggers,
227 setTimeRange,
228 setDateRange,
229 clearDateRange,
230 } = useLogFilters()
231
232 const viewMode = useFilterStore((s) => s.viewMode)
233 const setViewMode = useFilterStore((s) => s.setViewMode)
234
235 const [{ selectedLogId, isSidebarOpen }, dispatch] = useReducer(logSelectionReducer, {
236 selectedLogId: null,
237 isSidebarOpen: false,
238 })
239
240 const [executionId] = useQueryState(executionIdParam.key, executionIdParam.parser)
241 const [pendingExecutionId, setPendingExecutionId] = useState<string | null>(() => executionId)
242
243 /**
244 * The log-details `tab` param is owned/written by the details panel, but the
245 * orchestrator must clear it when the panel closes so a lingering `?tab=trace`
246 * never carries over to the next log opened from the list.
247 */
248 const [, setLogDetailsTab] = useQueryState(logDetailsTabParam.key, {
249 ...logDetailsTabParam.parser,
250 ...logDetailsTabUrlKeys,
251 })
252
253 /**
254 * `urlSearchQuery` is the instant nuqs value (its URL write is debounced inside
255 * `useLogFilters`); the query/filtering still debounce off it to avoid
256 * per-keystroke fetches.
257 */
258 const debouncedSearchQuery = useDebounce(urlSearchQuery, 300)
259
260 const isLive = true
261 const [isVisuallyRefreshing, setIsVisuallyRefreshing] = useState(false)
262 const [isExporting, setIsExporting] = useState(false)
263 const refreshTimersRef = useRef(new Set<number>())
264 const logsRef = useRef<WorkflowLogSummary[]>([])
265 const selectedLogIndexRef = useRef(-1)

Callers

nothing calls this directly

Calls 15

useLogFiltersFunction · 0.90
useDebounceFunction · 0.90
useLogDetailFunction · 0.90
useLogsListFunction · 0.90
useDashboardStatsFunction · 0.90
prefetchLogDetailFunction · 0.90
useFoldersFunction · 0.90
useLogByExecutionIdFunction · 0.90
useCancelExecutionFunction · 0.90
useRetryExecutionFunction · 0.90
fetchLogDetailFunction · 0.90

Tested by

no test coverage detected