Documentation
¶
Index ¶
- Constants
- func Colouriser(colourCode int, v string) string
- func CreateLoggerFromEnv(out *os.File, colour string) *slog.Logger
- func CreateLoggerSink() *os.File
- func CreateOTELLoggerFromEnv(out *os.File, colour string) *slog.Logger
- func NewDefaultResource() *resource.Resource
- func PrettyLine(data map[string]any, colourise func(code int, value string) string) (string, error)
- func SetProgramLevelPrettyLogger(params PrettyLogParams) *slog.Logger
- func Trace(log *slog.Logger, msg string, data ...any)
- type Handler
- type InstrumentationScope
- type Option
- type PrettyLogParams
Constants ¶
View Source
const ( MaxInlineAttrsLength = 42 JSONIndentSpaces = " " )
View Source
const ( OTELTraceIDKey = "trace_id" OTELSpanIDKey = "span_id" OTELTraceFlagsKey = "trace_flags" OTELServiceNameKey = "service.name" OTELServiceVersionKey = "service.version" OTELResourceKey = "resource" OTELScopeNameKey = "scope.name" OTELScopeVersionKey = "scope.version" OTELTimestampKey = "timestamp" OTELSeverityTextKey = "severity_text" OTELSeverityNumberKey = "severity_number" OTELBodyKey = "body" OTELAttributesKey = "attributes" )
View Source
const AreaKey = "area"
View Source
const LevelFatal = slog.LevelError + 4
View Source
const LevelTrace = slog.LevelDebug - 4
View Source
const ProcessKey = "process"
Variables ¶
This section is empty.
Functions ¶
func Colouriser ¶
func CreateLoggerSink ¶
func CreateOTELLoggerFromEnv ¶
func NewDefaultResource ¶
func PrettyLine ¶
func SetProgramLevelPrettyLogger ¶
func SetProgramLevelPrettyLogger(params PrettyLogParams) *slog.Logger
Types ¶
type Handler ¶
type Handler struct {
// contains filtered or unexported fields
}
func NewHandler ¶
func NewHandler(opts *slog.HandlerOptions, params PrettyLogParams, options ...Option) *Handler
func NewOTELHandler ¶
func NewOTELHandler(opts *slog.HandlerOptions, params PrettyLogParams, options ...Option) *Handler
type InstrumentationScope ¶
type Option ¶
type Option func(h *Handler)
func WithColour ¶
func WithColour() Option
func WithDestinationWriter ¶
func WithOpenTelemetry ¶
func WithOpenTelemetry() Option
func WithOutputEmptyAttrs ¶
func WithOutputEmptyAttrs() Option
func WithResource ¶
func WithTimestamp ¶
func WithTimestamp() Option
Click to show internal directories.
Click to hide internal directories.