Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var ( ErrComponentFailure = errors.New("failed to get caller information") ErrJSONIndentFailure = errors.New("failed to indent data into JSON") ErrJSONConversion = errors.New("failed to convert input to JSON") ErrJSONUnmarshal = errors.New("failed to unmarshal JSON") ErrUnexpectedType = errors.New("unexpected data type after JSON conversion") ErrFieldTruncation = errors.New("some fields were truncated") )
Functions ¶
func FormatDuration ¶
FormatDuration dynamically chooses the best unit for logging.
Types ¶
type Client ¶
type Client interface {
Blackbox
contract.LogOperator
contract.ComponentExtractor
}
func NewClient ¶
func NewClient(out io.Writer, l slog.Level, d Dependencies, opts ClientOptions) (Client, error)
type ClientOption ¶
type ClientOption func(*ClientOptions)
func WithLevelKey ¶
func WithLevelKey(x Key) ClientOption
func WithMaxLen ¶
func WithMaxLen(x uint) ClientOption
func WithMessageKey ¶
func WithMessageKey(x Key) ClientOption
func WithTimeKey ¶
func WithTimeKey(x Key) ClientOption
type ClientOptions ¶
func ApplyClientOptions ¶
func ApplyClientOptions(opts *ClientOptions, modifiers ...ClientOption) ClientOptions
type DefaultTool ¶ added in v0.1.11
type DefaultTool struct {
Client Client
}
func NewTool ¶
func NewTool(c Client) (*DefaultTool, error)
func (*DefaultTool) GetComponent ¶ added in v0.1.11
func (d *DefaultTool) GetComponent(skip int, withFuncPath, withFile, withFilePath, withLine bool) string
GetComponent returns a component string.
type Dependencies ¶ added in v0.1.8
type Dependencies struct {
M contract.Marshaler
U contract.Unmarshaler
}
Click to show internal directories.
Click to hide internal directories.