()
| 135 | } |
| 136 | |
| 137 | func bgServerInit() { |
| 138 | if tmpPath == "" { |
| 139 | tmpPath = os.TempDir() |
| 140 | } |
| 141 | logPath := filepath.Join(tmpPath, "covenant_service.log") |
| 142 | bgLog, err := os.OpenFile(logPath, os.O_CREATE|os.O_WRONLY|os.O_TRUNC, 0644) |
| 143 | if err != nil { |
| 144 | ConsoleLog.Errorf("open log file failed: %s, %v", logPath, err) |
| 145 | SetExitStatus(1) |
| 146 | Exit() |
| 147 | } |
| 148 | |
| 149 | log.SetOutput(bgLog) |
| 150 | log.SetStringLevel(bgLogLevel, log.InfoLevel) |
| 151 | } |
| 152 | |
| 153 | // readMasterKey reads the password of private key from terminal |
| 154 | func readMasterKey(skip bool) string { |
no test coverage detected