Documentation ¶
Index ¶
- Constants
- Variables
- func AddFlags(fs *pflag.FlagSet)
- func Check(level int32) bool
- func Debug(msg string, fields ...Field)
- func Debugf(template string, args ...interface{})
- func Error(msg string, fields ...Field)
- func Errorf(template string, args ...interface{})
- func Fatal(msg string, fields ...Field)
- func Fatalf(template string, args ...interface{})
- func FlushLogger()
- func Format() string
- func Info(msg string, fields ...Field)
- func Infof(template string, args ...interface{})
- func InitLogger()
- func Level() string
- func MustParseFormat() string
- func MustParseLevel() string
- func Panic(msg string, fields ...Field)
- func Panicf(template string, args ...interface{})
- func Reset()
- func SetFormat(format string) error
- func SetLevel(level string) error
- func StdErrLogger() *log.Logger
- func StdInfoLogger() *log.Logger
- func Warn(msg string, fields ...Field)
- func Warnf(template string, args ...interface{})
- func ZapLogger() *zap.Logger
- type Field
Constants ¶
const ( // SamplingFreqFlagName flag name SamplingFreqFlagName = "log-sampling-frequency" // LevelFlagName flag name LevelFlagName = "log-level" // FormatFlagName flag name FormatFlagName = "log-format" // WithColorFlagName flag name WithColorFlagName = "log-enable-color" // IgnoreCallerFlagName caller flag IgnoreCallerFlagName = "log-ignore-caller" // OutputPathsName path name OutputPathsName = "log-output-paths" )
Variables ¶
var ( Any = zap.Any Array = zap.Array Object = zap.Object Binary = zap.Binary Bool = zap.Bool Bools = zap.Bools ByteString = zap.ByteString ByteStrings = zap.ByteStrings Complex64 = zap.Complex64 Complex64s = zap.Complex64s Complex128 = zap.Complex128 Complex128s = zap.Complex128s Duration = zap.Duration Durations = zap.Durations Err = zap.Error Errors = zap.Errors Float32 = zap.Float32 Float32s = zap.Float32s Float64 = zap.Float64 Float64s = zap.Float64s Int = zap.Int Ints = zap.Ints Int8 = zap.Int8 Int8s = zap.Int8s Int16 = zap.Int16 Int16s = zap.Int16s Int32 = zap.Int32 Int32s = zap.Int32s Int64 = zap.Int64 Int64s = zap.Int64s Namespace = zap.Namespace Reflect = zap.Reflect Stack = zap.Stack String = zap.String Stringer = zap.Stringer Strings = zap.Strings Time = zap.Time Times = zap.Times Uint = zap.Uint Uints = zap.Uints Uint8 = zap.Uint8 Uint8s = zap.Uint8s Uint16 = zap.Uint16 Uint16s = zap.Uint16s Uint32 = zap.Uint32 Uint32s = zap.Uint32s Uint64 = zap.Uint64 Uint64s = zap.Uint64s Uintptr = zap.Uintptr Uintptrs = zap.Uintptrs )
nolint: golint
Functions ¶
func AddFlags ¶
AddFlags registers this package's flags on arbitrary FlagSets, such that they point to the same value as the global flags.
func Debugf ¶
func Debugf(template string, args ...interface{})
Debugf uses fmt.Sprintf to log a templated message.
func Errorf ¶
func Errorf(template string, args ...interface{})
Errorf uses fmt.Sprintf to log a templated message.
func Fatalf ¶
func Fatalf(template string, args ...interface{})
Fatalf uses fmt.Sprintf to log a templated message, then calls os.Exit.
func FlushLogger ¶
func FlushLogger()
FlushLogger calls the underlying Core's Sync method, flushing any buffered log entries. Applications should take care to call Sync before exiting.
func Infof ¶
func Infof(template string, args ...interface{})
Infof uses fmt.Sprintf to log a templated message.
func Panicf ¶
func Panicf(template string, args ...interface{})
Panicf uses fmt.Sprintf to log a templated message, then panics.
func StdErrLogger ¶
StdErrLogger returns logger of standard library which writes to supplied zap logger at error level
func StdInfoLogger ¶
StdInfoLogger returns logger of standard library which writes to supplied zap logger at info level