C# Class Ivony.Logs.TextLogFileManager

提供文本日志文件创建、编写等服务的类
Afficher le fichier Open project: Ivony/LogUtility Class Usage Examples

Méthodes publiques

Méthode Description
Flush ( ) : void

刷新所有日志文本流,确保所有修改已经写入。

Flush ( string filepath ) : void

刷新指定日志文本流,确保所有修改已经写入。

WriteText ( string filepath, string content, Encoding encoding, bool flush = false ) : void

对指定的文本日志文件写入一段文本

Private Methods

Méthode Description
GetWriter ( string filepath, Encoding encoding ) : TextFileWriter
WriteText ( TextFileWriter stream, string content, Encoding encoding, bool flush ) : void

Method Details

Flush() public static méthode

刷新所有日志文本流,确保所有修改已经写入。
public static Flush ( ) : void
Résultat void

Flush() public static méthode

刷新指定日志文本流,确保所有修改已经写入。
public static Flush ( string filepath ) : void
filepath string
Résultat void

WriteText() public static méthode

对指定的文本日志文件写入一段文本
public static WriteText ( string filepath, string content, Encoding encoding, bool flush = false ) : void
filepath string 日志文件路径
content string 文本内容
encoding System.Text.Encoding 文本编码
flush bool 在写入后是否立即刷新日志流
Résultat void