Documentation ¶
Index ¶
- func NewContext(ctx context.Context, xl *Logger) context.Context
- type LogPrefix
- type Logger
- func (l *Logger) AddPrefix(prefix LogPrefix) *Logger
- func (l *Logger) AppendPrefix(prefix string) *Logger
- func (l *Logger) Debugf(format string, v ...interface{})
- func (l *Logger) Errorf(format string, v ...interface{})
- func (l *Logger) Infof(format string, v ...interface{})
- func (l *Logger) ResetPrefixes() (old []LogPrefix)
- func (l *Logger) Spawn() *Logger
- func (l *Logger) Tracef(format string, v ...interface{})
- func (l *Logger) Warnf(format string, v ...interface{})
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type LogPrefix ¶
type LogPrefix struct { // Name is the name of the prefix, it won't be displayed in log but used to identify the prefix. Name string // Value is the value of the prefix, it will be displayed in log. Value string // The prefix with higher priority will be displayed first, default is 10. Priority int }
type Logger ¶
type Logger struct {
// contains filtered or unexported fields
}
Logger is not thread safety for operations on prefix
func FromContextSafe ¶
func (*Logger) AppendPrefix ¶
func (*Logger) ResetPrefixes ¶
Click to show internal directories.
Click to hide internal directories.