Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Windows color #25

Open
ghost opened this issue Jun 15, 2019 · 1 comment
Open

Windows color #25

ghost opened this issue Jun 15, 2019 · 1 comment

Comments

@ghost
Copy link

ghost commented Jun 15, 2019

Using this file:

package main
import (
   "github.com/fatih/color"
   "github.com/francoispqt/onelog"
   "os"
)
func main() {
   onelog.LevelText(onelog.INFO, color.CyanString("INFO"))
   aa := onelog.New(os.Stdout, onelog.ALL)
   aa.Info("bbbbb")
}

I get this result:

{"level":" [36mINFO [0m","message":"bbbbb"}
@ghost
Copy link
Author

ghost commented Jun 23, 2019

Workaround:

package main
import (
   "github.com/fatih/color"
   "github.com/francoispqt/onelog"
   "github.com/mattn/go-colorable"
)
func main() {
   onelog.LevelText(onelog.INFO, color.CyanString("INFO"))
   aa := onelog.New(colorable.NewColorableStdout(), onelog.ALL)
   aa.Info("bb")
}

Or:

package main
import "github.com/labstack/gommon/log"
func main() {
   log.EnableColor()
   log.Info("bb")
}

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

0 participants