本文整理汇总了C#中ReportLevel类的典型用法代码示例。如果您正苦于以下问题:C# ReportLevel类的具体用法?C# ReportLevel怎么用?C# ReportLevel使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
ReportLevel类属于命名空间,在下文中一共展示了ReportLevel类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: Log
private void Log(ReportLevel level, string msg, params object[] args)
{
foreach (var appender in Appenders)
{
appender.AppendThresholdCheck(level, msg, args);
}
}
示例2: LogHandler
private void LogHandler(string msg, ReportLevel reportLevel)
{
foreach (var appender in this.Appenders)
{
appender.Append(DateTime.Now, reportLevel, msg);
}
}
示例3: AppendToAll
private void AppendToAll(string msg, ReportLevel reportLevel)
{
foreach (var appender in this.appenders)
{
appender.Append(msg, reportLevel, DateTime.Now);
}
}
示例4: Append
public override void Append(DateTime date, ReportLevel level, string messege)
{
if (this.ReportLevel <= level)
{
Console.WriteLine(this.Layout.Format(date, level, messege));
}
}
示例5: LogMessage
private void LogMessage(ReportLevel level, string message)
{
foreach (var appender in this.Appenders)
{
appender.Append(message, level, DateTime.Now);
}
}
示例6: Format
public string Format(string msg, ReportLevel reportLevel)
{
DateTime time = DateTime.Now;
string output = $"{time} - {reportLevel} - {msg}";
return output;
}
示例7: OutputMessage
public void OutputMessage(string message, ReportLevel reportLevel)
{
if (reportLevel >= this.ReportThreshold)
{
Console.WriteLine(this.layoutFormat.LayoutFormat(message, reportLevel));
}
}
示例8: Log
private void Log(ReportLevel reportLevel, string message, string logType)
{
foreach (var appender in this.Appenders.Where(appender => reportLevel >= appender.ReportLevel))
{
appender.Append(message, logType);
}
}
示例9: Append
public void Append(DateTime date, ReportLevel reportLevel, string message)
{
if (this.ReportLevel <= reportLevel)
{
this.AppendExecuter(date, reportLevel, message);
}
}
示例10: Append
public override void Append(ReportLevel level, string msg, params object[] args)
{
using (var sr = new StreamWriter(file, true))
{
sr.WriteLine(this.Layout.Convert(level, msg, args));
}
}
示例11: Append
public override void Append(string message, ReportLevel level, DateTime date)
{
var result = this.Layout.FormatLog(message, level, date);
this.writer.WriteLine(result);
this.writer.Flush();
}
示例12: Append
public override void Append(string msg, ReportLevel level, DateTime date)
{
var output = this.Formatter.Format(msg, level, date);
this.writer.WriteLine(output);
this.writer.Flush();
}
示例13: FormatLogString
public override string FormatLogString(ReportLevel reportLevel, string logMessage)
{
string logString = string.Format("{0} - {1} - {2}",
DateTime.Now, this.ReportLevelAsString(reportLevel), logMessage);
return logString;
}
示例14: FormatLog
public string FormatLog(DateTime date, ReportLevel reportLevel, string message)
{
string formattedLog = string.Format(
LogSimpleFormat + Environment.NewLine, date, reportLevel, message);
return formattedLog;
}
示例15: ReportLevelAsString
protected string ReportLevelAsString(ReportLevel reportLevel)
{
switch (reportLevel)
{
case ReportLevel.Info:
{
return "Info";
}
case ReportLevel.Warn:
{
return "Warning";
}
case ReportLevel.Error:
{
return "Error";
}
case ReportLevel.Critical:
{
return "Critical";
}
case ReportLevel.Fatal:
{
return "Fatal";
}
default:
{
throw new ArgumentOutOfRangeException("Unrecognised Report Level");
}
}
}