Logrus is a structured logging library for Go, providing a flexible and performant alternative to the standard library logger. It offers a clean architecture based on three core interfaces: Logger (configuration and output), Entry (log event with fields), Formatter (output formatting), and Hook (level-based callbacks). The library supports multiple output formats (text/logfmt with optional ANSI colors, JSON), customizable field maps, caller reporting, and a buffer pool for reduced allocation overhead. It includes built-in hooks for syslog, slog (Go's standard logging API), and a test hook for capturing log entries in tests. The package-level exported logger provides a simple global API, while custom Logger instances allow independent configuration. External dependencies are minimal, relying only on the standard library and a small set of well-maintained packages (testify for testing, sys for terminal detection). The codebase is in maintenance mode, focusing on stability, performance, and interoperability with Go's log/slog ecosystem.
Oops is a Go library for structured error handling that serves as a drop-in replacement for the standard error type. It provides a fluent builder pattern to attach rich contextual information (error codes, domains, tags, key-value attributes, user/tenant data, HTTP request/response, timestamps, durations, hints, ownership) to errors, along with automatic stack trace capture and optional source code fragment extraction. The library implements the standard error interface, supports error wrapping and chaining, panic recovery, assertions, and integrates with major Go logging libraries (zap, zerolog, logrus, slog) via separate formatter packages. Its architecture centers on an immutable option chain (functional options) that defers stack frame symbolization to first read, minimizing allocation overhead for errors that are created but never inspected. Key entry points are the package-level functions (Wrap, Wrapf, New, Errorf, Join, Recover, Recoverf, Assert, Assertf) and the OopsErrorBuilder chainable methods. External dependencies are minimal: only github.com/oklog/ulid/v2, github.com/samber/lo, and go.opentelemetry.io/otel/trace for optional OpenTelemetry span context extraction. The codebase is well-tested, benchmarked, and follows Go best practices with comprehensive linting and security scanning.