generated from kedaya_haitao/template
21 lines
360 B
Go
21 lines
360 B
Go
package log
|
|
|
|
import (
|
|
"os"
|
|
"path/filepath"
|
|
)
|
|
|
|
var (
|
|
logDir = "/var/log/proxy-detector"
|
|
logFile = filepath.Join(logDir, "run.log")
|
|
)
|
|
|
|
func initFile(path string) *os.File {
|
|
// TODO detect old log files and compress
|
|
f, err := os.OpenFile(path, os.O_WRONLY|os.O_CREATE, 0755)
|
|
if err != nil {
|
|
Errorln("get log file error: %s", err.Error())
|
|
}
|
|
return f
|
|
}
|