axmolengine / axmol

Axmol Engine – A Multi-platform Engine for Desktop, XBOX (UWP) and Mobile games. (A fork of Cocos2d-x-4.0)
https://axmol.dev
MIT License
868 stars 195 forks source link

[Windows] No log messages are being displayed in Visual Studio output window #1737

Closed rh101 closed 6 months ago

rh101 commented 6 months ago
  1. Create a new project
  2. Run project within Visual Studio

No log calls can be seen in the "Output" window

rh101 commented 6 months ago

In commit https://github.com/axmolengine/axmol/commit/931ca91c71d506be436103f95c68e2cb1707a0ed, the call to OutputDebugSstringW was removed in the Win32 section of Console.cpp.

If it is to be re-added, it should be surrounded by pre-processor check for debug build only, since this should not be called in release builds:

#if defined(_WIN32) && (defined(_DEBUG) || !defined(_NDEBUG))
    // print to debugger output window
    std::wstring wbuf = ntcvt::from_chars(message);
    OutputDebugStringW(wbuf.c_str());
#endif
halx99 commented 6 months ago

will re-add later, better is use winapi IsDebuggerPresent to check