本文整理汇总了C#中NLog.Config.LoggingRule.ToString方法的典型用法代码示例。如果您正苦于以下问题:C# LoggingRule.ToString方法的具体用法?C# LoggingRule.ToString怎么用?C# LoggingRule.ToString使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类NLog.Config.LoggingRule
的用法示例。
在下文中一共展示了LoggingRule.ToString方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: LogRuleToStringTest_multiple_targets
public void LogRuleToStringTest_multiple_targets()
{
var target = new FileTarget {Name = "file1"};
var target2 = new FileTarget {Name = "file2"};
var loggingRule = new LoggingRule("namespace.comp1", target);
loggingRule.Targets.Add(target2);
var s = loggingRule.ToString();
Assert.Equal("logNamePattern: (namespace.comp1:Equals) levels: [ ] appendTo: [ file1 file2 ]", s);
}
示例2: LogRuleToStringTest_none
public void LogRuleToStringTest_none()
{
var target = new FileTarget {Name = "file1"};
var loggingRule = new LoggingRule("*", target);
var s = loggingRule.ToString();
Assert.Equal("logNamePattern: (:All) levels: [ ] appendTo: [ file1 ]", s);
}
示例3: LogRuleToStringTest_filter
public void LogRuleToStringTest_filter()
{
var target = new FileTarget {Name = "file1"};
var loggingRule = new LoggingRule("namespace.comp1", target);
var s = loggingRule.ToString();
Assert.Equal("logNamePattern: (namespace.comp1:Equals) levels: [ ] appendTo: [ file1 ]", s);
}
示例4: LogRuleToStringTest_minAndMax
public void LogRuleToStringTest_minAndMax()
{
var target = new FileTarget {Name = "file1"};
var loggingRule = new LoggingRule("*", LogLevel.Debug, LogLevel.Error, target);
var s = loggingRule.ToString();
Assert.Equal("logNamePattern: (:All) levels: [ Debug Info Warn Error ] appendTo: [ file1 ]", s);
}