Documentation
¶
Index ¶
- Variables
- func Debug(msg string, v ...interface{})
- func EnableInMemoryBuffer(capacity int)
- func Error(msg string, v ...interface{})
- func Fatal(msg string, v ...interface{})
- func GetBufferedLogs() string
- func Info(msg string, v ...interface{})
- func Init(logType, logLevel, logPath string, maxSize, maxBackups, maxAge int, ...)
- func Panic(msg string, v ...interface{})
- func Print(v ...interface{})
- func Printf(msg string, v ...interface{})
- func Println(v ...interface{})
- func SetLevel(levelStr string)
- func Trace(msg string, v ...interface{})
- func Warn(msg string, v ...interface{})
- type BufferWriter
Constants ¶
This section is empty.
Variables ¶
View Source
var ( Logger zerolog.Logger ZapLogger *zap.Logger )
Functions ¶
func EnableInMemoryBuffer ¶
func EnableInMemoryBuffer(capacity int)
EnableInMemoryBuffer activates an in-memory circular buffer of given capacity
func GetBufferedLogs ¶
func GetBufferedLogs() string
GetBufferedLogs returns and clears the in-memory buffer
func Init ¶
func Init( logType, logLevel, logPath string, maxSize, maxBackups, maxAge int, compress bool, color bool, )
Init initializes the global logger. logType: "stdout"|"file"|"both"|"off" logLevel: "trace"|"debug"|"info"|"warn"|"error"|"fatal"|"panic"|"off" logPath: file path (required for file/both) maxSize: max size per file in MB maxBackups: max number of backups maxAge: max age in days compress: whether to compress old logs color: whether to enable ANSI color codes in console output
Types ¶
type BufferWriter ¶
type BufferWriter struct {
// contains filtered or unexported fields
}
func NewBufferWriter ¶
func NewBufferWriter(capacity int) *BufferWriter
func (*BufferWriter) GetAndClear ¶
func (w *BufferWriter) GetAndClear() string
Click to show internal directories.
Click to hide internal directories.