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

https://github.com/xiegeo/coloredgoroutine

Color-coded debug logging by go routine id.
https://github.com/xiegeo/coloredgoroutine

debugging go-routine golang logging terminal-colors

Last synced: 3 months ago
JSON representation

Color-coded debug logging by go routine id.

Awesome Lists containing this project

README

          

# Colored Goroutines

`import "github.com/xiegeo/coloredgoroutine"`

Just replace
```
var logger = log.New(os.Stdout, "logger: ", log.Lshortfile)
```
with
```
var logger = log.New(coloredgoroutine.Colors(os.Stdout), "logger: ", log.Lshortfile)
```

So you can easily remove it when you are done debugging and no one will know.

Sample output:

![screenshot](example.png)

Color template:

![screenshot](colors.png)

Bigger numbered go routines will repeat the colors.