rpgoldman / europa-pso

Automatically exported from code.google.com/p/europa-pso
0 stars 0 forks source link

Add ability to control debug output #147

Open GoogleCodeExporter opened 8 years ago

GoogleCodeExporter commented 8 years ago
From an email discussion:

On 6/17/11 4:31 PM, Tristan Smith wrote:
> > Hi Javier and Tatiana (and others!),
> >
> > Two issues make it a bit harder to use EUROPA's debug functionality from
> > within the Eclipse IDE:
> >
> > 1.  Debug.cfg from the model directory isn't being used.  When I run the
> > IDE, the working directory is my home directory, so I need to put
> > Debug.cfg there for it to have effect.  This is hard to figure out for
> > three reasons:
> > a)  When it doesn't find Debug.cfg, EUROPA chugs along happily, so you
> > don't know that it couldn't load it.
> > b)  It's not obvious what Eclipse is using as the working directory.
> > c)  See issue 2....
> >
> > 2.  When you make changes to Debug.cfg, you want them to take effect
> > when you rerun the solver.  For whatever reason, however, they don't
> > take effect until you've restarted the IDE.
> >
> > I don't know a good way to fix either of the above.  For 1, Debug.cfg is
> > expected to be in the working directory.  Here's the DebugMsg.cc code:
> >    DebugConfig() {
> >      std::ifstream config("Debug.cfg");
> >      if (config.good()) {
> >        DebugMessage::setStream(std::cout);
> >        DebugMessage::readConfigFile(config);
> >      }
> >    }
> >
> > Options I can think of to fix issue 1:
> > i) Change Eclipse's working directory to be the model directory
> > currently being used.  I've looked around a bit, but have no idea
> > whether this is even possible, or how to do it.
> > ii) Supplement the DebugMsg functionality with a static setDirectory
> > method and expose that functionality through swig (or something like this).
> > iii) In the IDE, copy Debug.cfg to the working directory right before
> > running (this seems ugly!).
> >
> > For issue 2, the fix probably depends on the solution to 1.
> >
> > Does anyone have suggestions for how to proceed?
I think the real solution is to expose DebugMessage::readConfigFile 
(probably as well as enableMatchingMessages, disableMatchingMessages, 
enableAll, and disableAll).  Once those are available, you have complete 
control over the debug output.

... and later, Tatiana chimed in:

I am with Mike on this one. Error stream is already exposed, so it
makes sense (to me) to expose the debug stuff as well.

Original issue reported on code.google.com by tristanb...@gmail.com on 13 Dec 2011 at 12:44

GoogleCodeExporter commented 8 years ago

Original comment by javier.barreiro@gmail.com on 30 May 2012 at 5:31