mirror of
https://github.com/d0zingcat/gocryptotrader.git
synced 2026-05-17 23:16:52 +00:00
logger: allow overriding colour output for fancy consoles on Windows
This commit is contained in:
@@ -59,7 +59,7 @@ func setDefaultOutputs() {
|
||||
// colorOutput() sets the prefix of each log type to matching colour
|
||||
// TODO: add windows support
|
||||
func colourOutput() {
|
||||
if runtime.GOOS != "windows" {
|
||||
if runtime.GOOS != "windows" || Logger.ColourOutputOverride {
|
||||
debugLogger.SetPrefix("\033[34m[DEBUG]\033[0m: ")
|
||||
infoLogger.SetPrefix("\033[32m[INFO]\033[0m: ")
|
||||
warnLogger.SetPrefix("\033[33m[WARN]\033[0m: ")
|
||||
|
||||
@@ -8,11 +8,12 @@ import (
|
||||
|
||||
// Logging struct that holds all user configurable options for the logger
|
||||
type Logging struct {
|
||||
Enabled *bool `json:"enabled,omitempty"`
|
||||
File string `json:"file"`
|
||||
ColourOutput bool `json:"colour"`
|
||||
Level string `json:"level"`
|
||||
Rotate bool `json:"rotate"`
|
||||
Enabled *bool `json:"enabled,omitempty"`
|
||||
File string `json:"file"`
|
||||
ColourOutput bool `json:"colour"`
|
||||
ColourOutputOverride bool `json:"colourOverride,omitempty"`
|
||||
Level string `json:"level"`
|
||||
Rotate bool `json:"rotate"`
|
||||
}
|
||||
|
||||
var (
|
||||
|
||||
Reference in New Issue
Block a user