|
|
|
|
|
Re: Logger in RCP model [message #452752 is a reply to message #452715] |
Thu, 13 July 2006 17:24 |
Eclipse User |
|
|
|
Originally posted by: lamont_gilbert.rigidsoftware.com
Igor Semenko wrote:
> Hi, I'm new to RCP and I would like to know how do you guys log messages
> within your model classes?
>
> The problem is that I don't want to introduce dependency on the
> MyPlugin.getLog() (and therefore Eclipse platform) into generic model
> classes. If I just use Log4j and Logger.getInstance() - I'm in trouble
> redirecting Log4j's messages into proper location.
>
> There is a nice article on this topic
> ( http://www-128.ibm.com/developerworks/opensource/library/os- eclog/), but
> this would again wire my model to something like
> MyPlugin.getLogManager.getLogger().
>
> There is also possiblity to inject Logger into model classes, but this is
> 'too much' for this problem.
I think your stuck. Eclipse has its own logging architecture. You can
choose to instead use your own logging in eclipse. If you do, then you can
choose to use the same logging that you use in your model classes.
I too have divided my model classes out into their own plugin and they do
not call on _any_ eclipse methods. That plugin does not import any eclipse
packages IIRC. I have not put logging into it but the plan was to probably
use Java's Logger. However, one of the libraries I use uses log4J... Its
a headache. Everybody logs for himself. You would end up dividing the
logging by layers anyway. Just annoying that each layer would use a
different library.
--
Respectfully,
CL Gilbert
"Verily, verily, I say unto you, He that entereth not by the door() into the
sheepfold{}, but climbeth up some other *way, the same is a thief and a
robber."
|
|
|
|
Powered by
FUDForum. Page generated in 0.04179 seconds