Skip to content
Snippets Groups Projects
Verified Commit 1213ae49 authored by Cecylia Bocovich's avatar Cecylia Bocovich
Browse files

Log fatal errors back to tor process

parent 5cb6550b
No related branches found
No related tags found
No related merge requests found
......@@ -4,6 +4,7 @@ package main
import (
"errors"
"flag"
"fmt"
"io"
"io/ioutil"
"log"
......@@ -150,6 +151,7 @@ func main() {
stateDir, err := pt.MakeStateDir()
if err != nil {
pt.Log(pt.LogSeverityError, fmt.Sprintf("Failed to make state dir %s", err.Error()))
log.Fatal(err)
}
......@@ -162,6 +164,7 @@ func main() {
}
f, err := os.OpenFile(*logFilename, os.O_CREATE|os.O_APPEND|os.O_WRONLY, 0600)
if err != nil {
pt.Log(pt.LogSeverityError, fmt.Sprintf("Failed to open log file %s", err.Error()))
log.Fatal(err)
}
defer f.Close()
......@@ -177,6 +180,7 @@ func main() {
*assetDir = stateDir + "/conjure"
err := os.Mkdir(*assetDir, 0755)
if err != nil && !os.IsExist(err) {
pt.Log(pt.LogSeverityError, fmt.Sprintf("Failed to create asset dir %s", err.Error()))
log.Fatal(err)
}
}
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment