[Monodevelop-patches-list] r2417 - in trunk/MonoDevelop/Core/src/MonoDevelop.Base: . Services
Christian Hergert <chris@mosaix.net>
chergert at mono-cvs.ximian.com
Sat Apr 2 01:26:42 EST 2005
Author: chergert
Date: 2005-04-02 01:26:42 -0500 (Sat, 02 Apr 2005)
New Revision: 2417
Modified:
trunk/MonoDevelop/Core/src/MonoDevelop.Base/ChangeLog
trunk/MonoDevelop/Core/src/MonoDevelop.Base/Services/DefaultLoggingService.cs
trunk/MonoDevelop/Core/src/MonoDevelop.Base/Services/ILoggingService.cs
Log:
Services/ILoggingService.cs: Update LogAppendedArgs
Services/DefaultLoggingService.cs: Remove need for stack trace.
Modified: trunk/MonoDevelop/Core/src/MonoDevelop.Base/ChangeLog
===================================================================
--- trunk/MonoDevelop/Core/src/MonoDevelop.Base/ChangeLog 2005-04-02 03:49:31 UTC (rev 2416)
+++ trunk/MonoDevelop/Core/src/MonoDevelop.Base/ChangeLog 2005-04-02 06:26:42 UTC (rev 2417)
@@ -1,5 +1,13 @@
2005-04-01 Christian Hergert <christian.hergert at gmail.com>
+ * Services/ILoggingService.cs: Update the LogAppendedArgs and remove the
+ category.
+ * Services/DefaultLoggingService.cs: Remove the need for the StackTrace.
+ We dont really need that in depth of information currently. Will look to
+ find this feature directly in log4net and update soon.
+
+2005-04-01 Christian Hergert <christian.hergert at gmail.com>
+
* Commands/VBConverter/ConvertBuffer.cs: Convert to use new Logging
framework.
* Commands/MenuItemBuilders.cs
Modified: trunk/MonoDevelop/Core/src/MonoDevelop.Base/Services/DefaultLoggingService.cs
===================================================================
--- trunk/MonoDevelop/Core/src/MonoDevelop.Base/Services/DefaultLoggingService.cs 2005-04-02 03:49:31 UTC (rev 2416)
+++ trunk/MonoDevelop/Core/src/MonoDevelop.Base/Services/DefaultLoggingService.cs 2005-04-02 06:26:42 UTC (rev 2417)
@@ -20,164 +20,166 @@
{
base.InitializeService();
}
-
- ILog GetLogger(System.Type type)
- {
- return LogManager.GetLogger(type);
- }
ILog GetLogger()
{
- return LogManager.GetLogger(System.Reflection.MethodBase.GetCurrentMethod().DeclaringType);
+ return LogManager.GetLogger(typeof(ILoggingService));
}
- System.Reflection.MethodBase GetCallingMethod()
- {
- System.Diagnostics.StackTrace
- trace = new System.Diagnostics.StackTrace(true);
- return trace.GetFrame(2).GetMethod();
- }
-
public bool IsDebugEnabled {
get {
- return GetLogger(GetCallingMethod().DeclaringType).IsDebugEnabled;
+ return GetLogger().IsDebugEnabled;
}
}
public bool IsInfoEnabled {
get {
- return GetLogger(GetCallingMethod().DeclaringType).IsInfoEnabled;
+ return GetLogger().IsInfoEnabled;
}
}
public bool IsWarnEnabled {
get {
- return GetLogger(GetCallingMethod().DeclaringType).IsWarnEnabled;
+ return GetLogger().IsWarnEnabled;
}
}
public bool IsErrorEnabled {
get {
- return GetLogger(GetCallingMethod().DeclaringType).IsErrorEnabled;
+ return GetLogger().IsErrorEnabled;
}
}
public bool IsFatalEnabled {
get {
- return GetLogger(GetCallingMethod().DeclaringType).IsFatalEnabled;
+ return GetLogger().IsFatalEnabled;
}
}
public void Debug (object message)
{
- System.Type type = GetCallingMethod().DeclaringType;
- GetLogger(type).Debug (message);
- OnLogAppended ("Debug", type.ToString(), message.ToString());
+ GetLogger().Debug (message);
+ OnLogAppended ("Debug", message.ToString());
}
public void Info (object message)
{
- System.Type type = GetCallingMethod().DeclaringType;
- GetLogger(type).Info (message);
- OnLogAppended ("Info", type.ToString(), message.ToString());
+ GetLogger().Info (message);
+ OnLogAppended ("Info", message.ToString());
}
public void Warn (object message)
{
- GetLogger(GetCallingMethod().DeclaringType).Warn (message);
+ GetLogger().Warn (message);
+ OnLogAppended ("Warn", message.ToString());
}
public void Error (object message)
{
- GetLogger(GetCallingMethod().DeclaringType).Error (message);
+ GetLogger().Error (message);
}
public void Fatal (object message)
{
- GetLogger(GetCallingMethod().DeclaringType).Fatal (message);
+ GetLogger().Fatal (message);
+ OnLogAppended ("Fatal", message.ToString());
}
public void Debug (object message, Exception t)
{
- GetLogger(GetCallingMethod().DeclaringType).Debug (message, t);
+ GetLogger().Debug (message, t);
+ OnLogAppended ("Debug", message + t.ToString());
}
public void Info (object message, Exception t)
{
- GetLogger(GetCallingMethod().DeclaringType).Info (message, t);
+ GetLogger().Info (message, t);
+ OnLogAppended ("Info", message + t.ToString());
}
public void Warn (object message, Exception t)
{
- GetLogger(GetCallingMethod().DeclaringType).Warn (message, t);
+ GetLogger().Warn (message, t);
+ OnLogAppended ("Warn", message + t.ToString());
}
public void Error (object message, Exception t)
{
- GetLogger(GetCallingMethod().DeclaringType).Error (message, t);
+ GetLogger().Error (message, t);
+ OnLogAppended ("Error", message + t.ToString());
}
public void Fatal (object message, Exception t)
{
- GetLogger(GetCallingMethod().DeclaringType).Fatal (message, t);
+ GetLogger().Fatal (message, t);
+ OnLogAppended ("Fatal", message + t.ToString());
}
public void DebugFormat (string format, params object[] args)
{
- GetLogger(GetCallingMethod().DeclaringType).DebugFormat (format, args);
+ GetLogger().DebugFormat (format, args);
+ OnLogAppended ("Debug", String.Format(format, args));
}
public void InfoFormat (string format, params object[] args)
{
- GetLogger(GetCallingMethod().DeclaringType).InfoFormat (format, args);
+ GetLogger().InfoFormat (format, args);
+ OnLogAppended ("Info", String.Format(format, args));
}
public void WarnFormat (string format, params object[] args)
{
- GetLogger(GetCallingMethod().DeclaringType).WarnFormat (format, args);
+ GetLogger().WarnFormat (format, args);
+ OnLogAppended ("Warn", String.Format(format, args));
}
public void ErrorFormat (string format, params object[] args)
{
- GetLogger(GetCallingMethod().DeclaringType).ErrorFormat (format, args);
+ GetLogger().ErrorFormat (format, args);
+ OnLogAppended ("Error", String.Format(format, args));
}
public void FatalFormat (string format, params object[] args)
{
- GetLogger(GetCallingMethod().DeclaringType).FatalFormat (format, args);
+ GetLogger().FatalFormat (format, args);
+ OnLogAppended ("Fatal", String.Format(format, args));
}
public void DebugFormat(IFormatProvider provider, string format, params object[] args)
{
- GetLogger(GetCallingMethod().DeclaringType).DebugFormat (provider, format, args);
+ GetLogger().DebugFormat (provider, format, args);
+ OnLogAppended ("Debug", String.Format(provider, format, args));
}
public void InfoFormat(IFormatProvider provider, string format, params object[] args)
{
- GetLogger(GetCallingMethod().DeclaringType).InfoFormat (provider, format, args);
+ GetLogger().InfoFormat (provider, format, args);
+ OnLogAppended ("Info", String.Format(provider, format, args));
}
public void WarnFormat(IFormatProvider provider, string format, params object[] args)
{
- GetLogger(GetCallingMethod().DeclaringType).WarnFormat (provider, format, args);
+ GetLogger().WarnFormat (provider, format, args);
+ OnLogAppended ("Warn", String.Format(provider, format, args));
}
public void ErrorFormat(IFormatProvider provider, string format, params object[] args)
{
- GetLogger(GetCallingMethod().DeclaringType).ErrorFormat (provider, format, args);
+ GetLogger().ErrorFormat (provider, format, args);
+ OnLogAppended ("Error", String.Format(provider, format, args));
}
public void FatalFormat(IFormatProvider provider, string format, params object[] args)
{
- GetLogger(GetCallingMethod().DeclaringType).FatalFormat (provider, format, args);
+ GetLogger().FatalFormat (provider, format, args);
+ OnLogAppended ("Fatal", String.Format(provider, format, args));
}
- public void OnLogAppended(string level, string category, string message)
+ public void OnLogAppended(string level, string message)
{
if (LogAppended != null) {
LogAppendedArgs args = new LogAppendedArgs();
args.Level = level;
- args.Category = category;
args.Message = message;
args.Timestamp = DateTime.Now;
LogAppended(this, args);
Modified: trunk/MonoDevelop/Core/src/MonoDevelop.Base/Services/ILoggingService.cs
===================================================================
--- trunk/MonoDevelop/Core/src/MonoDevelop.Base/Services/ILoggingService.cs 2005-04-02 03:49:31 UTC (rev 2416)
+++ trunk/MonoDevelop/Core/src/MonoDevelop.Base/Services/ILoggingService.cs 2005-04-02 06:26:42 UTC (rev 2417)
@@ -47,7 +47,7 @@
public class LogAppendedArgs
{
- public string Category, Message, Level;
+ public string Message, Level;
public DateTime Timestamp;
}
}
More information about the Monodevelop-patches-list
mailing list