Documentation
¶
Index ¶
- func NewContext(ctx context.Context, xl *Logger) context.Context
- type LogPrefix
- type LogWriter
- type Logger
- func (l *Logger) AddPrefix(prefix LogPrefix) *Logger
- func (l *Logger) AppendPrefix(prefix string) *Logger
- func (l *Logger) Debugf(format string, v ...any)
- func (l *Logger) Errorf(format string, v ...any)
- func (l *Logger) Infof(format string, v ...any)
- func (l *Logger) ResetPrefixes() (old []LogPrefix)
- func (l *Logger) Spawn() *Logger
- func (l *Logger) Tracef(format string, v ...any)
- func (l *Logger) Warnf(format string, v ...any)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type LogPrefix ¶ added in v0.53.0
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 LogWriter ¶ added in v0.65.0
type LogWriter struct {
// contains filtered or unexported fields
}
LogWriter forwards writes to frp's logger at configurable level. It is safe for concurrent use as long as the underlying Logger is thread-safe.
func NewDebugWriter ¶ added in v0.65.0
func NewErrorWriter ¶ added in v0.65.0
func NewInfoWriter ¶ added in v0.65.0
func NewTraceWriter ¶ added in v0.65.0
func NewWarnWriter ¶ added in v0.65.0
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.