Color-coded debug logging by go routine id.
Switch branches/tags
Nothing to show
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Failed to load latest commit information.
goid
.gitignore
LICENSE
README.md
color.go
color_test.go
colors.png
example.png
go.mod
go.sum

README.md

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

Color template:

screenshot

Bigger numbered go routines will repeat the colors.