You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@directory.apache.org by Emmanuel Lécharny <el...@gmail.com> on 2014/12/04 09:12:49 UTC

[Studio] Where to put logs ?

Hi guys,

while working on the new configuration pli-ugin, I see that we generate
tons of exceptions (mainly NumberFormatException when validating things
like the Port, etc) when we fill wrong values. In some case, we do
validate the input char by char, or we validate the full input as a
whole, etc.

Not a pb.

Now, the thing is that those exceptions - and the associated stack trace
- are pollution. I can catch most of them, and generate a decent error
message instead, but the question is :
- where should I log the info ?
- should I declare a Logger ?
- Is this something we can ask the eclipse platform to log ?

What is the best practice?

Thanks !


Re: [Studio] Where to put logs ?

Posted by Jeff MAURY <je...@jeffmaury.com>.
Eclipse/OSGI provides a log framework that can be accessed from the bundle
activator class. Maybe it should be returned as feedback to the user
(logging with Eclipse is equivalent of of flying into a back hole and
should be restricted for debugging/support)

Jeff

On Thu, Dec 4, 2014 at 9:12 AM, Emmanuel Lécharny <el...@gmail.com>
wrote:

> Hi guys,
>
> while working on the new configuration pli-ugin, I see that we generate
> tons of exceptions (mainly NumberFormatException when validating things
> like the Port, etc) when we fill wrong values. In some case, we do
> validate the input char by char, or we validate the full input as a
> whole, etc.
>
> Not a pb.
>
> Now, the thing is that those exceptions - and the associated stack trace
> - are pollution. I can catch most of them, and generate a decent error
> message instead, but the question is :
> - where should I log the info ?
> - should I declare a Logger ?
> - Is this something we can ask the eclipse platform to log ?
>
> What is the best practice?
>
> Thanks !
>
>


-- 
Jeff MAURY


"Legacy code" often differs from its suggested alternative by actually
working and scaling.
 - Bjarne Stroustrup

http://www.jeffmaury.com
http://riadiscuss.jeffmaury.com
http://www.twitter.com/jeffmaury