directory-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Emmanuel Lécharny <elecha...@gmail.com>
Subject Re: [Studio] Logging & Eclipse
Date Sun, 11 Jan 2015 09:23:28 GMT
Le 11/01/15 10:04, Emmanuel Lécharny a écrit :
> Hi !
>
> now that I have - again - a working dev platform for Eclipse - many
> thanks Stefan ! - I would like to bring some discussion about logs.
>
> Currently, we are mostly using the getLog().log() method all over the
> code. It gets the logger from the plugin. So far, so good, but the pb is
> that this approach is only available when you are using it in classes
> inheriting from Plugin.
>
> One option, as I can see in the code, would be to grab the plugin logger
> like in :
>
>     ConnectionUIPlugin.getDefault().getLog().log( blah... );
>
> but it's a bit heavy, and it does not allow you to discriminate between
> errors, warnings or even debug.
>
> In the LdifModificationLogger, we are using JUL to log LDIF parsing
> error messages. It's very limited to this class.
>
> All in all, we have very few logs, and the logs we have are mainly
> stacktraces or messages we don't know their level of criticity.
>
> So, what about using Log4j? Considering that most of the bundles we are
> depending on are using it, why not using it too in Studio ?
>
> Also what would be the impact, and the technical hurdles we would face
> if so ?
>
>
> Wdyt ?
>
>
I was more specifically thinking about using code like :

public class OpenConfigurationAction implements IObjectActionDelegate
{
    /** The logger for this class
    private static final Logger LOG = LoggerFactory.getLogger(
OpenConfigurationAction.class );
...

or :

public class OpenConfigurationAction implements IObjectActionDelegate
{
    /** The logger for this class
    private static final Logger LOG = LoggerFactory.getLogger(
"org.apache.directory.studio.apacheds.configuration.v2" );

instead of doing :

...
                catch ( PartInitException e )
                {
                    ApacheDS2ConfigurationPlugin.getDefault().getLog().log(
                        new Status( Status.ERROR,
"org.apache.directory.studio.apacheds.configuration.v2",
                            e.getMessage() ) );

...


PS : I'm into the OpenConfigurationAction class in the
apacheds.configuration.v2 plugin.

Mime
View raw message