An open API service indexing awesome lists of open source software.

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.

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")
}
```