From 39fd623a309dd09eeac8d2a03e07a5d6c05d1375 Mon Sep 17 00:00:00 2001 From: Tim Hughes Date: Fri, 21 Mar 2014 11:16:47 +0000 Subject: [PATCH] Also log to OutputDebugString on Windows. --- libethereum/Log.cpp | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/libethereum/Log.cpp b/libethereum/Log.cpp index 0ead148f0..ba88a65ba 100644 --- a/libethereum/Log.cpp +++ b/libethereum/Log.cpp @@ -32,9 +32,22 @@ map eth::g_logOverride; ThreadLocalLogName eth::t_logThreadName("main"); +// foward declare without all of Windows.h +#ifdef _WIN32 +extern "C" __declspec(dllimport) void __stdcall OutputDebugStringA(const char* lpOutputString); +#endif + void eth::simpleDebugOut(std::string const& _s, char const*) { cout << _s << endl << flush; + + // helpful to use OutputDebugString on windows + #ifdef _WIN32 + { + OutputDebugStringA(_s.data()); + OutputDebugStringA("\n"); + } + #endif } std::function eth::g_logPost = simpleDebugOut;