本文整理汇总了C#中ReportLevel.ToString方法的典型用法代码示例。如果您正苦于以下问题:C# ReportLevel.ToString方法的具体用法?C# ReportLevel.ToString怎么用?C# ReportLevel.ToString使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类ReportLevel
的用法示例。
在下文中一共展示了ReportLevel.ToString方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: AppendWithAllAppenders
private void AppendWithAllAppenders(string message, ReportLevel reportLevel)
{
string reportLevelString = reportLevel.ToString();
foreach (var appender in Appenders)
{
appender.Append(reportLevelString, message);
}
}
示例2: Layout
public string Layout(ReportLevel reportLevel, string message)
{
this.stringBuilder.AppendLine("<log>");
this.stringBuilder.Append("\t<date>");
this.stringBuilder.Append(string.Format("{0}", DateTime.Now));
this.stringBuilder.AppendLine("</date>");
this.stringBuilder.Append("\t<level>");
this.stringBuilder.Append(string.Format("{0}", reportLevel.ToString()));
this.stringBuilder.AppendLine("</level>");
this.stringBuilder.Append("\t<message>");
this.stringBuilder.Append(string.Format("{0}", message));
this.stringBuilder.AppendLine("</message>");
this.stringBuilder.AppendLine("</log>");
return this.stringBuilder.ToString();
}
示例3: ReportLevelToString
/// <summary>
/// Provides a (valid) string representation of the provided ReportLevel.
/// </summary>
/// <param name="value">The value to serialize to string.</param>
/// <returns>A (valid) string representation of the provided ReportLevel.</returns>
private static string ReportLevelToString(ReportLevel value)
{
return LevelToString(value.ToString());
}
示例4: Layout
public string Layout(ReportLevel reportLevel, string message)
{
return string.Format("{0} - {1} - {2}", DateTime.Now, reportLevel.ToString(), message);
}