Categorygithub.com/xiegeo/coloredgoroutine
modulepackage
0.1.1
Repository: https://github.com/xiegeo/coloredgoroutine.git
Documentation: pkg.go.dev

# 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)

Sample output:

screenshot

Color template:

screenshot Bigger numbered go routines will repeat the colors.

# Packages

Package goid exports a private function sourced from github.com/tylerb/gls.

# Functions

Colors add color to the writer based on the current go routine id.