{"repo":"ditthkr/loggie","free":true,"listed":false,"github":"https://github.com/ditthkr/loggie","clone":"git clone https://github.com/ditthkr/loggie.git","description":"Context-Aware Logging for Go","language":"Go","stars":12,"topics":["golang","logger","logging"],"license":"MIT","category":"analytics","readme_excerpt":"loggie 🧠⚡️ — Context-Aware Logger for Go Context-aware, pluggable logger for Go web applications. No more passing logger through every function — just use context.Context . --- 🚀 What is loggie? loggie helps you embed a structured logger inside context.Context , so you can log from any layer — service, repository, or handler — with a consistent trace id , user id , or any custom field. It supports Zap, Logrus, OpenTelemetry, and works with any web framework. --- ✨ Features ✅ Structured logging via context.Context ✅ Auto-generated trace id per request ✅ OTEL-compatible (extracts trace id from spans) ✅ Custom fields via loggie.WithCustomField() ✅ Framework-agnostic logger injection ✅ Zap / Logrus support ✅ No-op fallback logger ✅ Fx lifecycle and context cancellation compatible --- 📦 Installation --- 🧠 Injecting Logger in Middleware Use loggie.Injection(ctx, logger) inside any middleware, from any web framework. ✅ Fiber ✅ Gin ✅ Echo --- 🔌 Logger Interface ✅ Supported Adapters Logger Package ------ --------------------- Zap loggie.ZapLogger Logrus loggie/logruslogger --- 📄 Usage Example 📤 Output (Zap or Logrus): --- 🧰 Utilities Function Description -------------------------------- ---------------------------------- Injection(ctx, logger) Inject logger + trace\\ id into ctx FromContext(ctx) Get logger with fields from ctx WithTraceId(ctx) Add trace\\ id manually TraceId(ctx) Get trace\\ id (auto or OTEL) WithLogger(ctx, logger) Attach logger WithCustomField(ctx, key, val) Ad","default_branch":null,"files":null,"tree":[],"storefront":"/r/ditthkr","claimed":false,"request_supported":{"post":"https://gitbuyer.com/r/ditthkr/loggie/request-supported","requests":0},"note":"indexed from public GitHub; nothing is for sale on this page. Clone it from GitHub. Paid listings live at /search."}