Documentation
¶
Overview ¶
Package xraylog implements a logger with a log level, and an interface for a custom logger. By default, the SDK logs error messages to the os.Stderr. The log level of the built in logger can be set by using either the AWS_XRAY_DEBUG_MODE or AWS_XRAY_LOG_LEVEL environment variables. If AWS_XRAY_DEBUG_MODE is set, the log level is set to the debug level. AWS_XRAY_LOG_LEVEL may be set to debug, info, warn, error or silent. This value is ignored if AWS_XRAY_DEBUG_MODE is set.
Index ¶
- func Debug(ctx context.Context, v ...any)
- func Debugf(ctx context.Context, format string, v ...any)
- func Error(ctx context.Context, v ...any)
- func Errorf(ctx context.Context, format string, v ...any)
- func Info(ctx context.Context, v ...any)
- func Infof(ctx context.Context, format string, v ...any)
- func SetLogger(logger Logger)
- func Warn(ctx context.Context, v ...any)
- func Warnf(ctx context.Context, format string, v ...any)
- func WithLogger(ctx context.Context, logger Logger) context.Context
- type LogLevel
- type Logger
- type NullLogger
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type LogLevel ¶
type LogLevel int
LogLevel represents the severity of a log message, where a higher value means more severe. The integer value should not be serialized as it is subject to change.
type Logger ¶
type Logger interface { // Log outputs the msg into the log. msg is fmt.Stringer because of lazy evaluation. // It may be called concurrently from multiple goroutines. Log(ctx context.Context, level LogLevel, msg fmt.Stringer) }
Logger is the logging interface used by X-Ray YA-SDK.
func ContextLogger ¶
ContextLogger returns the context logger. If the context has no logger, returns the global logger.