Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type Entry ¶
type Entry struct { Time time.Time `json:"time"` Level slog.Level `json:"level"` Message string `json:"msg"` Error string `json:"error"` Raw json.RawMessage }
Entry is a convenience struct containing basic information TODO replace the fields with methods to save ram
func (Entry) Get ¶
Use Get if you want to get a value from a LogEntry that is not contained within the message. Use the dot notation for that. For more information about dot notation see https://github.com/tidwall/gjson
func (Entry) GetMany ¶
GetMany searches json for the multiple paths. The return value is a Result array where the number of items will be equal to the number of input paths. Use the dot notation for that. For more information about dot notation see https://github.com/tidwall/gjson
type Hook ¶
type Hook struct {
// contains filtered or unexported fields
}
Inspired by Logrus Testing Hook, this is my version for slog.
func NewHookLoggerWithOptions ¶
func NewHookLoggerWithOptions(options *slog.HandlerOptions) (Hook, *slog.Logger)
Click to show internal directories.
Click to hide internal directories.