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

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

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``