Documentation
¶
Index ¶
- func HandlerToSlogHandler(handler log.Handler) slog.Handler
- func HookToHandler(hook log.Hook) log.Handler
- func NewWriter(ctx context.Context, logger *slog.Logger) log.Writer
- type Application
- type Entry
- func (e *Entry) Code() string
- func (e *Entry) Context() context.Context
- func (e *Entry) Data() log.Data
- func (e *Entry) Domain() string
- func (e *Entry) Hint() string
- func (e *Entry) Level() log.Level
- func (e *Entry) Message() string
- func (e *Entry) Owner() any
- func (e *Entry) Request() map[string]any
- func (e *Entry) Response() map[string]any
- func (e *Entry) Tags() []string
- func (e *Entry) Time() time.Time
- func (e *Entry) ToSlogRecord() slog.Record
- func (e *Entry) Trace() map[string]any
- func (e *Entry) User() any
- func (e *Entry) With() map[string]any
- type ServiceProvider
- type Writer
- func (r *Writer) Code(code string) log.Writer
- func (r *Writer) Debug(args ...any)
- func (r *Writer) Debugf(format string, args ...any)
- func (r *Writer) Error(args ...any)
- func (r *Writer) Errorf(format string, args ...any)
- func (r *Writer) Fatal(args ...any)
- func (r *Writer) Fatalf(format string, args ...any)
- func (r *Writer) Hint(hint string) log.Writer
- func (r *Writer) In(domain string) log.Writer
- func (r *Writer) Info(args ...any)
- func (r *Writer) Infof(format string, args ...any)
- func (r *Writer) Owner(owner any) log.Writer
- func (r *Writer) Panic(args ...any)
- func (r *Writer) Panicf(format string, args ...any)
- func (r *Writer) Request(req http.ContextRequest) log.Writer
- func (r *Writer) Response(res http.ContextResponse) log.Writer
- func (r *Writer) Tags(tags ...string) log.Writer
- func (r *Writer) User(user any) log.Writer
- func (r *Writer) Warning(args ...any)
- func (r *Writer) Warningf(format string, args ...any)
- func (r *Writer) With(data map[string]any) log.Writer
- func (r *Writer) WithTrace() log.Writer
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func HandlerToSlogHandler ¶ added in v1.17.0
func HookToHandler ¶ added in v1.17.0
HookToHandler converts a Hook to a Handler for backward compatibility. Deprecated: Use Handler directly instead, HookToHandler will be removed in v1.18.
Types ¶
type Application ¶
func NewApplication ¶ added in v1.8.1
func NewApplication(ctx context.Context, channels []string, config config.Config, json foundation.Json) (*Application, error)
func (*Application) Channel ¶ added in v1.14.0
func (r *Application) Channel(channel string) log.Log
func (*Application) WithContext ¶ added in v1.12.0
func (r *Application) WithContext(ctx context.Context) log.Log
type Entry ¶ added in v1.0.1
type Entry struct {
// contains filtered or unexported fields
}
func FromSlogRecord ¶ added in v1.17.0
func (*Entry) ToSlogRecord ¶ added in v1.17.0
type ServiceProvider ¶
type ServiceProvider struct {
}
func (*ServiceProvider) Boot ¶
func (r *ServiceProvider) Boot(app foundation.Application)
func (*ServiceProvider) Register ¶
func (r *ServiceProvider) Register(app foundation.Application)
func (*ServiceProvider) Relationship ¶ added in v1.15.12
func (r *ServiceProvider) Relationship() binding.Relationship
type Writer ¶ added in v1.2.3
type Writer struct {
// contains filtered or unexported fields
}
func (*Writer) In ¶ added in v1.13.1
In sets the feature category or domain in which the log entry is relevant.
func (*Writer) Owner ¶ added in v1.13.1
Owner set the name/email of the colleague/team responsible for handling this error.
func (*Writer) Request ¶ added in v1.13.1
func (r *Writer) Request(req http.ContextRequest) log.Writer
Request supplies a http.Request.
func (*Writer) Response ¶ added in v1.13.1
func (r *Writer) Response(res http.ContextResponse) log.Writer
Response supplies a http.Response.
func (*Writer) Tags ¶ added in v1.13.1
Tags add multiple tags, describing the feature returning an error.
Click to show internal directories.
Click to hide internal directories.