added HasValue unit test, removed the default.aspx file from the Web project, it now only exists in the UI project but

the codebehind still exist in the web for backwards compatibility. Updated the logging so that the LogHelper
can now write to a TraceContext specified if debugging which is handy if we want to write to the normal trace.
This commit is contained in:
Shannon Deminick
2012-08-29 07:47:16 +07:00
parent 3cd1592abc
commit 7be4480254
5 changed files with 44 additions and 40 deletions

View File

@@ -3,6 +3,7 @@ using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading;
using System.Web;
using log4net;
namespace Umbraco.Core.Logging
@@ -190,7 +191,7 @@ namespace Umbraco.Core.Logging
}
/// <summary>
/// Debugs a message, only generating the message if tracing is actually enabled. Use this method to avoid calling any long-running methods such as "ToDebugString" if logging is disabled.
/// Debugs a message, only generating the message if debug is actually enabled. Use this method to avoid calling any long-running methods such as "ToDebugString" if logging is disabled.
/// </summary>
/// <typeparam name="T"></typeparam>
/// <param name="generateMessageFormat">The generate message format.</param>
@@ -200,6 +201,22 @@ namespace Umbraco.Core.Logging
{
Debug(typeof(T), generateMessageFormat, formatItems);
}
/// <summary>
/// Debugs a message and also writes to the TraceContext specified, useful for when you would like the debug
/// output also displayed in the Http trace output.
/// </summary>
/// <typeparam name="T"></typeparam>
/// <param name="generateMessageFormat"></param>
/// <param name="trace"></param>
/// <param name="formatItems"></param>
public static void Debug<T>(string generateMessageFormat, TraceContext trace, params Func<object>[] formatItems)
{
if (trace == null) throw new ArgumentNullException("trace");
trace.Write(string.Format(generateMessageFormat, formatItems.Select(x => x())));
Debug(typeof(T), generateMessageFormat, formatItems);
}
#endregion
}