Skip to content

Commit

Permalink
Merge pull request #719 from cvictory/log_opt
Browse files Browse the repository at this point in the history
Rft: avoid initint the log twice
  • Loading branch information
AlexStocks authored Aug 22, 2020
2 parents e361067 + 1166752 commit 6ccbc6c
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions common/logger/logger.go
Original file line number Diff line number Diff line change
Expand Up @@ -60,6 +60,10 @@ type Logger interface {
}

func init() {
// forbidden to executing twice.
if logger != nil {
return
}
logConfFile := os.Getenv(constant.APP_LOG_CONF_FILE)
err := InitLog(logConfFile)
if err != nil {
Expand Down

0 comments on commit 6ccbc6c

Please sign in to comment.