zlog

package
v0.1.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Apr 21, 2020 License: Apache-2.0 Imports: 10 Imported by: 0

Documentation

Index

Constants

View Source
const TIMEFORMAT = "2006-01-02 15:04:05"

Variables

This section is empty.

Functions

func ApiErrorf added in v0.0.8

func ApiErrorf(param, format string, args ...interface{})

func ApiInfof added in v0.0.8

func ApiInfof(param, format string, args ...interface{})

func Debug added in v0.0.5

func Debug(msg string)

func Debugf added in v0.0.5

func Debugf(format string, args ...interface{})

func Error added in v0.0.5

func Error(msg string)

func Errorf

func Errorf(format string, args ...interface{})

func Info added in v0.0.5

func Info(msg string)

func Infof

func Infof(format string, args ...interface{})

func InitLogger

func InitLogger(c *Config)

func Warn added in v0.1.0

func Warn(msg string)

func Warnf added in v0.1.0

func Warnf(format string, args ...interface{})

Types

type Config

type Config struct {
	Name       string
	Debug      bool
	KafkaAddr  string
	WriteKafka bool

	LogFileDir    string `json:"logFileDir"`
	ErrorFileName string `json:"errorFileName"`
	WarnFileName  string `json:"warnFileName"`
	InfoFileName  string `json:"infoFileName"`
	DebugFileName string `json:"debugFileName"`
	MaxSize       int    `json:"maxSize"` // megabytes
	MaxBackups    int    `json:"maxBackups"`
	MaxAge        int    `json:"maxAge"` // days
}

type LogKafka

type LogKafka struct {
	Producer sarama.SyncProducer
	Topic    string
}

func (*LogKafka) Write

func (lk *LogKafka) Write(p []byte) (n int, err error)

type Logger added in v0.0.8

type Logger struct {
	*zap.Logger
	// contains filtered or unexported fields
}

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL