[tor-commits] [meek/extension] Log meek-client-torbrowser output to a file.

dcf at torproject.org dcf at torproject.org
Tue Apr 8 08:30:16 UTC 2014


commit d9734e12cc51788bfa8310b519dd06c4cee9dd42
Author: David Fifield <david at bamsoftware.com>
Date:   Mon Apr 7 23:34:14 2014 -0700

    Log meek-client-torbrowser output to a file.
---
 meek-client-torbrowser/main.go |    7 +++++++
 1 file changed, 7 insertions(+)

diff --git a/meek-client-torbrowser/main.go b/meek-client-torbrowser/main.go
index c4989c3..18f165b 100644
--- a/meek-client-torbrowser/main.go
+++ b/meek-client-torbrowser/main.go
@@ -109,6 +109,13 @@ func runMeekClient(helperAddr string) (cmd *exec.Cmd, err error) {
 func main() {
 	var err error
 
+	f, err := os.OpenFile("meek-client-torbrowser.log", os.O_CREATE|os.O_APPEND|os.O_WRONLY, 0600)
+	if err != nil {
+		log.Fatal(err)
+	}
+	defer f.Close()
+	log.SetOutput(f)
+
 	sigChan := make(chan os.Signal, 1)
 	signal.Notify(sigChan, syscall.SIGINT, syscall.SIGTERM)
 





More information about the tor-commits mailing list