Documentation ¶
Index ¶
- func NewHCLogger(log *zerolog.Logger) hclog.Logger
- 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(level int) bool
- func (l GRPCZeroLogger) Warning(args ...interface{})
- func (l GRPCZeroLogger) Warningf(format string, args ...interface{})
- func (l GRPCZeroLogger) Warningln(args ...interface{})
- type HCLogger
- func (l *HCLogger) Debug(msg string, args ...interface{})
- func (l *HCLogger) Error(msg string, args ...interface{})
- func (l *HCLogger) ImpliedArgs() []interface{}
- func (l *HCLogger) Info(msg string, args ...interface{})
- func (l *HCLogger) IsDebug() bool
- func (l *HCLogger) IsError() bool
- func (l *HCLogger) IsInfo() bool
- func (l *HCLogger) IsTrace() bool
- func (l *HCLogger) IsWarn() bool
- func (l *HCLogger) Log(level hclog.Level, msg string, args ...interface{})
- func (l *HCLogger) Name() string
- func (l *HCLogger) Named(name string) hclog.Logger
- func (l *HCLogger) ResetNamed(name string) hclog.Logger
- func (l *HCLogger) SetLevel(level hclog.Level)
- func (l *HCLogger) StandardLogger(opts *hclog.StandardLoggerOptions) *log.Logger
- func (l *HCLogger) StandardWriter(opts *hclog.StandardLoggerOptions) io.Writer
- func (l *HCLogger) Trace(msg string, args ...interface{})
- func (l *HCLogger) Warn(msg string, args ...interface{})
- func (l *HCLogger) With(args ...interface{}) hclog.Logger
- type LevelWriter
- type OpaLogger
- func (l *OpaLogger) Debug(fmt string, a ...interface{})
- func (l *OpaLogger) Error(fmt string, a ...interface{})
- func (l *OpaLogger) GetFields() map[string]interface{}
- func (l *OpaLogger) GetLevel() logging.Level
- func (l *OpaLogger) Info(fmt string, a ...interface{})
- func (l *OpaLogger) SetLevel(level logging.Level)
- func (l *OpaLogger) Warn(fmt string, a ...interface{})
- func (l *OpaLogger) WithFields(fields map[string]interface{}) logging.Logger
- type Writer
- type ZerologWriter
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func NewHCLogger ¶ added in v0.0.4
NewHCLogger creates a HCLogger
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"` }
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) 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 HCLogger ¶ added in v0.0.4
type HCLogger struct {
// contains filtered or unexported fields
}
HCLogger is a HC logger that uses zerolog
func (*HCLogger) ImpliedArgs ¶ added in v0.0.4
func (l *HCLogger) ImpliedArgs() []interface{}
ImpliedArgs returns With key/value pairs
func (*HCLogger) IsDebug ¶ added in v0.0.4
Indicate if DEBUG logs would be emitted. This and the other Is* guards
func (*HCLogger) IsError ¶ added in v0.0.4
Indicate if ERROR logs would be emitted. This and the other Is* guards
func (*HCLogger) IsInfo ¶ added in v0.0.4
Indicate if INFO logs would be emitted. This and the other Is* guards
func (*HCLogger) IsTrace ¶ added in v0.0.4
Indicate if TRACE logs would be emitted. This and the other Is* guards are used to elide expensive logging code based on the current level.
func (*HCLogger) IsWarn ¶ added in v0.0.4
Indicate if WARN logs would be emitted. This and the other Is* guards
func (*HCLogger) Named ¶ added in v0.0.4
Create a logger that will prepend the name string on the front of all messages. If the logger already has a name, the new value will be appended to the current name. That way, a major subsystem can use this to decorate all it's own logs without losing context.
func (*HCLogger) ResetNamed ¶ added in v0.0.4
Create a logger that will prepend the name string on the front of all messages. This sets the name of the logger to the value directly, unlike Named which honor the current name as well.
func (*HCLogger) SetLevel ¶ added in v0.0.4
func (l *HCLogger) SetLevel(level hclog.Level)
Updates the level. This should affect all related loggers as well, unless they were created with IndependentLevels. If an implementation cannot update the level on the fly, it should no-op.
func (*HCLogger) StandardLogger ¶ added in v0.0.4
Return a value that conforms to the stdlib log.Logger interface
func (*HCLogger) StandardWriter ¶ added in v0.0.4
Return a value that conforms to io.Writer, which can be passed into log.SetOutput()
type LevelWriter ¶ added in v0.2.4
func (*LevelWriter) WriteLevel ¶ added in v0.2.4
type OpaLogger ¶ added in v0.2.3
type OpaLogger struct {
// contains filtered or unexported fields
}
func NewOpaLogger ¶ added in v0.2.3
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 ¶ added in v0.2.10
func NewZerologWriterWithLevel(logger *zerolog.Logger, level zerolog.Level) *ZerologWriter