diff options
| author | Shawn Hoffman <godisgovernment@gmail.com> | 2022-07-17 19:12:04 -0700 |
|---|---|---|
| committer | Shawn Hoffman <godisgovernment@gmail.com> | 2022-07-18 09:52:54 -0700 |
| commit | 0a15d2fcecaa0a0ae32891245bb31eee0a1f0ccd (patch) | |
| tree | 95c32bc824ab55b19613bcbaa6a9dc04157571d1 /Source/Core/AudioCommon/CubebUtils.cpp | |
| parent | f0eb7b42e2808cfabaa5f165fc022062fb934ca7 (diff) | |
cubeb: fix logged source file paths
Diffstat (limited to 'Source/Core/AudioCommon/CubebUtils.cpp')
| -rw-r--r-- | Source/Core/AudioCommon/CubebUtils.cpp | 10 |
1 files changed, 8 insertions, 2 deletions
diff --git a/Source/Core/AudioCommon/CubebUtils.cpp b/Source/Core/AudioCommon/CubebUtils.cpp index 7b998b1db9..ffe1e8cfbb 100644 --- a/Source/Core/AudioCommon/CubebUtils.cpp +++ b/Source/Core/AudioCommon/CubebUtils.cpp @@ -22,6 +22,10 @@ static void LogCallback(const char* format, ...) if (instance == nullptr) return; + constexpr auto log_type = Common::Log::LogType::AUDIO; + if (!instance->IsEnabled(log_type)) + return; + va_list args; va_start(args, format); const char* filename = va_arg(args, const char*) + s_path_cutoff_point; @@ -30,8 +34,8 @@ static void LogCallback(const char* format, ...) const std::string message = StringFromFormatV(adapted_format.c_str(), args); va_end(args); - instance->Log(Common::Log::LogLevel::LNOTICE, Common::Log::LogType::AUDIO, filename, lineno, - message.c_str()); + instance->LogWithFullPath(Common::Log::LogLevel::LNOTICE, log_type, filename, lineno, + message.c_str()); } static void DestroyContext(cubeb* ctx) @@ -54,6 +58,8 @@ std::shared_ptr<cubeb> CubebUtils::GetContext() const char* filename = __FILE__; const char* match_point = strstr(filename, DIR_SEP "Source" DIR_SEP "Core" DIR_SEP); + if (!match_point) + match_point = strstr(filename, R"(\Source\Core\)"); if (match_point) { s_path_cutoff_point = match_point - filename + strlen(DIR_SEP "Externals" DIR_SEP); |
