func initLogging() error { var loggingCfg []log.Config if err := json.Unmarshal([]byte(loggingJSONCfg), &loggingCfg); err != nil { return fmt.Errorf("failed to parse logger config: err=(%s)", err) } if err := log.InitWithConfig(loggingCfg...); err != nil { return err } logging.Init3rdParty() return nil }
// InitLogging initializes both internal and 3rd party loggers to output logs // using the test context object's `Log` function. func InitLogging(c *C) { initTestOnce.Do(func() { log.Init(&logger{c}) logging.Init3rdParty() }) }