File tree Expand file tree Collapse file tree 1 file changed +12
-0
lines changed
frontend/src/host_orchestrator Expand file tree Collapse file tree 1 file changed +12
-0
lines changed Original file line number Diff line number Diff line change @@ -18,6 +18,7 @@ package main
1818import (
1919 "flag"
2020 "fmt"
21+ "io"
2122 "log"
2223 "net/http"
2324 "net/http/httputil"
@@ -110,9 +111,20 @@ func main() {
110111 abURL := flag .String ("android_build_url" , defaultAndroidBuildURL , "URL to an Android Build API." )
111112 imRootDir := flag .String ("cvd_artifacts_dir" , defaultCVDArtifactsDir (), "Directory where cvd will download android build artifacts to." )
112113 address := flag .String ("listen_addr" , DefaultListenAddress , "IP address to listen for requests." )
114+ logFile := flag .String ("log_file" , "" , "Path to file to write logs to." )
113115
114116 flag .Parse ()
115117
118+ if * logFile != "" {
119+ f , err := os .OpenFile (* logFile , os .O_RDWR | os .O_CREATE | os .O_APPEND , 0666 )
120+ if err != nil {
121+ log .Fatalf ("error opening log file %q: %v" , * logFile , err )
122+ }
123+ defer f .Close ()
124+ w := io .MultiWriter (os .Stderr , f )
125+ log .SetOutput (w )
126+ }
127+
116128 if err := os .MkdirAll (* imRootDir , 0774 ); err != nil {
117129 log .Fatalf ("Unable to create artifacts directory: %v" , err )
118130 }
You can’t perform that action at this time.
0 commit comments