Documentation ¶
Index ¶
- func CDebug(ctx context.Context, msg ...interface{})
- func CDebugf(ctx context.Context, msgfmt string, args ...interface{})
- func CError(ctx context.Context, msg ...interface{})
- func CErrorf(ctx context.Context, msgfmt string, args ...interface{})
- func CInfo(ctx context.Context, msg ...interface{})
- func CInfof(ctx context.Context, msgfmt string, args ...interface{})
- func CWarn(ctx context.Context, msg ...interface{})
- func CWarnf(ctx context.Context, msgfmt string, args ...interface{})
- func Debug(msg ...interface{})
- func Debugf(msgfmt string, args ...interface{})
- func Error(msg ...interface{})
- func Errorf(msgfmt string, args ...interface{})
- func Info(msg ...interface{})
- func Infof(msgfmt string, args ...interface{})
- func Set(ctx context.Context, log LogContext) context.Context
- func SetLevel(name string) error
- func Warn(msg ...interface{})
- func Warnf(msgfmt string, args ...interface{})
- type FormattingFunction
- type LogContext
- type OptionalSingletonMessage
- func (this *OptionalSingletonMessage) Default(msg string, args ...interface{})
- func (this *OptionalSingletonMessage) Enforce(msg string, args ...interface{})
- func (this *OptionalSingletonMessage) IsPending() bool
- func (this *OptionalSingletonMessage) Once()
- func (this *OptionalSingletonMessage) Out(msg string, args ...interface{})
- func (this *OptionalSingletonMessage) Reset()
- func (this *OptionalSingletonMessage) ResetWith(msg string, args ...interface{})
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type FormattingFunction ¶ added in v0.2.0
type FormattingFunction func(msgfmt string, args ...interface{})
type LogContext ¶
type LogContext interface { NewContext(key, value string) LogContext AddIndent(indent string) LogContext Info(msg ...interface{}) Debug(msg ...interface{}) Warn(msg ...interface{}) Error(msg ...interface{}) Infof(msgfmt string, args ...interface{}) Debugf(msgfmt string, args ...interface{}) Warnf(msgfmt string, args ...interface{}) Errorf(msgfmt string, args ...interface{}) }
func Get ¶
func Get(ctx context.Context) LogContext
func New ¶
func New() LogContext
func NewContext ¶
func NewContext(key, value string) LogContext
func WithLogger ¶
type OptionalSingletonMessage ¶ added in v0.2.0
type OptionalSingletonMessage struct {
// contains filtered or unexported fields
}
func NewOptionalSingletonMessage ¶ added in v0.2.0
func NewOptionalSingletonMessage(function FormattingFunction, msg string, args ...interface{}) *OptionalSingletonMessage
NewOptionalSingletonMessage creates a new message outputer with a singleton section/header message that is printed before the first regular output, if there is such an output
func (*OptionalSingletonMessage) Default ¶ added in v0.2.0
func (this *OptionalSingletonMessage) Default(msg string, args ...interface{})
Default outputs a given default message if Once has never been called and disables the standard Once message
func (*OptionalSingletonMessage) Enforce ¶ added in v0.2.0
func (this *OptionalSingletonMessage) Enforce(msg string, args ...interface{})
Enforce always outputs the given message and omits further default output (explicit via method Default or implicit via method Once) without checking whether this is the first call
func (*OptionalSingletonMessage) IsPending ¶ added in v0.2.0
func (this *OptionalSingletonMessage) IsPending() bool
IsPending returns whether the header/section message is still pending
func (*OptionalSingletonMessage) Once ¶ added in v0.2.0
func (this *OptionalSingletonMessage) Once()
Once outputs the configured message the first time it is called
func (*OptionalSingletonMessage) Out ¶ added in v0.2.0
func (this *OptionalSingletonMessage) Out(msg string, args ...interface{})
Out outputs a message after calling Once to ensure a header/section message
func (*OptionalSingletonMessage) Reset ¶ added in v0.2.0
func (this *OptionalSingletonMessage) Reset()
Reset resets the done flag (
func (*OptionalSingletonMessage) ResetWith ¶ added in v0.2.0
func (this *OptionalSingletonMessage) ResetWith(msg string, args ...interface{})
ResetWith restarts the object with a new message