Logy|Docs

Overview

Choose package, named, or typed loggers for application code.

Logy gives you three ways to create a logger. Use the one that matches the boundary you want to see in the output: package, explicit name, or Go type.

main.go
packageLog := logy.Get()
workerLog := logy.Named("worker")
clientLog := logy.Of[http.Client]()

logy.Get is the default for most application code. logy.Named is useful for workers, integrations, and runtime concepts that do not map cleanly to a package. logy.Of is useful when a component type is the clearest logging boundary.

Logger names also matter for configuration. Package and named loggers can be matched by configuration rules, so different areas of the application can emit different levels or use different handlers.

Pick a logger style

Use package loggers first, named loggers when the runtime concept matters, and typed loggers when the type itself is what you want to recognize in log output.

Continue with Package loggers, Named loggers, or Typed loggers.