Hi,

I have started to look at IVYDE-39. I sucessfully synchronized it with the 
ivyde trunk. This was quite easy, just the package names were changed.

But know I try to make it work with the ivy trunk, the 2.0. And now I get 
quite confuse by the API.

In IvyDE, there is special logger for ivy, the IvyConsole, that log every 
message in an eclipse console. So now it seem that there is not anymore 
MessageImpl, but there is a MessageLogger. But as far as I understand, this 
logger does more that just logging. This apparently have to keep every logged 
message so they can be retrieved into a resolve report. Which seems to me a 
different purpose.

And then, if I want to set my custom logger, the former code was :

   if (IvyContext.getContext().getMessageImpl()==null) {
       IvyContext.getContext().setMessageImpl(ivyconsole);
   }

As there is no setter on the ivy context, either I do :

    if (!(Messsage.getDefaultLogger() instanceof IvyConsole)) {
         Messsage.setDefaultLogger(ivyconsole);
    }

which afraid me about the thread safety... Or I could do

    Ivy ivy = IvyContext.getContext().getIvy();
    if (!(ivy.getLoggerEngine().peekLogger() instanceof IvyConsole)) {
        ivy.getLoggerEngine().pushLogger(ivyconsole);
    }

And here I am wondering what is the difference between the beans that are 
stored into ivy, and the ones into the ivy context.

So, how should use the logger API ?

cheers,
Nicolas

Reply via email to