From 47e6430d307c647b7c8232c20bc2edaf72ea2ef7 Mon Sep 17 00:00:00 2001 From: Josh Matthews Date: Thu, 6 Aug 2020 18:28:24 -0400 Subject: [PATCH] Pipe GST_DEBUG output to its own log file on UWP. --- components/servo/lib.rs | 3 +-- support/hololens/ServoApp/ServoControl/Servo.cpp | 4 ++++ 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/components/servo/lib.rs b/components/servo/lib.rs index 2bcc5694074..09e6a3ef078 100644 --- a/components/servo/lib.rs +++ b/components/servo/lib.rs @@ -144,9 +144,8 @@ mod media_platform { #[cfg(feature = "uwp")] fn set_gstreamer_log_handler() { - use gstreamer::{debug_add_log_function, debug_remove_default_log_function, DebugLevel}; + use gstreamer::{debug_add_log_function, DebugLevel}; - debug_remove_default_log_function(); debug_add_log_function(|cat, level, file, function, line, _, message| { let message = format!( "{:?} {:?} {:?}:{:?}:{:?} {:?}", diff --git a/support/hololens/ServoApp/ServoControl/Servo.cpp b/support/hololens/ServoApp/ServoControl/Servo.cpp index 80a445468e5..0cd43f29cb6 100644 --- a/support/hololens/ServoApp/ServoControl/Servo.cpp +++ b/support/hololens/ServoApp/ServoControl/Servo.cpp @@ -281,6 +281,10 @@ Servo::Servo(std::optional initUrl, hstring args, GLsizei width, sServo = this; // FIXME; auto current = ApplicationData::Current(); + auto gstLog = std::wstring(current.LocalFolder().Path()) + L"\\gst.log"; + SetEnvironmentVariable(L"GST_DEBUG_FILE", gstLog.c_str()); + // SetEnvironmentVariableA("GST_DEBUG", "4"); + auto filePath = std::wstring(current.LocalFolder().Path()) + L"\\stdout.txt"; sLogHandle = CreateFile2(filePath.c_str(), GENERIC_WRITE, 0, CREATE_ALWAYS, nullptr);