feat: Add structured logging with logrus and configurable output formats

- Add sirupsen/logrus v1.9.4 dependency to go.mod
- Add logging package with global Logger instance
- Add Config struct with Level, Format, and Output fields
- Add DefaultConfig with LOG_LEVEL, LOG_FORMAT, and LOG_OUTPUT environment variables
- Add Init function with level parsing, JSON/text formatter selection, and stdout/stderr output
- Add InitWithDefaults helper function
- Add WithField, WithFields, and WithError helper
This commit is contained in:
nutcas3
2026-04-25 06:19:48 +03:00
parent b714fa8382
commit 715417c0eb
3 changed files with 144 additions and 0 deletions
+1
View File
@@ -154,6 +154,7 @@ require (
github.com/quic-go/qpack v0.6.0 // indirect
github.com/quic-go/quic-go v0.59.0 // indirect
github.com/rabbitmq/amqp091-go v1.11.0
github.com/sirupsen/logrus v1.9.4
github.com/stripe/stripe-go/v82 v82.5.1
github.com/twitchyliquid64/golang-asm v0.15.1 // indirect
github.com/ugorji/go/codec v1.3.1 // indirect