Documentation ¶
Overview ¶
nolint:forbidigo // allow usage of the "zap" package
nolint:forbidigo // allow usage of the "zap" package
nolint:forbidigo // allow usage of the "zap" package
nolint:forbidigo // allow usage of the "zap" package
nolint:forbidigo // allow usage of the "zap" package
nolint:forbidigo // allow usage of the "zap" package
nolint:forbidigo // allow usage of the "zap" package
nolint:forbidigo // allow usage of the "zap" package
nolint:forbidigo // allow usage of the "zap" package
nolint:forbidigo // allow usage of the "zap" package
Index ¶
Constants ¶
const ( DebugLevel = zapcore.DebugLevel InfoLevel = zapcore.InfoLevel WarnLevel = zapcore.WarnLevel ErrorLevel = zapcore.ErrorLevel )
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type DebugLogger ¶
type DebugLogger interface { Logger ConnectTo(writer io.Writer) Truncate() AllMessages() string DebugMessages() string InfoMessages() string WarnMessages() string WarnAndErrorMessages() string ErrorMessages() string }
DebugLogger returns logs as string in tests.
func NewDebugLogger ¶
func NewDebugLogger() DebugLogger
NewDebugLogger returns logs as string by String() method. See also other methods of the ioutil.Writer.
type File ¶
type File struct {
// contains filtered or unexported fields
}
func NewLogFile ¶
NewLogFile creates a log file defined in the flags or create a temp file. Log file can be outside project directory, so it is NOT using virtual filesystem.
type LevelWriter ¶
type LevelWriter struct {
// contains filtered or unexported fields
}
func (*LevelWriter) Close ¶
func (w *LevelWriter) Close() error
func (*LevelWriter) Write ¶
func (w *LevelWriter) Write(p []byte) (n int, err error)
Write messages with the defined level to zapLogger.
func (*LevelWriter) WriteNoErr ¶
func (w *LevelWriter) WriteNoErr(p []byte)
func (*LevelWriter) WriteString ¶
func (w *LevelWriter) WriteString(s string)
func (*LevelWriter) WriteStringIndent ¶
func (w *LevelWriter) WriteStringIndent(indent int, s string)
type Logger ¶
type Logger interface {
// contains filtered or unexported methods
}
func NewCliLogger ¶
NewCliLogger new production zapLogger for CLI.
func NewNopLogger ¶
func NewNopLogger() Logger
NewNopLogger returns no operation log. The logs are discarded.
type MemoryLogger ¶
type MemoryLogger struct {
// contains filtered or unexported fields
}
func NewMemoryLogger ¶
func NewMemoryLogger() *MemoryLogger
func (*MemoryLogger) CopyLogsTo ¶
func (l *MemoryLogger) CopyLogsTo(target Logger)
func (MemoryLogger) DebugWriter ¶
func (l MemoryLogger) DebugWriter() *LevelWriter
func (MemoryLogger) ErrorWriter ¶
func (l MemoryLogger) ErrorWriter() *LevelWriter
func (MemoryLogger) InfoWriter ¶
func (l MemoryLogger) InfoWriter() *LevelWriter
func (MemoryLogger) WarnWriter ¶
func (l MemoryLogger) WarnWriter() *LevelWriter
type PrefixLogger ¶
type PrefixLogger interface { Logger Prefix() string WithPrefix(prefix string) PrefixLogger }
func NewApiLogger ¶
func NewApiLogger(base *stdLog.Logger, prefix string, verbose bool) PrefixLogger
NewApiLogger new production zapLogger for API.