Display std::cout in console window

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

Display std::cout in console window

Post by scrawl »

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.
jhooks1
Posts: 780
Joined: 06 Aug 2011, 21:34

Re: Display std::cout in console window

Post by jhooks1 »

Good idea, sort of like how aedra works.
Chris
Posts: 1626
Joined: 04 Sep 2011, 08:33

Re: Display std::cout in console window

Post by Chris »

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
psi29a
Posts: 5361
Joined: 29 Sep 2011, 10:13
Location: Belgium
Gitlab profile: https://gitlab.com/psi29a/
Contact:

Re: Display std::cout in console window

Post by psi29a »

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.

http://logging.apache.org/log4cxx/
User avatar
Zini
Posts: 5538
Joined: 06 Aug 2011, 15:16

Re: Display std::cout in console window

Post by Zini »

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