https://github.com/tidwall/redlog
Redis style logger for Go
https://github.com/tidwall/redlog
Last synced: 9 months ago
JSON representation
Redis style logger for Go
- Host: GitHub
- URL: https://github.com/tidwall/redlog
- Owner: tidwall
- License: mit
- Created: 2016-08-29T16:53:34.000Z (over 9 years ago)
- Default Branch: master
- Last Pushed: 2021-01-28T14:44:25.000Z (almost 5 years ago)
- Last Synced: 2025-04-05T03:12:26.249Z (9 months ago)
- Language: Go
- Size: 30.3 KB
- Stars: 28
- Watchers: 3
- Forks: 2
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
redlog
======
[](https://godoc.org/github.com/tidwall/redlog)
Redlog is a [Redis style logger](http://build47.com/redis-log-format-levels/) for Go.
Installing
----------
```
go get -u github.com/tidwall/redlog
```
Example
-------
```go
log := redlog.New(os.Stderr)
log.Printf("Server started at 10.0.1.5:6379")
log.Debugf("Connected to leader")
log.Warningf("Heartbeat timeout reached, starting election")
```
Output:
```
93324:M 29 Aug 09:30:59.943 * Server started at 10.0.1.5:6379
93324:M 29 Aug 09:31:01.892 . Connected to leader
93324:M 29 Aug 09:31:02.331 # Heartbeat timeout reached, starting election
```
Contact
-------
Josh Baker [@tidwall](http://twitter.com/tidwall)
License
-------
Redcon source code is available under the MIT [License](/LICENSE).