Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/xxl6097/go-glog
go-glog
https://github.com/xxl6097/go-glog
Last synced: 24 days ago
JSON representation
go-glog
- Host: GitHub
- URL: https://github.com/xxl6097/go-glog
- Owner: xxl6097
- Created: 2023-05-25T07:54:33.000Z (over 1 year ago)
- Default Branch: main
- Last Pushed: 2024-07-31T08:19:11.000Z (3 months ago)
- Last Synced: 2024-07-31T09:39:58.556Z (3 months ago)
- Language: Go
- Size: 105 KB
- Stars: 0
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# go-glog的使用方式
```shell
git add .
git commit -m "release v0.0.6"
git tag -a v0.0.6 -m "release v0.0.6"
git push origin v0.0.6
```## 编译
```
CGO_ENABLED=0 GOOS=linux GOARCH=amd64 go build main.goCGO_ENABLED=0 GOOS=windows GOARCH=amd64 go build -o main.exe main.go
```
## 一、添加依赖```go
go get -u github.com/xxl6097/[email protected]
```## 二、使用示例
```gopackage main
import (
"fmt"
"github.com/xxl6097/go-glog/glog"
"time"
)func hook(data []byte) {
fmt.Println(string(data))
}func init() {
//开启日志保存文件
glog.LogSaveFile()
//拦截日志
//glog.Hook(hook)
}func main() {
for {
fmt.Println("aaa")
glog.Info("只有使用这个log打印才能记录日志哦")
time.Sleep(time.Second)
}
}```