console-slog
console-slog copied to clipboard
feat: Support fixed-length source code
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