日志组件
Go to file Use this template
wangjian 58a846e055 modify readme, add example 2022-07-13 13:49:11 +08:00
README.md modify readme, add example 2022-07-13 13:49:11 +08:00
go.mod init 2022-07-13 13:24:44 +08:00
logger.go init 2022-07-13 13:24:44 +08:00

README.md

logging

日志组件

使用说明

日志组件封装了uber/zap使用基本一致

package main

import(
    "git.hpds.cc/Component/logging"
    
    "go.uber.org/zap/zapcore"
)

func main(){
    opt := Options{
        Path           : "./log/",
        Prefix         : "",
        ErrorFileSuffix: "",
        WarnFileSuffix : "",
        InfoFileSuffix : "",
        DebugFileSuffix: "",
        Level          : zapcore.DebugLevel,
        MaxSize        : 100,
        MaxBackups     : 1000,
        MaxAge         : 30,
        Development    : true,
    }
    logger := logging.NewLogger(opt)
    logger.Info("this is a test log")
}