/// <summary> /// 重写 WriteLogMessage 方法将日志写入文本文件 /// </summary> /// <param name="entry">日志条目对象</param> /// <param name="lines">要写入的文本行</param> protected override void WriteLogMessage( LogEntry entry, string[] lines ) { var path = GetFilepath( entry ); var build = new StringBuilder(); foreach ( var l in lines ) { build.Append( l ); build.Append( Environment.NewLine ); } TextLogFileManager.WriteText( path, build.ToString(), Encoding, entry.LogType().Serverity >= LogType.Error.Serverity ); }
/// <summary> /// 重写 WriteLogMessage 方法将日志写入文本文件 /// </summary> /// <param name="entry">日志条目对象</param> /// <param name="lines">要写入的文本行</param> protected override void WriteLogMessage(LogEntry entry, string[] lines) { var path = GetFilepath(entry); var build = new StringBuilder(); foreach (var l in lines) { build.Append(l); build.Append(Environment.NewLine); } TextLogFileManager.WriteText(path, build.ToString(), Encoding, entry.LogType().Serverity >= LogType.Error.Serverity); }
/// <summary> /// 获取日志消息的填充,将会自动添加在日志消息的每一行的开头 /// </summary> /// <param name="entry">当前要记录的日志</param> /// <returns>当前日志消息的填充</returns> protected virtual string GetPadding(LogEntry entry) { return(GetTypePrefix(entry.LogType()) + " " + GetDateTime(entry).ToString(DateTimeFormatString) + " "); }
public override bool Writable( LogEntry entry ) { var serverity = entry.LogType().Serverity; return serverity >= MinServerity && serverity < MaxServerity; }
public override bool Writable( LogEntry entry ) { return LogType.Equals( entry.LogType() ); }
public override bool Writable(LogEntry entry) { return(LogType.Equals(entry.LogType())); }
public override bool Writable(LogEntry entry) { var serverity = entry.LogType().Serverity; return(serverity >= MinServerity && serverity < MaxServerity); }
/// <summary> /// 获取日志消息的填充,将会自动添加在日志消息的每一行的开头 /// </summary> /// <param name="entry">当前要记录的日志</param> /// <returns>当前日志消息的填充</returns> protected virtual string GetPadding( LogEntry entry ) { return GetTypePrefix( entry.LogType() ) + " " + GetDateTime( entry ).ToString( DateTimeFormatString ) + " "; }