fix: fix testing failed (reserve init func)
@@ -56,6 +56,17 @@ type Logger interface {
Debugf(fmt string, args ...interface{})
}
+func init() {
+ // TODO: Reserve for testing, using a better way?
+ if logger == nil {
+ logConfFile := "./conf/log.yml"
+ err := InitLog(logConfFile)
+ if err != nil {
+ logger.Infof("[InitLog] warn: %v", err)
+ }
+ }
+}
+
// InitLog load from config path
func InitLog(logConfFile string) error {
if logConfFile == "" {
