https://github.com/couchbase/logg
A lightweight logging utility for Go.
https://github.com/couchbase/logg
Last synced: 9 months ago
JSON representation
A lightweight logging utility for Go.
- Host: GitHub
- URL: https://github.com/couchbase/logg
- Owner: couchbase
- Created: 2013-09-14T19:26:00.000Z (almost 13 years ago)
- Default Branch: master
- Last Pushed: 2013-09-14T19:57:36.000Z (almost 13 years ago)
- Last Synced: 2023-04-12T20:28:10.579Z (about 3 years ago)
- Language: Go
- Size: 121 KB
- Stars: 1
- Watchers: 31
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
A lightweight logging utility for Go.

# Features
* Terminal color coded logs
* Simple log levels (LOG_LEVEL_NORMAL, LOG_LEVEL_WARNINGS, LOG_LEVEL_PANICS)
* Keyword based log partitioning. Eg, define a "REST" keyword for all REST related logs, with easy ability to hide/show these logs.
* Log Timestamp which includes microseconds
# Quick Start
Import:
```
import "github.com/couchbase/logg"
```
Log something:
```
logg.Log("hello")
```
Setup keyword based log partitioning:
```
logg.LogKeys["foo"] = true
```
Log something to the "foo" channel:
```
logg.LogTo("foo", "hello foo")
```
Increase log level to only include panics:
```
logg.LogLevel = logg.LOG_LEVEL_PANICS
```
# API docs
The [API Docs](http://godoc.org/github.com/couchbase/logg) are available on godoc.org.