console-slog icon indicating copy to clipboard operation
console-slog copied to clipboard

feat: Support fixed-length source code

Open arikkfir opened this issue 2 months ago • 0 comments

This change adds support for fixed-length source code field rendering, with smart-trimming that keeps the start & end section, with ... replacing the part that gets removed.

Configuration:

handler = console.NewHandler(os.Stdout, &console.HandlerOptions{
	SourceLength: 20,
})

Examples (max-length 20):

Source: 1234567890                      -> 10:00PM INF 1234567890           > Some log line
Source: pkgA/pkgB/jack_the_knife.go:123 -> 10:00PM INF pkgA/pkg...fe.go:123 > Another log line
Source: testing/superlogs.go:12         -> 10:00PM INF testing/...ogs.go:12 > Yet another log line

arikkfir avatar Nov 24 '25 12:11 arikkfir