https://github.com/xuender/klog
golang slog utils
https://github.com/xuender/klog
Last synced: 2 months ago
JSON representation
golang slog utils
- Host: GitHub
- URL: https://github.com/xuender/klog
- Owner: xuender
- License: mit
- Created: 2023-08-18T05:35:32.000Z (almost 2 years ago)
- Default Branch: main
- Last Pushed: 2023-08-29T05:26:03.000Z (almost 2 years ago)
- Last Synced: 2025-02-09T19:40:57.254Z (4 months ago)
- Language: Go
- Size: 10.7 KB
- Stars: 0
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- Changelog: History.md
- License: LICENSE
Awesome Lists containing this project
README
# klog
[![Action][action-svg]][action-url]
[![Report Card][goreport-svg]][goreport-url]
[![godoc][godoc-svg]][godoc-url]
[![License][license-svg]][license-url]## Use
```golang
package mainimport (
"log/slog"
"os""github.com/xuender/klog"
)func main() {
klog.SetLogFile(os.TempDir(), "test.log")
klog.SetLevel(slog.LevelDebug)slog.Debug("debug")
slog.Info("info")
}
```## License
© ender, 2023~time.Now
[MIT LICENSE](https://github.com/xuender/klog/blob/master/LICENSE)
[action-url]: https://github.com/xuender/klog/actions
[action-svg]: https://github.com/xuender/klog/workflows/Go/badge.svg[goreport-url]: https://goreportcard.com/report/github.com/xuender/klog
[goreport-svg]: https://goreportcard.com/badge/github.com/xuender/klog[godoc-url]: https://godoc.org/github.com/xuender/klog
[godoc-svg]: https://godoc.org/github.com/xuender/klog?status.svg[license-url]: https://github.com/xuender/klog/blob/master/LICENSE
[license-svg]: https://img.shields.io/badge/license-MIT-blue.svg