本文整理汇总了C#中SourceLevels类的典型用法代码示例。如果您正苦于以下问题:C# SourceLevels类的具体用法?C# SourceLevels怎么用?C# SourceLevels使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
SourceLevels类属于命名空间,在下文中一共展示了SourceLevels类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: LogSource
/// <summary>
/// Initializes a new instance of the <see cref="LogSource"/> class with a name, a collection of <see cref="TraceListener"/>s and a level.
/// </summary>
/// <param name="name">The name for the instance.</param>
/// <param name="traceListeners">The collection of <see cref="TraceListener"/>s.</param>
/// <param name="level">The <see cref="SourceLevels"/> value.</param>
public LogSource(string name, List<TraceListener> traceListeners, SourceLevels level)
{
this.name = name;
this.traceListeners = traceListeners;
this.level = level;
this.instrumentationProvider = new LoggingInstrumentationProvider();
}
示例2: TraceManager
internal TraceManager()
{
this.defaultLogFolder = Environment.GetFolderPath(Environment.SpecialFolder.CommonApplicationData) + "\\Microsoft\\Care Suite\\Windows Device Recovery Tool\\Traces\\";
this.currentTracingLevel = SourceLevels.All;
this.Tracers = new List<IThreadSafeTracer>();
AppDomain.CurrentDomain.ProcessExit += new EventHandler(this.OnCurrentDomainProcessExit);
}
示例3: TraceSourceInfo
internal TraceSourceInfo (string name, SourceLevels levels, TraceImplSettings settings)
{
this.name = name;
this.levels = levels;
this.listeners = new TraceListenerCollection (false);
this.listeners.Add (new DefaultTraceListener(), settings);
}
示例4: LogLevel
LogLevel(string name, int index, SourceLevels sourceLevel, TraceEventType traceEventType)
{
Name = name;
_index = index;
SourceLevel = sourceLevel;
TraceEventType = traceEventType;
}
示例5: LogSourceData
/// <summary>
/// Initializes a new instance of the <see cref="LogSourceData"/> class with the specified parameters.
/// </summary>
/// <param name="name">The name for the log source.</param>
/// <param name="level">The level for the log source.</param>
/// <param name="autoFlush"><see langword="true"/> to enable auto-flush; otherwise, <see langword="false"/>.</param>
/// <param name="traceListeners">One or more <see cref="TraceListener"/> objects.</param>
public LogSourceData(string name, SourceLevels level, bool autoFlush, params TraceListener[] traceListeners)
{
this.Name = name;
this.Level = level;
this.AutoFlush = autoFlush;
this.Listeners = traceListeners.ToList();
}
示例6: TraceSourceSetting
/// <summary>
/// Initializes a new instance of the <see cref="TraceSourceSetting"/> class.
/// </summary>
/// <param name="sourceName">Name of the source.</param>
/// <param name="loggingLevel">The logging level.</param>
public TraceSourceSetting(string sourceName, SourceLevels loggingLevel)
{
Guard.NotNullOrEmpty(() => sourceName, sourceName);
this.SourceName = sourceName;
this.LoggingLevel = loggingLevel;
}
示例7: TraceSourceInfo
internal TraceSourceInfo (string name, SourceLevels levels, TraceImplSettings settings)
{
this.name = name;
this.levels = levels;
this.listeners = new TraceListenerCollection ();
this.listeners.Add (new DefaultTraceListener() { IndentSize = settings.IndentSize });
}
示例8: LogSource
/// <summary>
/// Initializes a new instance of the <see cref="LogSource"/> class with a name, a collection of <see cref="TraceListener"/>s, a level and the auto flush.
/// </summary>
/// <param name="name">The name for the instance.</param>
/// <param name="traceListeners">The collection of <see cref="TraceListener"/>s.</param>
/// <param name="level">The <see cref="SourceLevels"/> value.</param>
/// <param name="autoFlush">If Flush should be called on the Listeners after every write.</param>
public LogSource(string name, IEnumerable<TraceListener> traceListeners, SourceLevels level, bool autoFlush)
{
this.name = name;
this.traceListeners = new List<TraceListener>(traceListeners);
this.level = level;
this.autoFlush = autoFlush;
}
示例9: AssertNoBindingErrorsTraceListener
private AssertNoBindingErrorsTraceListener(SourceLevels level)
{
WindowsRegistryAssert.HasDword(@"Software\Microsoft\Tracing\WPF", "ManagedTracing",1,"You need to add this key to your registry for Wpf report Binding Errors. \n" + RegEditText);
PresentationTraceSources.DataBindingSource.Listeners.Add(this);
PresentationTraceSources.DataBindingSource.Switch.Level = level;
}
示例10: LoggingLevel
LoggingLevel(string name, int index, SourceLevels sourceLevel, TraceEventType traceEventType)
{
_name = name;
_index = index;
_sourceLevel = sourceLevel;
_traceEventType = traceEventType;
}
示例11: SetTraceLevel
public static void SetTraceLevel(LogCategory category, SourceLevels sourceLevel)
{
var sourceSwitch = new SourceSwitch(string.Format(CultureInfo.InvariantCulture, "MigSharp.{0}.Switch", category))
{
Level = sourceLevel
};
Sources[category].Switch = sourceSwitch;
}
示例12: GetAllEventsSource
private EntLib.TraceSourceData GetAllEventsSource(SourceLevels level)
{
var source = new EntLib.TraceSourceData();
source.DefaultLevel = level;
this.AddEventLogTraceListenerReference(source);
return source;
}
示例13: WriteLine
public void WriteLine(SourceLevels level, string message, string category)
{
Console.Out.Write(String.Format("{0} {1}", LevelToString(level), category));
Console.Out.Write(": ");
Console.Out.Write(message);
Console.Out.Write(Environment.NewLine);
Console.Out.Flush();
}
示例14: LogManager
/// <summary>
/// Initializes the configured switches for <see cref="LogManager"/>.
/// </summary>
/// <param name="diagnosticsSection">The system.diagnostics configuration section.</param>
internal LogManager(ConfigurationSection diagnosticsSection)
{
SourceSwitch defaultSwitch;
configuredSources = GetConfiguredSources(diagnosticsSection);
configuredSwitches = GetConfiguredSwitches(diagnosticsSection);
defaultLevel = configuredSwitches.TryGetValue("default", out defaultSwitch) ? defaultSwitch.Level : SourceLevels.Warning;
}
示例15: PiiTraceSource
internal PiiTraceSource(string name, string eventSourceName, SourceLevels levels)
: base(name, levels)
{
#pragma warning disable 618
Fx.Assert(!String.IsNullOrEmpty(eventSourceName), "Event log source name must be valid");
#pragma warning restore 618
this.eventSourceName = eventSourceName;
}