|
il y a 4 ans | |
---|---|---|
.idea | il y a 4 ans | |
common.go | il y a 4 ans | |
go.mod | il y a 4 ans | |
go.sum | il y a 4 ans | |
log.go | il y a 4 ans | |
log_test.go | il y a 4 ans | |
readme.MD | il y a 4 ans | |
rpc.go | il y a 4 ans |
export GOSUMDB=off export GOPROXY="direct"
使用日志实例 打开一个文件输出 f, err := os.OpenFile("./log/log.txt", os.O_APPEND|os.O_CREATE|os.O_WRONLY, 0644) if err != nil {
panic("不能打开日志文件 " + err.Error())
}
项目内 全局初始化 这个日志实例,传入存储对象 NewLogger(f) defer close(f)