Documentation ¶
Index ¶
- func HandleError(errorHandler ErrorHandler, err error)
- type ErrorHandler
- type Logger
- type NoopErrorHandler
- type NoopLogger
- func (NoopLogger) Debug(_ string, _ ...map[string]interface{})
- func (NoopLogger) DebugContext(_ context.Context, _ string, _ ...map[string]interface{})
- func (NoopLogger) Error(_ string, _ ...map[string]interface{})
- func (NoopLogger) ErrorContext(_ context.Context, _ string, _ ...map[string]interface{})
- func (NoopLogger) Info(_ string, _ ...map[string]interface{})
- func (NoopLogger) InfoContext(_ context.Context, _ string, _ ...map[string]interface{})
- func (NoopLogger) Trace(_ string, _ ...map[string]interface{})
- func (NoopLogger) TraceContext(_ context.Context, _ string, _ ...map[string]interface{})
- func (NoopLogger) Warn(_ string, _ ...map[string]interface{})
- func (NoopLogger) WarnContext(_ context.Context, _ string, _ ...map[string]interface{})
- func (n NoopLogger) WithContext(_ context.Context) Logger
- func (n NoopLogger) WithFields(_ map[string]interface{}) Logger
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func HandleError ¶
func HandleError(errorHandler ErrorHandler, err error)
HandleError wraps ErrorHandler and Errors to perform additional tasks, such as sending an error to Sentry before sending it on to the error handler
Types ¶
type ErrorHandler ¶
ErrorHandler handles an error.
type Logger ¶
type Logger interface { // Trace logs a trace event. Trace(msg string, fields ...map[string]interface{}) // Debug logs a debug event. Debug(msg string, fields ...map[string]interface{}) // Info logs an info event. Info(msg string, fields ...map[string]interface{}) // Warn logs a warning event. Warn(msg string, fields ...map[string]interface{}) // Error logs an error event. Error(msg string, fields ...map[string]interface{}) // TraceContext logs a trace event with a context. TraceContext(ctx context.Context, msg string, fields ...map[string]interface{}) // DebugContext logs a debug event with a context. DebugContext(ctx context.Context, msg string, fields ...map[string]interface{}) // InfoContext logs an info event with a context. InfoContext(ctx context.Context, msg string, fields ...map[string]interface{}) // WarnContext logs a warning event with a context. WarnContext(ctx context.Context, msg string, fields ...map[string]interface{}) // ErrorContext logs an error event with a context. ErrorContext(ctx context.Context, msg string, fields ...map[string]interface{}) // WithFields annotates a logger with key-value pairs. WithFields(fields map[string]interface{}) Logger // WithContext annotates a logger with a context. WithContext(ctx context.Context) Logger }
Logger is the fundamental interface for all log operations.
type NoopErrorHandler ¶
type NoopErrorHandler struct{}
NoopErrorHandler is an error handler that discards every error.
func (NoopErrorHandler) HandleContext ¶
func (NoopErrorHandler) HandleContext(_ context.Context, _ error)
HandleContext ignore
type NoopLogger ¶
type NoopLogger struct{}
NoopLogger is a logger that discards every log event.
func (NoopLogger) Debug ¶
func (NoopLogger) Debug(_ string, _ ...map[string]interface{})
Debug ignore
func (NoopLogger) DebugContext ¶
func (NoopLogger) DebugContext(_ context.Context, _ string, _ ...map[string]interface{})
DebugContext ignore
func (NoopLogger) Error ¶
func (NoopLogger) Error(_ string, _ ...map[string]interface{})
Error ignore
func (NoopLogger) ErrorContext ¶
func (NoopLogger) ErrorContext(_ context.Context, _ string, _ ...map[string]interface{})
ErrorContext ignore
func (NoopLogger) InfoContext ¶
func (NoopLogger) InfoContext(_ context.Context, _ string, _ ...map[string]interface{})
InfoContext ignore
func (NoopLogger) Trace ¶
func (NoopLogger) Trace(_ string, _ ...map[string]interface{})
Trace ignore
func (NoopLogger) TraceContext ¶
func (NoopLogger) TraceContext(_ context.Context, _ string, _ ...map[string]interface{})
TraceContext ignore
func (NoopLogger) WarnContext ¶
func (NoopLogger) WarnContext(_ context.Context, _ string, _ ...map[string]interface{})
WarnContext ignore
func (NoopLogger) WithContext ¶
func (n NoopLogger) WithContext(_ context.Context) Logger
WithContext ignore
func (NoopLogger) WithFields ¶
func (n NoopLogger) WithFields(_ map[string]interface{}) Logger
WithFields ignore
Click to show internal directories.
Click to hide internal directories.