[Monodevelop-patches-list] r2602 - trunk/MonoDevelop/Core/src/MonoDevelop.Base/Services
Christian Hergert <chris@mosaix.net>
chergert at mono-cvs.ximian.com
Thu Jun 16 14:16:17 EDT 2005
Author: chergert
Date: 2005-06-16 14:16:16 -0400 (Thu, 16 Jun 2005)
New Revision: 2602
Modified:
trunk/MonoDevelop/Core/src/MonoDevelop.Base/Services/DefaultLoggingService.cs
Log:
Add the option to specify the emitting type of the logging information.
Modified: trunk/MonoDevelop/Core/src/MonoDevelop.Base/Services/DefaultLoggingService.cs
===================================================================
--- trunk/MonoDevelop/Core/src/MonoDevelop.Base/Services/DefaultLoggingService.cs 2005-06-15 22:20:14 UTC (rev 2601)
+++ trunk/MonoDevelop/Core/src/MonoDevelop.Base/Services/DefaultLoggingService.cs 2005-06-16 18:16:16 UTC (rev 2602)
@@ -25,10 +25,15 @@
base.InitializeService();
}
- ILog GetLogger()
+ ILog GetLogger ()
{
return LogManager.GetLogger(typeof(ILoggingService));
}
+
+ ILog GetLogger (System.Type type)
+ {
+ return LogManager.GetLogger(type);
+ }
public bool IsDebugEnabled {
get {
@@ -60,6 +65,36 @@
}
}
+ public void Debug (System.Type type, object message)
+ {
+ GetLogger(type).Debug (message);
+ OnLogAppended ("Debug", message.ToString());
+ }
+
+ public void Info (System.Type type, object message)
+ {
+ GetLogger(type).Info (message);
+ OnLogAppended ("Info", message.ToString());
+ }
+
+ public void Warn (System.Type type, object message)
+ {
+ GetLogger(type).Warn (message);
+ OnLogAppended ("Warn", message.ToString());
+ }
+
+ public void Error (System.Type type, object message)
+ {
+ GetLogger(type).Error (message);
+ OnLogAppended ("Error", message.ToString());
+ }
+
+ public void Fatal (System.Type type, object message)
+ {
+ GetLogger(type).Fatal (message);
+ OnLogAppended ("Fatal", message.ToString());
+ }
+
public void Debug (object message)
{
GetLogger().Debug (message);
@@ -150,6 +185,36 @@
OnLogAppended ("Fatal", String.Format(format, args));
}
+ public void DebugFormat (Type type, string format, params object[] args)
+ {
+ GetLogger(type).DebugFormat (format, args);
+ OnLogAppended ("Debug", String.Format(format, args));
+ }
+
+ public void InfoFormat (Type type, string format, params object[] args)
+ {
+ GetLogger(type).InfoFormat (format, args);
+ OnLogAppended ("Info", String.Format(format, args));
+ }
+
+ public void WarnFormat (Type type, string format, params object[] args)
+ {
+ GetLogger(type).WarnFormat (format, args);
+ OnLogAppended ("Warn", String.Format(format, args));
+ }
+
+ public void ErrorFormat (Type type, string format, params object[] args)
+ {
+ GetLogger(type).ErrorFormat (format, args);
+ OnLogAppended ("Error", String.Format(format, args));
+ }
+
+ public void FatalFormat (Type type, string format, params object[] args)
+ {
+ GetLogger(type).FatalFormat (format, args);
+ OnLogAppended ("Fatal", String.Format(format, args));
+ }
+
public void DebugFormat(IFormatProvider provider, string format, params object[] args)
{
GetLogger().DebugFormat (provider, format, args);
More information about the Monodevelop-patches-list
mailing list