Documentation
¶
Index ¶
- func Debug(ctx context.Context, msg string, keysAndValues ...interface{})
- func Error(ctx context.Context, err error, msg string, keysAndValues ...interface{})
- func Info(ctx context.Context, msg string, keysAndValues ...interface{})
- func Setup(ctx context.Context, p Parameters) context.Context
- func Warn(ctx context.Context, msg string, keysAndValues ...interface{})
- func WithValues(ctx context.Context, keysAndValues ...interface{}) context.Context
- type Handler
- type Option
- type Parameters
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func Setup ¶
func Setup(ctx context.Context, p Parameters) context.Context
Setup initializes the logger and returns a new context with the logger attached. The logger is configured based on the provided Parameters. The encoder and writer are selected based on the Development flag. The LogLevel parameter determines the log level of the logger. The StacktraceLevel parameter determines the log level at which a stack trace is added to log entries. The function does not modify the original context.
Example usage:
ctx := Setup(context.Background(), Parameters{ LogLevel: "debug", StacktraceLevel: "error", Development: true, })
Types ¶
type Handler ¶
func NewHandler ¶
type Option ¶
type Option interface {
// contains filtered or unexported methods
}
func WithWriter ¶
Click to show internal directories.
Click to hide internal directories.