Find the Best Demos and Examples

Check out this quick tour to find the best demos and examples for you, and to see how the Felgo SDK can help you to develop your next app or game!

Forums

OverviewFelgo 2 Support (Qt 5) › Weird behaviour of qInstallMessageHandler()

Viewing 2 posts - 1 through 2 (of 2 total)
  • Author
    Posts
  • #8557

    spike

    Merry Christmas everyone,

    I want to redirect all log output of my application (which is console.log()) to my UDP logger. Therefore I created a function by using this as a reference.

    In my test application (without VPlay, plain Qt 5.3) it works just as expected. But if I call qInstallMessageHandler(myFunc) in my game I either:

    – get no log at all (just the default console log)

    – only the first two logs are outputted, the rest again in console

    – the first logs are to console and the following works as expected (I can live with it but…)

     

    Here’s the main.cpp of my game, you can see multiple calls of qInstallMessageHandler(). I inserted multiple calls to get the result of scenario 3. Less calls either result in scenario 1, 2 or something else. There must be something completely wrong. It’s either a Qt but, a VPlay bug or I’m loosing my mind, because I have nothing better to do on Christmas. I hope someone can take a look at it.

    Cheers!

     

    #8558

    Christian
    Felgo Team

    Hi Joshua,

    it’s not  bug you are experiencing, but in the vplay.initialize() call the messageHandler is overwritten. So to set your own message handler, set it after the vplay.initialize() call.

    Cheers & Merry Christmas 🙂
    Chris

Viewing 2 posts - 1 through 2 (of 2 total)

RSS feed for this thread

You must be logged in to reply to this topic.