ConsoleTracing
org.llm4s.trace.ConsoleTracing
class ConsoleTracing extends Tracing
Console-based Tracing implementation with colored, formatted output.
Prints trace events to standard output with ANSI color formatting for improved readability during development and debugging. Returns Result[Unit] to support functional composition.
== Features ==
- Color-coded output by event type (errors in red, success in green, etc.)
- Visual separators and headers for different trace sections
- Formatted display of all TraceEvent types
- Truncation of long JSON content for readability
- Timestamps on all events
== Usage ==
val tracing: Tracing = new ConsoleTracing()
// Trace events functionally
for {
_ <- tracing.traceEvent(TraceEvent.AgentInitialized("query", Vector("tool1")))
_ <- tracing.traceTokenUsage(TokenUsage(100, 50, 150), "gpt-4", "completion")
} yield ()
Attributes
- See also
-
NoOpTracing for silent tracing
LangfuseTracing for production observability
AnsiColors for color constants used
- Graph
-
- Supertypes
Members list
In this article