67b57dea50
LogProfiler and the web project to use a web profiler (MiniProfiler). Fixes medium trust implementation, adds performance check for binding to begin request, changes Web profiler over to be decoupled from the umbraco application objects (binds to events by itself)
36 lines
904 B
C#
36 lines
904 B
C#
using System;
|
|
using System.Collections.Generic;
|
|
using System.Linq;
|
|
using System.Text;
|
|
using Umbraco.Core.Logging;
|
|
|
|
namespace Umbraco.Core.Profiling
|
|
{
|
|
/// <summary>
|
|
/// A profiler that outputs its results to the LogHelper
|
|
/// </summary>
|
|
public class LogProfiler : IProfiler
|
|
{
|
|
public string Render()
|
|
{
|
|
return string.Empty;
|
|
}
|
|
|
|
public IDisposable Step(string name)
|
|
{
|
|
LogHelper.Debug(typeof(LogProfiler), "Starting - " + name);
|
|
return DisposableTimer.Start(l => LogHelper.Info(typeof (LogProfiler), () => name + " (took " + l + "ms)"));
|
|
}
|
|
|
|
public void Start()
|
|
{
|
|
//the log will alwasy be started
|
|
}
|
|
|
|
public void Stop(bool discardResults = false)
|
|
{
|
|
//we don't need to do anything here
|
|
}
|
|
}
|
|
}
|