Skip to content

YagaLog v0.3.0 — Functional-options API

Choose a tag to compare

@bambutcha bambutcha released this 20 Nov 20:47
· 4 commits to master since this release
5bfb799

Summary
This release introduces a functional-options constructor for YagaLog.

Highlights

  • New API: NewLogger(opts ...Option)
  • Options included: WithFilePath, WithWriter, WithLevel, WithJSON, WithTimeFormat, WithCaller, WithColors

Migration notes
Replace:
l, err := logger.NewLogger("app.log")
With:
l, err := logger.NewLogger(logger.WithFilePath("app.log"))