Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/imroc/log
simple and useful logging tool of Go
https://github.com/imroc/log
Last synced: about 1 month ago
JSON representation
simple and useful logging tool of Go
- Host: GitHub
- URL: https://github.com/imroc/log
- Owner: imroc
- License: mit
- Created: 2016-10-04T07:21:45.000Z (about 8 years ago)
- Default Branch: master
- Last Pushed: 2017-03-15T09:18:58.000Z (over 7 years ago)
- Last Synced: 2024-08-03T11:01:45.692Z (3 months ago)
- Language: Go
- Homepage:
- Size: 9.77 KB
- Stars: 24
- Watchers: 4
- Forks: 6
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
log
==============
log is a simple and useful logging tool of Go. see [API](https://godoc.org/github.com/imroc/log).## Features
* light weight
* easy to use## Note
there is only 2 log level(Debug,Info) the philosophy of this can be found in [here](https://dave.cheney.net/2015/11/05/lets-talk-about-logging)## Quick Start
##### Installation
``` sh
go get github.com/imroc/log
```
##### Simple Usage
``` go
import (
"github.com/imroc/log"
)func main() {
log.Debug("debug ", "message")
log.Infof("%s message", "info")
}
```
output:
```
2016/10/04 14:38:38 [DEBG] main.go:7 debug message
2016/10/04 14:38:38 [INFO] main.go:8 info message
```
##### More Control
``` go
log.SetFilename("test.log")
log.SetFlag(log.Ldate | log.Ltime | log.Llongfile)
log.SetDebug(false)
```
## LICENSE
log is is distributed under the terms of the MIT License.