Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix debug log statement in Windows NotificationClient #15892

merged 1 commit into from Apr 10, 2019


None yet
2 participants
Copy link

commented Apr 10, 2019

Debug log had lines where the format statement was not being parsed e.g.

DEBUG: %s: Changed device property of %s is {%8.8x-%4.4x-%4.4x-%2.2x%2.2x-%2.2x%2.2x%2.2x%2.2x%2.2x%2.2x}#%d

The issue was the {{ and }} in the format statements - obviously an unsuccessful attempt to escape { and } since the change to use fmt #13452

The extra bracket is removed by fmt but makes the test in Format() below fail and so the statement is not passed to sprintf

static std::wstring Format(const std::wstring& fmt, Args&&... args)
// coverity[fun_call_w_exception : FALSE]
auto result = ::fmt::format(fmt, std::forward<Args>(args)...);
if (result == fmt)
result = ::fmt::sprintf(fmt, std::forward<Args>(args)...);
return result;

Fix is to replace with simple brackets, then at least the log contains actual data.

Copy link

left a comment

lgtm. thanks.

@DaveTBlake DaveTBlake merged commit ee0d128 into xbmc:master Apr 10, 2019

1 check passed

default You're awesome. Have a cookie

@DaveTBlake DaveTBlake deleted the DaveTBlake:Logfixbrackets branch Apr 10, 2019

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.