12345678910111213141516171819202122232425262728 |
- package main
- import (
- "field-dispose/config"
- "fmt"
- "jygit.jydev.jianyu360.cn/data_processing/common_utils/log"
- "os"
- )
- // InitLog @Description
- // @Author J 2022/7/26 15:30
- func InitLog() {
- logcfg := config.Conf.Log
- err := log.InitLog(
- log.Path(logcfg.LogPath),
- log.Level(logcfg.LogLevel),
- log.Compress(logcfg.Compress),
- log.MaxSize(logcfg.MaxSize),
- log.MaxBackups(logcfg.MaxBackups),
- log.MaxAge(logcfg.MaxAge),
- log.Format(logcfg.Format),
- )
- if err != nil {
- fmt.Printf("InitLog failed: %v\n", err)
- os.Exit(1)
- }
- }
|