Documentation
¶
Overview ¶
Package log provides Runa log primitives.
Index ¶
- Constants
- func Channel(app any, name string) *slog.Logger
- func Fanout(handlers ...slog.Handler) slog.Handler
- func Provider(options ...ProviderOption) runaprovider.Provider
- func ServiceName(name string) string
- type Info
- type Option
- type Options
- type Output
- type OutputFunc
- type ProviderOption
- type Registry
- func (registry *Registry) Build(ctx context.Context, name string) *slog.Logger
- func (registry *Registry) Close(ctx context.Context) error
- func (registry *Registry) Get(name string) *slog.Logger
- func (registry *Registry) Info() []Info
- func (registry *Registry) Set(name string, outputs ...Output)
- func (registry *Registry) Shutdown(ctx context.Context) error
Constants ¶
View Source
const ( DefaultName = "default" HTTP = "http" Error = "error" Audit = "audit" Queue = "queue" Schedule = "schedule" Task = "task" ORM = "orm" Redis = "redis" )
Variables ¶
This section is empty.
Functions ¶
func Channel ¶ added in v0.1.1
Channel returns a named logger from the supplied app, provider context, registry, or the process default registry.
func Provider ¶
func Provider(options ...ProviderOption) runaprovider.Provider
func ServiceName ¶
ServiceName returns the DI service name for a log channel.
Types ¶
type Options ¶
Options configures a slog handler.
func BuildOptions ¶
BuildOptions resolves log output options.
type OutputFunc ¶
OutputFunc adapts a function to Output.
type ProviderOption ¶
type ProviderOption func(*provider)
func Register ¶
func Register(name string, outputs ...Output) ProviderOption
type Registry ¶
type Registry struct {
// contains filtered or unexported fields
}
Registry stores named log channel configuration and instances.
Click to show internal directories.
Click to hide internal directories.