using System;
namespace Umbraco.Core.Logging
{
internal static class ProfilerExtensions
{
///
/// Writes out a step prefixed with the type
///
///
///
///
///
internal static IDisposable Step(this IProfiler profiler, string name)
{
if (profiler == null) throw new ArgumentNullException("profiler");
return profiler.Step(typeof (T), name);
}
///
/// Writes out a step prefixed with the type
///
///
///
///
///
internal static IDisposable Step(this IProfiler profiler, Type objectType, string name)
{
if (profiler == null) throw new ArgumentNullException("profiler");
if (objectType == null) throw new ArgumentNullException("objectType");
if (name == null) throw new ArgumentNullException("name");
return profiler.Step(string.Format("[{0}] {1}", objectType.Name, name));
}
}
}