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.
- Host: GitHub
- URL: https://github.com/xiegeo/coloredgoroutine
- Owner: xiegeo
- License: mit
- Created: 2018-09-02T00:12:13.000Z (almost 8 years ago)
- Default Branch: master
- Last Pushed: 2018-09-03T02:40:31.000Z (almost 8 years ago)
- Last Synced: 2024-06-20T00:29:43.233Z (about 2 years ago)
- Topics: debugging, go-routine, golang, logging, terminal-colors
- Language: Go
- Homepage:
- Size: 87.9 KB
- Stars: 16
- Watchers: 4
- Forks: 1
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
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:

Color template:

Bigger numbered go routines will repeat the colors.