https://github.com/hyperscale-stack/logger
Logger interface for Golang
https://github.com/hyperscale-stack/logger
Last synced: 6 days ago
JSON representation
Logger interface for Golang
- Host: GitHub
- URL: https://github.com/hyperscale-stack/logger
- Owner: hyperscale-stack
- License: mit
- Created: 2021-08-04T21:43:39.000Z (almost 5 years ago)
- Default Branch: master
- Last Pushed: 2025-11-10T07:03:11.000Z (6 months ago)
- Last Synced: 2025-11-10T09:06:16.914Z (6 months ago)
- Language: Go
- Size: 37.1 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE.md
Awesome Lists containing this project
README
Hyperscale logger [](https://github.com/hyperscale-stack/logger/releases/latest) [](https://godoc.org/github.com/hyperscale-stack/logger)
====================
[](https://goreportcard.com/report/github.com/hyperscale-stack/logger)
| Branch | Status | Coverage |
|---------|--------|----------|
| master | [](https://github.com/hyperscale-stack/logger/actions?query=workflow%3AGo) | [](https://coveralls.io/github/hyperscale-stack/logger?branch=master) |
The Hyperscale logger is an standard interface for abstract logger provider
## Example
```go
package main
import (
"fmt"
"github.com/hyperscale-stack/logger"
)
func main() {
l := NewStandardLogger(&outBuf, &errBuf)
l.Panic("my panic message without option")
l.Fatal("my fatal message without option")
l.Error("my error message without option")
l.Warning("my warning message without option")
l.Info("my info message without option")
l.Debug("my debug message without option")
l.Trace("my trace message without option")
labels := map[string]interface{}{
"foo": "bar",
}
l.Panic("my panic message with option labels", WithLabels(labels))
l.Fatal("my fatal message with option labels", WithLabels(labels))
l.Error("my error message with option labels", WithLabels(labels))
l.Warning("my warning message with option labels", WithLabels(labels))
l.Info("my info message with option labels", WithLabels(labels))
l.Debug("my debug message with option labels", WithLabels(labels))
l.Trace("my trace message with option labels", WithLabels(labels))
l.Panic("my panic message with option format: %s => %d", WithFormat("foo", 1))
l.Fatal("my fatal message with option format: %s => %d", WithFormat("foo", 1))
l.Error("my error message with option format: %s => %d", WithFormat("foo", 1))
l.Warning("my warning message with option format: %s => %d", WithFormat("foo", 1))
l.Info("my info message with option format: %s => %d", WithFormat("foo", 1))
l.Debug("my debug message with option format: %s => %d", WithFormat("foo", 1))
l.Trace("my trace message with option format: %s => %d", WithFormat("foo", 1))
}
```
## License
Hyperscale logger is licensed under [the MIT license](LICENSE.md).