Compare commits
3 Commits
v0.3.0
...
nmdc-log-s
| Author | SHA1 | Date | |
|---|---|---|---|
| 2f0ab758b8 | |||
| 3b71ea3ce3 | |||
| b0e1c3e5d8 |
@@ -37,7 +37,7 @@ func LogMessage(hub, message string) {
|
|||||||
// Produce a timestamp
|
// Produce a timestamp
|
||||||
timeStamp := instant.Format("2006-01-02 15:04:05")
|
timeStamp := instant.Format("2006-01-02 15:04:05")
|
||||||
|
|
||||||
fh, err := os.OpenFile(logFilePath, os.O_APPEND|os.O_CREATE, 0644)
|
fh, err := os.OpenFile(logFilePath, os.O_APPEND|os.O_CREATE|os.O_WRONLY, 0644)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
fmt.Fprintf(os.Stderr, "Couldn't open file '%s': %s\n", logFilePath, err.Error())
|
fmt.Fprintf(os.Stderr, "Couldn't open file '%s': %s\n", logFilePath, err.Error())
|
||||||
return
|
return
|
||||||
@@ -112,13 +112,17 @@ func main() {
|
|||||||
// Assert dir exists
|
// Assert dir exists
|
||||||
dinfo, err := os.Stat(BaseDir)
|
dinfo, err := os.Stat(BaseDir)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
fmt.Fprintf(os.Stderr, "FATAL: %s", err.Error())
|
fmt.Fprintf(os.Stderr, "FATAL: %s\n", err.Error())
|
||||||
os.Exit(1)
|
os.Exit(1)
|
||||||
}
|
}
|
||||||
if !dinfo.IsDir() {
|
if !dinfo.IsDir() {
|
||||||
fmt.Fprintf(os.Stderr, "FATAL: Path '%s' is not a directory\n", BaseDir)
|
fmt.Fprintf(os.Stderr, "FATAL: Path '%s' is not a directory\n", BaseDir)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if !VerifyTLS {
|
||||||
|
fmt.Fprintf(os.Stderr, "WARNING: TLS certificates will not be verified!\n")
|
||||||
|
}
|
||||||
|
|
||||||
// Launch loggers
|
// Launch loggers
|
||||||
all_hubs := strings.Split(*hubs, ",")
|
all_hubs := strings.Split(*hubs, ",")
|
||||||
launch_ct := 0
|
launch_ct := 0
|
||||||
|
|||||||
Reference in New Issue
Block a user