本文整理汇总了C#中ConsoleLogger.Debug方法的典型用法代码示例。如果您正苦于以下问题:C# ConsoleLogger.Debug方法的具体用法?C# ConsoleLogger.Debug怎么用?C# ConsoleLogger.Debug使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类ConsoleLogger
的用法示例。
在下文中一共展示了ConsoleLogger.Debug方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: Just_verify_exception_Write
public void Just_verify_exception_Write()
{
var sut = new ConsoleLogger(GetType());
sut.Debug("Hello world", new Exception());
}
示例2: Just_verify_the_regular_write
public void Just_verify_the_regular_write()
{
var sut = new ConsoleLogger(GetType());
sut.Debug("Hello world");
}
示例3: Just_verify_formatted_Write
public void Just_verify_formatted_Write()
{
var sut = new ConsoleLogger(GetType());
sut.Debug("Hello {0}", "world");
}
示例4: InfoLogger
public void InfoLogger()
{
ConsoleLogger log = new ConsoleLogger("Logger", LoggerLevel.Info);
log.Debug("Some debug message");
log.Info("Some info message");
log.Error("Some error message");
log.Fatal("Some fatal error message");
log.Warn("Some warn message");
String logcontents = outWriter.GetStringBuilder().ToString();
StringWriter expected = new StringWriter();
expected.WriteLine("[Info] 'Logger' Some info message");
expected.WriteLine("[Error] 'Logger' Some error message");
expected.WriteLine("[Fatal] 'Logger' Some fatal error message");
expected.WriteLine("[Warn] 'Logger' Some warn message");
Assert.AreEqual(expected.GetStringBuilder().ToString(), logcontents, "logcontents don't match");
}
示例5: ExceptionLogging
public void ExceptionLogging()
{
ConsoleLogger log = new ConsoleLogger("Logger", LoggerLevel.Debug);
log.Debug("Some debug message", new ApplicationException("Some exception message"));
String logcontents = outWriter.GetStringBuilder().ToString();
StringWriter expected = new StringWriter();
expected.WriteLine("[Debug] 'Logger' Some debug message");
expected.WriteLine("[Debug] 'Logger' System.ApplicationException: Some exception message ");
Assert.AreEqual(expected.GetStringBuilder().ToString(), logcontents, "logcontents don't match");
}