Documentation
¶
Index ¶
- Constants
- func Debug(args ...interface{})
- func Debugf(format string, args ...interface{})
- func Error(args ...interface{})
- func Errorf(format string, args ...interface{})
- func Fatal(args ...interface{})
- func Fatalf(format string, args ...interface{})
- func Info(args ...interface{})
- func Infof(format string, args ...interface{})
- func Init(opts ...Option) error
- func InitLogger(opts ...Option)
- func Log(level string, v ...interface{})
- func Logf(level string, format string, v ...interface{})
- func Warn(args ...interface{})
- func Warnf(format string, args ...interface{})
- type Logger
- type Option
- type Options
- type Rotation
Constants ¶
View Source
const ( DebugLevel = "debug" InfoLevel = "info" WarnLevel = "warn" ErrorLevel = "error" PanicLevel = "panic" FatalLevel = "fatal" )
Variables ¶
This section is empty.
Functions ¶
Types ¶
type Logger ¶
type Logger interface {
// Init initializes options
Init(options ...Option) error
// Fields set fields to always be logged
Fields(fields map[string]interface{}) Logger
// Log writes a log entry
Log(level string, v ...interface{})
// Logf writes a formatted log entry
Logf(level string, format string, v ...interface{})
}
Logger is a generic logging interface.
func NewExampleLogger ¶
func NewExampleLogger() Logger
NewExampleLogger builds a Logger that's designed for use in zap's testable
type Option ¶
type Option func(*Options)
func WithCallerSkipCount ¶
func WithDisableConsole ¶
func WithDisableConsole() Option
func WithFields ¶
func WithJsonEncoding ¶
func WithJsonEncoding() Option
func WithLogDir ¶
func WithRotation ¶
Click to show internal directories.
Click to hide internal directories.