本文整理汇总了C#中LogManager.CreateLogger方法的典型用法代码示例。如果您正苦于以下问题:C# LogManager.CreateLogger方法的具体用法?C# LogManager.CreateLogger怎么用?C# LogManager.CreateLogger使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类LogManager
的用法示例。
在下文中一共展示了LogManager.CreateLogger方法的8个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: OverrideListenersIfSourceConfigured
public void OverrideListenersIfSourceConfigured()
{
var logManager = new LogManager();
var logger = (Logger)logManager.CreateLogger("LogManager.Test");
Assert.Equal(0, logger.TraceSource.Listeners.Count);
}
示例2: OverrideDefaultLevelIfSwitchConfigured
public void OverrideDefaultLevelIfSwitchConfigured()
{
var logManager = new LogManager();
var logger = logManager.CreateLogger("LogManager.Test");
Assert.True(logger.IsDebugEnabled);
}
示例3: DefaultToStandardListenersIfSwitchNameUnknown
public void DefaultToStandardListenersIfSwitchNameUnknown()
{
var logManager = new LogManager();
var logger = (Logger)logManager.CreateLogger("LogManager.UnknownSource");
Assert.Equal(Trace.Listeners.Count, logger.TraceSource.Listeners.Count);
}
示例4: TreatPeriodAsNamespaceMarker
public void TreatPeriodAsNamespaceMarker()
{
var logManager = new LogManager();
var logger = (Logger)logManager.CreateLogger("LogManager.Test.Namespace");
Assert.True(logger.IsDebugEnabled);
Assert.Equal(0, logger.TraceSource.Listeners.Count);
}
示例5: DefaultToWarningIfSwitchNameUnknown
public void DefaultToWarningIfSwitchNameUnknown()
{
var logManager = new LogManager();
var logger = logManager.CreateLogger("LogManager.UnknownSource");
Assert.True(logger.IsWarnEnabled);
Assert.False(logger.IsInfoEnabled);
}
示例6: FirewallController
public FirewallController(IWinFirewallApi firewallApi, LogManager logManager)
{
_fw = firewallApi;
_log = logManager.CreateLogger();
}
示例7: SwitchNameIsCaseInsensitive
public void SwitchNameIsCaseInsensitive(String name)
{
var logManager = new LogManager();
var logger = (Logger)logManager.CreateLogger(name);
Assert.True(logger.IsDebugEnabled);
Assert.Equal(0, logger.TraceSource.Listeners.Count);
}
示例8: CanTolerateBadLoggerName
public void CanTolerateBadLoggerName(String name)
{
var logManager = new LogManager();
Assert.NotNull(logManager.CreateLogger(name));
}