mirror of
https://github.com/d0zingcat/gocryptotrader.git
synced 2026-05-21 23:16:49 +00:00
log: fix bug, expand test coverage and slightly optimize (#847)
* log: fix bugs expand coverage and optimise * log: fix linter issues * log: fix linter issue and pack methods in same file * log: drop defer * logger: move global check inside getfields and remove unused test function * logger: Increase note thanks @gloriouscode * logger: wrap error with writer type * logger: change variable name * logger: change variable names and remove validsublogger func as it doesn't add functionality over a standard map call * logs: error when unsupported output is applied on setup calls * logs: add glorious suggestion * logger: add protection to reduce olympic gold medal races * logger: fix linter issues * log: glorious niterinos
This commit is contained in:
@@ -101,11 +101,14 @@ func main() {
|
||||
flag.BoolVar(&create, "create", false, "specifies whether to automatically create trello list, card and checklist in a given board")
|
||||
flag.Parse()
|
||||
var err error
|
||||
c := log.GenDefaultSettings()
|
||||
log.RWM.Lock()
|
||||
log.GlobalLogConfig = &c
|
||||
log.GlobalLogConfig = log.GenDefaultSettings()
|
||||
log.RWM.Unlock()
|
||||
log.SetupGlobalLogger()
|
||||
err = log.SetupGlobalLogger()
|
||||
if err != nil {
|
||||
fmt.Printf("Could not setup global logger. Error: %v.\n", err)
|
||||
os.Exit(1)
|
||||
}
|
||||
configData, err = readFileData(jsonFile)
|
||||
if err != nil {
|
||||
log.Error(log.Global, err)
|
||||
|
||||
@@ -29,7 +29,7 @@ func TestMain(m *testing.M) {
|
||||
c := log.GenDefaultSettings()
|
||||
c.Enabled = convert.BoolPtr(true)
|
||||
log.RWM.Lock()
|
||||
log.GlobalLogConfig = &c
|
||||
log.GlobalLogConfig = c
|
||||
log.RWM.Unlock()
|
||||
log.Infoln(log.Global, "set verbose to true for more detailed output")
|
||||
var err error
|
||||
|
||||
Reference in New Issue
Block a user