##// END OF EJS Templates
removed absolete Diagnostics classes
removed absolete Diagnostics classes

File last commit:

r252:6f4630d0bcd9 v3
r252:6f4630d0bcd9 v3
Show More
Trace.cs
73 lines | 2.5 KiB | text/x-csharp | CSharpLexer
cin
Added class Trace<T> to manage channels for individual classes, if SomeClass...
r212 using System;
using System.Collections.Generic;
using System.Diagnostics;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace Implab.Diagnostics {
public static class Trace<T> {
cin
removed absolete Diagnostics classes
r252 readonly static TraceSource _traceSource = new TraceSource(typeof(T).Name);
public static TraceSource TraceSource {
get { return _traceSource; }
cin
Added class Trace<T> to manage channels for individual classes, if SomeClass...
r212 }
/// <summary>
/// Starts the logical operation nested to the current operation nested to the current one.
/// </summary>
[Conditional("TRACE")]
public static void StartLogicalOperation() {
cin
removed absolete Diagnostics classes
r252 Trace.CorrelationManager.StartLogicalOperation();
cin
Added class Trace<T> to manage channels for individual classes, if SomeClass...
r212
}
/// <summary>
/// Starts the logical operation with the specified name, this name is usefull in logs.
/// </summary>
/// <param name="name">Name.</param>
[Conditional("TRACE")]
public static void StartLogicalOperation(string name) {
cin
removed absolete Diagnostics classes
r252 Trace.CorrelationManager.StartLogicalOperation();
cin
Added class Trace<T> to manage channels for individual classes, if SomeClass...
r212 }
/// <summary>
/// Ends the logical operation and restores the previous one.
/// </summary>
[Conditional("TRACE")]
cin
removed absolete Diagnostics classes
r252 public static void StopLogicalOperation() {
Trace.CorrelationManager.StopLogicalOperation();
cin
Added class Trace<T> to manage channels for individual classes, if SomeClass...
r212 }
/// <summary>
/// Writes an informational message.
/// </summary>
/// <param name="format">Format.</param>
/// <param name="arguments">Arguments.</param>
[Conditional("TRACE")]
public static void Log(string format, params object[] arguments) {
cin
removed absolete Diagnostics classes
r252 TraceSource.TraceEvent(TraceEventType.Information, 1, format, arguments);
cin
Added class Trace<T> to manage channels for individual classes, if SomeClass...
r212 }
/// <summary>
/// Writes a warning message.
/// </summary>
/// <param name="format">Format.</param>
/// <param name="arguments">Arguments.</param>
[Conditional("TRACE")]
public static void Warn(string format, params object[] arguments) {
cin
removed absolete Diagnostics classes
r252 TraceSource.TraceEvent(TraceEventType.Warning, 1, format, arguments);
cin
Added class Trace<T> to manage channels for individual classes, if SomeClass...
r212 }
[Conditional("TRACE")]
public static void Error(string format, params object[] arguments) {
cin
removed absolete Diagnostics classes
r252 TraceSource.TraceEvent(TraceEventType.Error, 1, format, arguments);
cin
Added class Trace<T> to manage channels for individual classes, if SomeClass...
r212 }
[Conditional("TRACE")]
public static void Error(Exception err) {
cin
removed absolete Diagnostics classes
r252 TraceSource.TraceData(TraceEventType.Error, 1, err);
cin
Added class Trace<T> to manage channels for individual classes, if SomeClass...
r212 }
}
}