Skip to content

litsea/logger

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

7 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

logger

Initial logger by viper

Quick Start

viper.SetConfigName("config")
viper.AddConfigPath(".")
if err := viper.ReadInConfig(); err != nil {
    fmt.Println("read config failed: ", err)
    os.Exit(1)
}

v := viper.Sub("log")
if err := logger.NewLogger(v, logger.DriverZap); err != nil {
    fmt.Println("init logger failed: ", err)
    os.Exit(1)
}

logger.Info("Logger initialized")

Log driver

Configuration

see: config.yml