Mercurial > pub > ImplabNet
view Implab/Diagnostics/TraceLog.cs @ 38:1cedc4e58acc diagnostics
Закрыть ветку diagnostics
author | cin |
---|---|
date | Tue, 15 Apr 2014 02:46:33 +0400 |
parents | 313f708a50e9 |
children | fe33f4e02ad5 |
line wrap: on
line source
using System; using System.Collections.Generic; using System.Diagnostics; using System.Linq; using System.Text; using System.Threading.Tasks; namespace Implab.Diagnostics { /// <summary> /// Класс для публикации событий выполнения программы, события публикуются через <see cref="LogChannel{TraceEvent}"/> /// </summary> public static class TraceLog { [Conditional("TRACE")] public static void Transfer(TraceContext from) { TraceContext.Transfer(from); } [Conditional("TRACE")] public static void StartLogicalOperation() { TraceContext.Current.StartLogicalOperation(); } [Conditional("TRACE")] public static void StartLogicalOperation(string name) { TraceContext.Current.StartLogicalOperation(name); } [Conditional("TRACE")] public static void EndLogicalOperation() { TraceContext.Current.EndLogicalOperation(); } [Conditional("TRACE")] public static void TraceInformation(string format, params object[] arguments) { LogChannel<TraceEvent>.Default.LogEvent(TraceEvent.Create(TraceEventType.Information, format, arguments)); } [Conditional("TRACE")] public static void TraceWarning(string format, params object[] arguments) { LogChannel<TraceEvent>.Default.LogEvent(TraceEvent.Create(TraceEventType.Warning, format, arguments)); } [Conditional("TRACE")] public static void TraceError(string format, params object[] arguments) { LogChannel<TraceEvent>.Default.LogEvent(TraceEvent.Create(TraceEventType.Error, format, arguments)); } [Conditional("TRACE")] public static void TraceError(Exception err) { TraceError("{0}", err); } } }