Documentation ¶
Index ¶
- func NewLogger(logOutput Writer, errorOutput ErrWriter, cfg *Config) (*zerolog.Logger, error)
- func NewSTDLogger(logger *zerolog.Logger) *log.Logger
- func TestLogger(logOutput io.Writer) *zerolog.Logger
- type Config
- type ErrWriter
- type GRPCZeroLogger
- func (l GRPCZeroLogger) Error(args ...interface{})
- func (l GRPCZeroLogger) Errorf(format string, args ...interface{})
- func (l GRPCZeroLogger) Errorln(args ...interface{})
- func (l GRPCZeroLogger) Fatal(args ...interface{})
- func (l GRPCZeroLogger) Fatalf(format string, args ...interface{})
- func (l GRPCZeroLogger) Fatalln(args ...interface{})
- func (l GRPCZeroLogger) Info(args ...interface{})
- func (l GRPCZeroLogger) Infof(format string, args ...interface{})
- func (l GRPCZeroLogger) Infoln(args ...interface{})
- func (l GRPCZeroLogger) Print(args ...interface{})
- func (l GRPCZeroLogger) Printf(format string, args ...interface{})
- func (l GRPCZeroLogger) Println(args ...interface{})
- func (l GRPCZeroLogger) V(_ int) bool
- func (l GRPCZeroLogger) Warning(args ...interface{})
- func (l GRPCZeroLogger) Warningf(format string, args ...interface{})
- func (l GRPCZeroLogger) Warningln(args ...interface{})
- type LevelWriter
- type Writer
- type ZerologWriter
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func NewSTDLogger ¶
NewSTDLogger creates a standard logger that writes to a zerolog logger.
Types ¶
type Config ¶
type Config struct { Prod bool `json:"prod"` LogLevelParsed zerolog.Level `json:"-"` LogLevel string `json:"log_level"` GrpcLogLevel string `json:"grpc_log_level"` }
Config represents logging configuration.
type GRPCZeroLogger ¶
type GRPCZeroLogger struct {
// contains filtered or unexported fields
}
GRPCZeroLogger is a GRPC logger that uses zerolog.
func NewGRPCZeroLogger ¶
func NewGRPCZeroLogger(log *zerolog.Logger, level zerolog.Level) GRPCZeroLogger
NewGRPCZeroLogger creates a GRPCZeroLogger.
func (GRPCZeroLogger) Error ¶
func (l GRPCZeroLogger) Error(args ...interface{})
Error logs an error message.
func (GRPCZeroLogger) Errorf ¶
func (l GRPCZeroLogger) Errorf(format string, args ...interface{})
Errorf formats and logs an error message.
func (GRPCZeroLogger) Errorln ¶
func (l GRPCZeroLogger) Errorln(args ...interface{})
Errorln logs an error message and a newline.
func (GRPCZeroLogger) Fatal ¶
func (l GRPCZeroLogger) Fatal(args ...interface{})
Fatal logs a fatal message.
func (GRPCZeroLogger) Fatalf ¶
func (l GRPCZeroLogger) Fatalf(format string, args ...interface{})
Fatalf formats and logs a fatal message.
func (GRPCZeroLogger) Fatalln ¶
func (l GRPCZeroLogger) Fatalln(args ...interface{})
Fatalln logs a fatal message and a newline.
func (GRPCZeroLogger) Info ¶
func (l GRPCZeroLogger) Info(args ...interface{})
Info logs an info message.
func (GRPCZeroLogger) Infof ¶
func (l GRPCZeroLogger) Infof(format string, args ...interface{})
Infof formats and logs an info message.
func (GRPCZeroLogger) Infoln ¶
func (l GRPCZeroLogger) Infoln(args ...interface{})
Infoln formats and logs an info message and a newline.
func (GRPCZeroLogger) Print ¶
func (l GRPCZeroLogger) Print(args ...interface{})
Print prints a message.
func (GRPCZeroLogger) Printf ¶
func (l GRPCZeroLogger) Printf(format string, args ...interface{})
Printf formats and prints a message.
func (GRPCZeroLogger) Println ¶
func (l GRPCZeroLogger) Println(args ...interface{})
Println prints a message and a newline.
func (GRPCZeroLogger) Warning ¶
func (l GRPCZeroLogger) Warning(args ...interface{})
Warning logs a warning message.
func (GRPCZeroLogger) Warningf ¶
func (l GRPCZeroLogger) Warningf(format string, args ...interface{})
Warningf formats and logs a warning message.
func (GRPCZeroLogger) Warningln ¶
func (l GRPCZeroLogger) Warningln(args ...interface{})
Warningln formats and logs a warning message and a newline.
type LevelWriter ¶
func (*LevelWriter) WriteLevel ¶
type ZerologWriter ¶
type ZerologWriter struct {
// contains filtered or unexported fields
}
ZerologWriter implements io.Writer for a zerolog logger.
func NewZerologWriter ¶
func NewZerologWriter(logger *zerolog.Logger) *ZerologWriter
NewZerologWriter creates a new ZerologWriter.
func NewZerologWriterWithLevel ¶
func NewZerologWriterWithLevel(logger *zerolog.Logger, level zerolog.Level) *ZerologWriter