Closed aboukirev closed 8 years ago
@aboukirev I have fixed the crashing issue. I would need you help to find what's the type of your io.Writer
. os.Stdout
is *os.File
.
@vishr Apparently go-colorable, when built in Windows, returns colorable.Writer
(extends io.Writer
. For other systems it returns os.Stdout
(which also implements io.Writer
). mintty
is part of msys2 toolchain that I am running and behaves as *nix/Posix, hence no issue there.
Verified your latest fix is working perfectly well. Thank you.
@aboukirev Did another commit, can you check if windows is getting colors?
@vishr Yes, the coloring works in both ConEmu and mintty. This is most excellent.
Cool.
Logging crashes with "runtime error: index out of range" in the log() function on line 173
in Windows in ConEmu console window. Works fine but no colors in mintty. My guess is ConEmu console is not recognized as
*os.File
and variablelevels
is not initialized. In my caselog()
is called fromInfo()
so the level is INFO or 2, which I can see in the stack trace of panic output.Perhaps, levels should always be initialized to some sensible values in
SetOutput()
.