Documentation ¶
Index ¶
- func BuildLogger(level Level) *zap.Logger
- func NewNullGRPCLogger() grpclog.Logger
- type Config
- type Level
- type Leveler
- type NullLogger
- func (n *NullLogger) Fatal(args ...interface{})
- func (n *NullLogger) Fatalf(format string, args ...interface{})
- func (n *NullLogger) Fatalln(args ...interface{})
- func (n *NullLogger) Print(args ...interface{})
- func (n *NullLogger) Printf(format string, args ...interface{})
- func (n *NullLogger) Println(args ...interface{})
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func BuildLogger ¶
BuildLogger return new zap.Logger instance with given severity and debug settings
func NewNullGRPCLogger ¶
NewNullGRPCLogger returns new grpclog.Logger that log nothing.
useful for debugging to suppress lot of errors from gRPC transport when external service is unavailable
Note: logger must be set into the init() function, e.g:
func init() { grpclog.SetLogger(logging.NewNullGRPCLogger()) }
Types ¶
type Config ¶ added in v0.4.1
type Config struct {
Level *Level `yaml:"level" required:"true" default:"info"`
}
Config represents a logging config.
type Level ¶ added in v0.4.1
type Level struct {
// contains filtered or unexported fields
}
Level represents a shifted zap logging level that is able to being constructed from YAML.
func NewLevelFromString ¶ added in v0.4.1
func (*Level) UnmarshalYAML ¶ added in v0.4.1
type Leveler ¶ added in v0.4.1
type Leveler interface { // LogLevel return log verbosity. LogLevel() Level }
type NullLogger ¶
type NullLogger struct{}
func (*NullLogger) Fatal ¶
func (n *NullLogger) Fatal(args ...interface{})
func (*NullLogger) Fatalf ¶
func (n *NullLogger) Fatalf(format string, args ...interface{})
func (*NullLogger) Fatalln ¶
func (n *NullLogger) Fatalln(args ...interface{})
func (*NullLogger) Print ¶
func (n *NullLogger) Print(args ...interface{})
func (*NullLogger) Printf ¶
func (n *NullLogger) Printf(format string, args ...interface{})
func (*NullLogger) Println ¶
func (n *NullLogger) Println(args ...interface{})
Click to show internal directories.
Click to hide internal directories.