How to log debug info to console in metro app eg: through printf or OutputDebugString


  • Hi,

    i have a sample C++ based metro app and i am trying to print some debug information to console through

    printf , OutputDebugString and Platform::Details::Console::WriteLine("\nHello there");

    the problem is i dont see the output in the console for any of the above cases.

    How do i get this working ? 



    Monday, August 13, 2012 2:04 PM


All replies

  • What do you mean by "Console" in this context?

    OutputDebugString's output will be picked up by the debugger and displayed. By default, Visual Studio shows it in the "Output" window.

    Platforms::Details::Console is documented as for internal use only and should not be used.


    Monday, August 13, 2012 9:41 PM
  • By "Console" i meant the "Output" window of the visual studio debugger.


    • Edited by naiveCoder Tuesday, August 14, 2012 6:19 AM
    Tuesday, August 14, 2012 6:19 AM
  • You can use OutputDebugString API:

    OutputDebugString(L"Hello world");


    Best regards,

    Jesse Jiang [MSFT]
    MSDN Community Support | Feedback to us

    • Marked as answer by Jesse Jiang Monday, August 20, 2012 7:38 AM
    Tuesday, August 14, 2012 8:16 AM
  • By default OutputDebugString from a debugged app will go to Visual Studio's "Output" window, but you can set options to push it to the Immediate window instead so check both places.

    This should work for you. If it's not we would need more information about your exact setup and repro steps.


    Tuesday, August 14, 2012 11:43 PM
  • This is not working for me. The method is not resolved. Is there something I'm missing?
    Monday, October 1, 2012 7:23 PM