Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP

Loading…

[win32] Fix incorrect debug output on non-ASCII system #1298

Merged
merged 1 commit into from

2 participants

@Karlson2k
Collaborator

No description provided.

@jmarshallnz jmarshallnz merged commit f128571 into xbmc:master
@Karlson2k Karlson2k deleted the Karlson2k:Log_ascii_fix branch
@tru tru referenced this pull request from a commit in plexinc/plex-home-theater-public
@tru tru Add some debug to the GlobalTimer.
This adds a log line that outputs how much time we spend in the queue.
Useful to debug #1298
c9570fc
@tru tru referenced this pull request from a commit in plexinc/plex-home-theater-public
@tru tru Possible fix for timezone related problems.
This might fix the problems with the waiting. But it needs to be tested
on a system with a monotonic clock (Linux).

Related to #1298
b72faac
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Commits on Aug 17, 2012
  1. @Karlson2k
This page is out of date. Refresh to see the latest.
Showing with 12 additions and 1 deletion.
  1. +12 −1 xbmc/utils/log.cpp
View
13 xbmc/utils/log.cpp
@@ -213,7 +213,18 @@ int CLog::GetLogLevel()
void CLog::OutputDebugString(const std::string& line)
{
#if defined(_DEBUG) || defined(PROFILE)
- ::OutputDebugString(line.c_str());
+#if defined(TARGET_WINDOWS)
+ // we can't use charsetconverter here as it's initialized later than CLog and deinitialized early
+ int bufSize = MultiByteToWideChar(CP_UTF8, 0, line.c_str(), -1, NULL, 0);
+ CStdStringW wstr (L"", bufSize);
+ if ( MultiByteToWideChar(CP_UTF8, 0, line.c_str(), -1, wstr.GetBuf(bufSize), bufSize) == bufSize )
+ {
+ wstr.RelBuf();
+ ::OutputDebugStringW(wstr.c_str());
+ }
+ else
+#endif // TARGET_WINDOWS
+ ::OutputDebugString(line.c_str());
::OutputDebugString("\n");
#endif
}
Something went wrong with that request. Please try again.