summaryrefslogtreecommitdiff
path: root/Source/Core/AudioCommon
diff options
context:
space:
mode:
authorLéo Lam <leo@leolam.fr>2020-10-21 19:11:19 +0200
committerGitHub <noreply@github.com>2020-10-21 19:11:19 +0200
commit09e87b79f19ce0fb06b236e15ebed414af57558a (patch)
tree199f03308f3d349aa0f20bda3d880e75a76b8150 /Source/Core/AudioCommon
parentf265c412b449f7054468fae6e13a890bb0d3c098 (diff)
parent425f2aa013a9051a15b58a722668358a2dae5c70 (diff)
Merge pull request #9173 from lioncash/fmtlog
Common/Log: Add basic fmt-capable functions to the interface.
Diffstat (limited to 'Source/Core/AudioCommon')
-rw-r--r--Source/Core/AudioCommon/CubebUtils.cpp14
1 files changed, 7 insertions, 7 deletions
diff --git a/Source/Core/AudioCommon/CubebUtils.cpp b/Source/Core/AudioCommon/CubebUtils.cpp
index b4af87115b..2088956e4b 100644
--- a/Source/Core/AudioCommon/CubebUtils.cpp
+++ b/Source/Core/AudioCommon/CubebUtils.cpp
@@ -18,19 +18,19 @@ static ptrdiff_t s_path_cutoff_point = 0;
static void LogCallback(const char* format, ...)
{
- if (!Common::Log::LogManager::GetInstance())
+ auto* instance = Common::Log::LogManager::GetInstance();
+ if (instance == nullptr)
return;
va_list args;
va_start(args, format);
-
const char* filename = va_arg(args, const char*) + s_path_cutoff_point;
- int lineno = va_arg(args, int);
- std::string adapted_format(StripSpaces(format + strlen("%s:%d:")));
-
- Common::Log::LogManager::GetInstance()->LogWithFullPath(
- Common::Log::LNOTICE, Common::Log::AUDIO, filename, lineno, adapted_format.c_str(), args);
+ const int lineno = va_arg(args, int);
+ const std::string adapted_format(StripSpaces(format + strlen("%s:%d:")));
+ const std::string message = StringFromFormatV(adapted_format.c_str(), args);
va_end(args);
+
+ instance->Log(Common::Log::LNOTICE, Common::Log::AUDIO, filename, lineno, message.c_str());
}
static void DestroyContext(cubeb* ctx)