Documentation ¶
Overview ¶
Package template provides a Logur adapter for TEMPLATE.
Index ¶
- type Logger
- func (l *Logger) Debug(msg string, fields ...map[string]interface{})
- func (l *Logger) DebugContext(_ context.Context, msg string, fields ...map[string]interface{})
- func (l *Logger) Error(msg string, fields ...map[string]interface{})
- func (l *Logger) ErrorContext(_ context.Context, msg string, fields ...map[string]interface{})
- func (l *Logger) Info(msg string, fields ...map[string]interface{})
- func (l *Logger) InfoContext(_ context.Context, msg string, fields ...map[string]interface{})
- func (l *Logger) LevelEnabled(level logur.Level) bool
- func (l *Logger) Trace(msg string, fields ...map[string]interface{})
- func (l *Logger) TraceContext(_ context.Context, msg string, fields ...map[string]interface{})
- func (l *Logger) Warn(msg string, fields ...map[string]interface{})
- func (l *Logger) WarnContext(_ context.Context, msg string, fields ...map[string]interface{})
Examples ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Logger ¶
type Logger struct { }
Logger is a Logur adapter for TEMPLATE.
func New ¶
func New(logger interface{}) *Logger
New returns a new Logur logger. If logger is nil, a default instance is created.
Example ¶
package main import ( templateadapter "logur.dev/adapter/template" ) func main() { var l interface{} logger := templateadapter.New(l) _ = logger }
Output:
Example (Default) ¶
If logger is nil, a default instance is created.
package main import ( templateadapter "logur.dev/adapter/template" ) func main() { logger := templateadapter.New(nil) _ = logger }
Output:
func (*Logger) DebugContext ¶
func (*Logger) ErrorContext ¶
func (*Logger) InfoContext ¶
func (*Logger) LevelEnabled ¶
LevelEnabled implements the Logur LevelEnabler interface.
func (*Logger) TraceContext ¶
Click to show internal directories.
Click to hide internal directories.