Documentation
¶
Index ¶
- Constants
- func ClassifyError(err error) string
- func ExtractBuildTime(ctx context.Context) string
- func ExtractCommitHash(ctx context.Context) string
- func ExtractParentSpanID(ctx context.Context) string
- func ExtractSpanID(ctx context.Context) string
- func ExtractStackTrace(err error) string
- func ExtractTraceID(ctx context.Context) string
- func ExtractVersion(ctx context.Context) string
- func GetStructName(i interface{}) string
- func MergeAdditionalData(data ...map[string]any) map[string]any
- func WithBuildTime(ctx context.Context, buildTime string) context.Context
- func WithCommitHash(ctx context.Context, commitHash string) context.Context
- func WithParentSpanID(ctx context.Context, parentSpanID string) context.Context
- func WithSpanID(ctx context.Context, spanID string) context.Context
- func WithTraceID(ctx context.Context, traceID string) context.Context
- func WithVersion(ctx context.Context, version string) context.Context
- type JSONOnlyHandler
- type PrettyConsoleHandler
Constants ¶
View Source
const ( LibraryName = "chronolog" LibraryVersion = "0.1.0" LibraryCommit = "abc1234def5678ghijkl9012mnop3456" LibraryBuildTime = "2023-10-01T12:00:00Z" )
View Source
const ( TraceIDKey contextKey = "trace_id" SpanIDKey contextKey = "span_id" ParentSpanIDKey contextKey = "parent_span_id" CommitHashKey contextKey = "commit_hash" BuildTimeKey contextKey = "build_time" VersionKey contextKey = "version" )
Variables ¶
This section is empty.
Functions ¶
func ClassifyError ¶
func ExtractBuildTime ¶
func ExtractCommitHash ¶
func ExtractParentSpanID ¶
func ExtractSpanID ¶
func ExtractStackTrace ¶
func ExtractTraceID ¶
func ExtractVersion ¶
func GetStructName ¶
func GetStructName(i interface{}) string
func WithParentSpanID ¶
Types ¶
type JSONOnlyHandler ¶
type JSONOnlyHandler struct {
// contains filtered or unexported fields
}
JSONOnlyHandler is a slog.Handler that prints only the serialized JSON of the "event" field.
func NewJSONOnlyHandler ¶
func NewJSONOnlyHandler(w io.Writer) *JSONOnlyHandler
NewJSONOnlyHandler creates a new JSONOnlyHandler.
type PrettyConsoleHandler ¶
type PrettyConsoleHandler struct {
// contains filtered or unexported fields
}
func NewPrettyConsoleHandler ¶
func NewPrettyConsoleHandler(w io.Writer) *PrettyConsoleHandler
Click to show internal directories.
Click to hide internal directories.