Display std::cout in console window

Everything about development and the OpenMW source code.
Post Reply
User avatar
Posts: 2152
Joined: 18 Feb 2012, 11:51

Display std::cout in console window

Post by scrawl » 28 Mar 2012, 01:28

What do you think? IMO it would make debugging easier, as I don't have to switch between OpenMW and the terminal window / IDE all the time to see the output.

edit: with std::cout this wouldn't be possible (correct me if i'm wrong), but we can use a log macro that writes the message to standard output as well as the console.
Last edited by scrawl on 28 Mar 2012, 01:31, edited 1 time in total.

Posts: 780
Joined: 06 Aug 2011, 21:34

Re: Display std::cout in console window

Post by jhooks1 » 28 Mar 2012, 01:29

Good idea, sort of like how aedra works.

Posts: 1584
Joined: 04 Sep 2011, 08:33

Re: Display std::cout in console window

Post by Chris » 28 Mar 2012, 08:01

Proper logging would be nice, with various severity levels. Would Ogre's logging methods work? Could they be hooked so messages can be mirrored on the console and std::cout given their severity?

User avatar
Posts: 4932
Joined: 29 Sep 2011, 10:13
Location: Belgium
Gitlab profile: https://gitlab.com/psi29a/

Re: Display std::cout in console window

Post by psi29a » 28 Mar 2012, 08:06

Might I recommend a framework for logging?
Log4cxx is pretty damn good and we use it here for our product at work. Based around log4j but for c++ so it works wonders. It has various logging levels and is configurable.


User avatar
Posts: 5538
Joined: 06 Aug 2011, 15:16

Re: Display std::cout in console window

Post by Zini » 28 Mar 2012, 09:03

We should probably avoid additional dependencies. OGRE has a logging framework and I think boost has one too. If someone really want to have a go at it, go ahead. Echoing to the ingame console should be made optional though.

Post Reply