aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/main.go
diff options
context:
space:
mode:
authorJason A. Donenfeld <Jason@zx2c4.com>2019-05-08 10:11:00 +0200
committerJason A. Donenfeld <Jason@zx2c4.com>2019-05-08 10:11:00 +0200
commit1f29896e9edbd0fe7105e98006f4b4ca2436cf3b (patch)
tree9bc45c4d27a03490aafea42751fbedc7cad75a63 /main.go
parentbuild: update documentation (diff)
downloadwireguard-windows-1f29896e9edbd0fe7105e98006f4b4ca2436cf3b.tar.xz
wireguard-windows-1f29896e9edbd0fe7105e98006f4b4ca2436cf3b.zip
ringlogger: add a basic CLI log dumping command
Signed-off-by: Jason A. Donenfeld <Jason@zx2c4.com>
Diffstat (limited to 'main.go')
-rw-r--r--main.go15
1 files changed, 15 insertions, 0 deletions
diff --git a/main.go b/main.go
index f7c10f32..1e06d626 100644
--- a/main.go
+++ b/main.go
@@ -28,6 +28,7 @@ var flags = [...]string{
"/managerservice",
"/tunnelservice CONFIG_PATH",
"/ui CMD_READ_HANDLE CMD_WRITE_HANDLE CMD_EVENT_HANDLE LOG_MAPPING_HANDLE",
+ "/dumplog OUTPUT_PATH",
}
//sys messageBoxEx(hwnd windows.Handle, text *uint16, title *uint16, typ uint, languageId uint16) = user32.MessageBoxExW
@@ -205,6 +206,20 @@ func main() {
service.InitializeIPCClient(readPipe, writePipe, eventPipe)
ui.RunUI()
return
+ case "/dumplog":
+ if len(os.Args) != 3 {
+ usage()
+ }
+ file, err := os.Create(os.Args[2])
+ if err != nil {
+ fatal(err)
+ }
+ defer file.Close()
+ err = ringlogger.DumpTo(file, true)
+ if err != nil {
+ fatal(err)
+ }
+ return
}
usage()
}