Documentation
¶
Index ¶
- Constants
- func ClearMemoryLog()
- func Close()
- func CloseCatchStdout()
- func Debug(ctx context.Context, kvPairs ...interface{})
- func DebugFlag() bool
- func Debugf(ctx context.Context, format string, params ...interface{})
- func Error(ctx context.Context, alarmType string, kvPairs ...interface{})
- func Errorf(ctx context.Context, alarmType string, format string, params ...interface{})
- func Flush()
- func GetMemoryLogCount() int
- func Info(ctx context.Context, kvPairs ...interface{})
- func Infof(ctx context.Context, format string, params ...interface{})
- func InitLogger()
- func InitTestLogger(options ...ConfigOption)
- func OptionAsyncLogger()
- func OptionDebugLevel()
- func OptionErrorLevel()
- func OptionInfoLevel()
- func OptionOffConsole()
- func OptionOffMemoryReceiver()
- func OptionOpenConsole()
- func OptionOpenMemoryReceiver()
- func OptionOverrideConfig()
- func OptionRetainConfig()
- func OptionSyncLogger()
- func OptionWarnLevel()
- func ReadMemoryLog(line int) (msg string, ok bool)
- func Warning(ctx context.Context, alarmType string, kvPairs ...interface{})
- func Warningf(ctx context.Context, alarmType string, format string, params ...interface{})
- type ConfigOption
- type MemoryWriter
Constants ¶
View Source
const ( FlagLevelName = "logger-level" FlagConsoleName = "logger-console" FlagRetainName = "logger-retain" )
Variables ¶
This section is empty.
Functions ¶
func CloseCatchStdout ¶
func CloseCatchStdout()
CloseCatchStdout close the goroutine with the catching stdout task.
func GetMemoryLogCount ¶
func GetMemoryLogCount() int
GetMemoryLogCount returns the stored logs count, but only store the recently maxLines items.
func InitLogger ¶
func InitLogger()
func InitTestLogger ¶
func InitTestLogger(options ...ConfigOption)
func OptionAsyncLogger ¶
func OptionAsyncLogger()
func OptionDebugLevel ¶
func OptionDebugLevel()
func OptionErrorLevel ¶
func OptionErrorLevel()
func OptionInfoLevel ¶
func OptionInfoLevel()
func OptionOffConsole ¶
func OptionOffConsole()
func OptionOffMemoryReceiver ¶
func OptionOffMemoryReceiver()
func OptionOpenConsole ¶
func OptionOpenConsole()
func OptionOpenMemoryReceiver ¶
func OptionOpenMemoryReceiver()
func OptionOverrideConfig ¶
func OptionOverrideConfig()
func OptionRetainConfig ¶
func OptionRetainConfig()
func OptionSyncLogger ¶
func OptionSyncLogger()
func OptionWarnLevel ¶
func OptionWarnLevel()
func ReadMemoryLog ¶
ReadMemoryLog get log when MemoryWriter working.
Types ¶
type ConfigOption ¶
type ConfigOption func()
type MemoryWriter ¶
type MemoryWriter struct { }
MemoryWriter provide a easy way to check log in testing.
func (*MemoryWriter) AfterParse ¶
func (m *MemoryWriter) AfterParse(initArgs seelog.CustomReceiverInitArgs) error
func (*MemoryWriter) Close ¶
func (m *MemoryWriter) Close() error
func (*MemoryWriter) Flush ¶
func (m *MemoryWriter) Flush()
func (*MemoryWriter) ReceiveMessage ¶
func (m *MemoryWriter) ReceiveMessage(message string, level seelog.LogLevel, context seelog.LogContextInterface) error
Click to show internal directories.
Click to hide internal directories.