[MonoDevelop] Logging revisited

Jacob Ilsø Christensen jacobilsoe at gmail.com
Sat Jun 30 04:01:15 EDT 2007


Hi.

Some time ago there was some discussion about MonoDevelop's use of
log4net. Right now all logging seems to come from ILoggingService due
to:

LogManager.GetLogger(typeof(ILoggingService));

in DefaultLoggingService. This is not very informative. I have
attached a patch which looks at the stacktrace to attempt to determine
the calling type. It is rather hardcoded right now, but works for a
debug build (a release build might invalidate it due to e.g. inline
method optimizations) of MonoDevelop. To make it more accurate it
could be changed to traverse the stacktrace until a type different
from ILoggingService was found.

Is this patch ok or should it be changed to traverse the stack for the
calling type? Or do we want log4net dependencies in all classes that
need logging?

Regards,
Jacob
-------------- next part --------------
A non-text attachment was scrubbed...
Name: logging-type.patch
Type: text/x-patch
Size: 779 bytes
Desc: not available
Url : http://lists.ximian.com/pipermail/monodevelop-list/attachments/20070630/a286c010/attachment.bin 


More information about the Monodevelop-list mailing list