https://github.com/ddo/go-dlog
:pager: conditional logging for Golang libraries & applications
https://github.com/ddo/go-dlog
debug golang log logger
Last synced: 5 months ago
JSON representation
:pager: conditional logging for Golang libraries & applications
- Host: GitHub
- URL: https://github.com/ddo/go-dlog
- Owner: ddo
- License: mit
- Created: 2015-04-14T06:27:41.000Z (about 11 years ago)
- Default Branch: master
- Last Pushed: 2019-09-27T11:48:16.000Z (over 6 years ago)
- Last Synced: 2025-01-08T15:22:46.313Z (over 1 year ago)
- Topics: debug, golang, log, logger
- Language: Go
- Homepage:
- Size: 20.5 KB
- Stars: 1
- Watchers: 2
- Forks: 0
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# go-dlog [![Doc][godoc-img]][godoc-url]
:pager: conditional logging for Golang libraries & applications
![screenshot][screenshot]
[godoc-img]: https://img.shields.io/badge/godoc-Reference-brightgreen.svg?style=flat-square
[godoc-url]: https://godoc.org/gopkg.in/ddo/go-dlog.v2
[screenshot]: http://i.imgur.com/cZOEREE.png
## installation
```sh
go get gopkg.in/ddo/go-dlog.v2
```
## usage
```go
logger := dlog.New("logger", nil)
logger.Debug("some log")
logger.Info("some log")
logger.Warn("some log")
logger.Error("some log")
```
```sh
DLOG=* go run example.go
```
## env
set ``DLOG`` environment(case-insensitive) to
* ``DEBUG`` or ``*`` to enable ``#Debug`` and above
* ``INFO`` to enable ``#Info``, ``#Done``, ``#Fail`` and above
* ``WARN`` to enable ``#Warn`` and above
* ``ERROR`` to enable ``#Error``