https://github.com/yanun0323/pkg
PKG is an useful develop package collection for golang.
https://github.com/yanun0323/pkg
golang logger yaml
Last synced: about 1 year ago
JSON representation
PKG is an useful develop package collection for golang.
- Host: GitHub
- URL: https://github.com/yanun0323/pkg
- Owner: yanun0323
- Created: 2022-10-14T20:35:07.000Z (over 3 years ago)
- Default Branch: master
- Last Pushed: 2025-04-16T18:52:29.000Z (about 1 year ago)
- Last Synced: 2025-04-17T03:43:18.866Z (about 1 year ago)
- Topics: golang, logger, yaml
- Language: Go
- Homepage:
- Size: 147 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# PKG
PKG is an useful develop package collection for golang.
## Requirements
#### _Go 1.21 or higher_
## Feature
- `Config` provides init function to initialize the config yaml.
- `Logger` provides logger to print/output the log.
## Usage
```go
import (
"github.com/yanun0323/pkg/logs"
"github.com/yanun0323/pkg/config"
)
func main() {
l := logs.New(logs.LevelInfo, logs.OutputStd())
err := config.Init("config", true, "../config", "../../config")
if err != nil {
l.WithError(err).Fatal("init config")
}
l.Info("init config succeed")
}
```