[MonoDevelop] Logging in MonoDevelop / Addins

Jacob Ilsø Christensen jacobilsoe at gmail.com
Sat Mar 11 10:40:20 EST 2006


Hi.

This issue has been discussed a couple of times but we never managed
to agree on a solution.

I agree that we should do it the way you propose, so if there are no
arguments, maybe you could make a patch for fixing this issue?

/Jacob

On 3/11/06, Matze Braun <matze at braunis.de> wrote:
> I just wondered why monodevelop defines these ILoggingService classes
> just to pipe the messages down to log4net again. Wouldn't it make more
> sense to simply use log4net everyhwere instead of having an own
> class/interface?
>
> The problem I have with ILoggingService is that I'd like to have log
> messages per namespace/class. With log4net this is easy, I just have to
> copy that same line that initalized the log into each class:
>
> public MyClass {
>         private static readonly log4net.ILog log =
> log4net.LogManager.GetLogger(System.Reflection.MethodBase.GetCurrentMethod().DeclaringType);
>
>         public void blup() {
>                 log.info("Some Message");
>                 log.info("Another message");
>         }
> }
>
> With the ILoggingService this boilds down to something like this:
>
> public MyClass {
>         public void blup() {
>                 Runtime.Logging.info("MyClass", "Some Message");
>                 Runtime.Logging.info("MyClass", "ANother message");
>         }
> }
>
> The need to specify "MyClass" at each log message is annoying, it's easy
> to make typos and internally this always results in a
> LogManager.GetLogger("MyClass"); which might be costly...
>
> Wouldn't it make more sense to just promote direct log4net usage in
> monodevelop?
>
> Greetings,
>         Matze
>
>
> _______________________________________________
> Monodevelop-list mailing list
> Monodevelop-list at lists.ximian.com
> http://lists.ximian.com/mailman/listinfo/monodevelop-list
>


More information about the Monodevelop-list mailing list