Package ai.acolite.agentsdk.core.tracing
Class ConsoleTraceProcessor
java.lang.Object
ai.acolite.agentsdk.core.tracing.ConsoleTraceProcessor
- All Implemented Interfaces:
TraceProcessor,AutoCloseable
Simple trace processor that prints to console.
Useful for: - Development and debugging - Examples and demos - Testing without OpenAI API
Output format: Pretty-printed JSON
Ported from TypeScript OpenAI Agents SDK Source: tracing/processor.ts
-
Constructor Summary
ConstructorsConstructorDescriptionCreate console processor with pretty printing enabledConsoleTraceProcessor(boolean prettyPrint) Create console processor -
Method Summary
Modifier and TypeMethodDescriptionFlush all pending traces/spans.voidCalled when a span ends.voidonSpanStart(Span<?> span) Called when a span starts.voidonTraceEnd(Trace trace) Called when a trace ends.voidonTraceStart(Trace trace) Called when a trace starts.shutdown(long timeoutMs) Shutdown the processor gracefully.Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface ai.acolite.agentsdk.core.tracing.TraceProcessor
close, shutdown
-
Constructor Details
-
ConsoleTraceProcessor
public ConsoleTraceProcessor()Create console processor with pretty printing enabled -
ConsoleTraceProcessor
public ConsoleTraceProcessor(boolean prettyPrint) Create console processor- Parameters:
prettyPrint- Whether to pretty-print JSON output
-
-
Method Details
-
onTraceStart
Description copied from interface:TraceProcessorCalled when a trace starts. Processors can export the trace immediately or buffer it.- Specified by:
onTraceStartin interfaceTraceProcessor
-
onTraceEnd
Description copied from interface:TraceProcessorCalled when a trace ends.- Specified by:
onTraceEndin interfaceTraceProcessor
-
onSpanStart
Description copied from interface:TraceProcessorCalled when a span starts.- Specified by:
onSpanStartin interfaceTraceProcessor
-
onSpanEnd
Description copied from interface:TraceProcessorCalled when a span ends. Most processors export spans on end to capture complete data.- Specified by:
onSpanEndin interfaceTraceProcessor
-
forceFlush
Description copied from interface:TraceProcessorFlush all pending traces/spans. Blocks until all data is exported.- Specified by:
forceFlushin interfaceTraceProcessor
-
shutdown
Description copied from interface:TraceProcessorShutdown the processor gracefully. Flushes pending data and releases resources.- Specified by:
shutdownin interfaceTraceProcessor- Parameters:
timeoutMs- Maximum time to wait for shutdown (milliseconds)
-