From 720a28aeb9881d69e035dcaa03b5680293574ecd Mon Sep 17 00:00:00 2001 From: jp9000 Date: Fri, 6 Oct 2017 04:48:24 -0700 Subject: [PATCH] UI: Log generic stream startup failures These code paths had no logging on failure, resulting in a log file that would confuse people attempting to perform support for users. --- UI/window-basic-main-outputs.cpp | 24 ++++++++++++++++++++++-- 1 file changed, 22 insertions(+), 2 deletions(-) diff --git a/UI/window-basic-main-outputs.cpp b/UI/window-basic-main-outputs.cpp index bc28469ad..16039a39a 100644 --- a/UI/window-basic-main-outputs.cpp +++ b/UI/window-basic-main-outputs.cpp @@ -664,8 +664,11 @@ bool SimpleOutput::StartStreaming(obs_service_t *service) streamOutput = obs_output_create(type, "simple_stream", nullptr, nullptr); - if (!streamOutput) + if (!streamOutput) { + blog(LOG_WARNING, "Creation of stream output type '%s' " + "failed!", type); return false; + } obs_output_release(streamOutput); streamDelayStarting.Connect( @@ -756,6 +759,13 @@ bool SimpleOutput::StartStreaming(obs_service_t *service) return true; } + const char *error = obs_output_get_last_error(streamOutput); + bool has_last_error = error && *error; + + blog(LOG_WARNING, "Stream output type '%s' failed to start!%s%s", + type, + has_last_error ? " Last Error: " : "", + has_last_error ? error : ""); return false; } @@ -1417,8 +1427,11 @@ bool AdvancedOutput::StartStreaming(obs_service_t *service) streamOutput = obs_output_create(type, "adv_stream", nullptr, nullptr); - if (!streamOutput) + if (!streamOutput) { + blog(LOG_WARNING, "Creation of stream output type '%s' " + "failed!", type); return false; + } obs_output_release(streamOutput); streamDelayStarting.Connect( @@ -1509,6 +1522,13 @@ bool AdvancedOutput::StartStreaming(obs_service_t *service) return true; } + const char *error = obs_output_get_last_error(streamOutput); + bool has_last_error = error && *error; + + blog(LOG_WARNING, "Stream output type '%s' failed to start!%s%s", + type, + has_last_error ? " Last Error: " : "", + has_last_error ? error : ""); return false; }