[tor-commits] [snowflake/master] Log to TOR_PT_STATE_LOCATION

arlo at torproject.org arlo at torproject.org
Mon Aug 22 01:32:45 UTC 2016


commit 6cecd31fd896eb26e64ad8bab8a9ea510ec3b21d
Author: Arlo Breault <arlolra at gmail.com>
Date:   Sun Aug 21 18:32:02 2016 -0700

    Log to TOR_PT_STATE_LOCATION
---
 client/snowflake.go | 7 ++++++-
 1 file changed, 6 insertions(+), 1 deletion(-)

diff --git a/client/snowflake.go b/client/snowflake.go
index 75e999f..b1c3975 100644
--- a/client/snowflake.go
+++ b/client/snowflake.go
@@ -9,6 +9,7 @@ import (
 	"net"
 	"os"
 	"os/signal"
+	"path"
 	"sync"
 	"syscall"
 	"time"
@@ -121,7 +122,11 @@ func copyLoop(a, b io.ReadWriter) {
 
 func main() {
 	webrtc.SetLoggingVerbosity(1)
-	logFile, err := os.OpenFile("snowflake.log",
+	stateDir, err := pt.MakeStateDir()
+	if err != nil {
+		log.Fatal(err)
+	}
+	logFile, err := os.OpenFile(path.Join(stateDir, "snowflake.log"),
 		os.O_CREATE|os.O_APPEND|os.O_WRONLY, 0600)
 	if err != nil {
 		log.Fatal(err)



More information about the tor-commits mailing list