You've already forked libopenshot
mirror of
https://github.com/OpenShot/libopenshot.git
synced 2026-03-02 08:53:52 -08:00
Settings: Support LIBOPENSHOT_DEBUG envvar
- Setting LIBOPENSHOT_DEBUG to any value in the process environment activates debug logging to stderr.
This commit is contained in:
@@ -28,14 +28,14 @@
|
||||
* along with OpenShot Library. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
#include <cstdlib> // For std::getenv
|
||||
|
||||
#include "Settings.h"
|
||||
|
||||
using namespace std;
|
||||
using namespace openshot;
|
||||
|
||||
|
||||
// Global reference to Settings
|
||||
Settings *Settings::m_pInstance = NULL;
|
||||
Settings *Settings::m_pInstance = nullptr;
|
||||
|
||||
// Create or Get an instance of the settings singleton
|
||||
Settings *Settings::Instance()
|
||||
@@ -53,6 +53,9 @@ Settings *Settings::Instance()
|
||||
m_pInstance->HW_EN_DEVICE_SET = 0;
|
||||
m_pInstance->PLAYBACK_AUDIO_DEVICE_NAME = "";
|
||||
m_pInstance->DEBUG_TO_STDERR = false;
|
||||
auto env_debug = std::getenv("LIBOPENSHOT_DEBUG");
|
||||
if (env_debug != nullptr)
|
||||
m_pInstance->DEBUG_TO_STDERR = true;
|
||||
}
|
||||
|
||||
return m_pInstance;
|
||||
|
||||
Reference in New Issue
Block a user