C# Class Ivony.Logs.TextLogger

文本日志记录器基类,将日志信息以文本形式记录的所有记录器的基类
Inheritance: Logger
Afficher le fichier Open project: Ivony/LogUtility

Méthodes publiques

Méthode Description
LogEntry ( LogEntry entry ) : void

写入一条日志信息

Méthodes protégées

Méthode Description
GetDateTime ( LogEntry entry ) : System.DateTime

获取转换时区后的日志记录时间

GetPadding ( LogEntry entry ) : string

获取日志消息的填充,将会自动添加在日志消息的每一行的开头

GetTypePrefix ( LogType type ) : string

获取日志消息的类型前缀,将会自动添加在每一行消息以标识这个消息的类型

ReleaseWriter ( TextWriter writer ) : void

释放文本编写器

SplitMultiLine ( string message ) : string[]

将多行消息按照换行符拆分成多个字符串

TextLogger ( LogFilter filter = null, TimeZoneInfo timezone = null ) : System

创建 TextLogger 对象

Write ( LogEntry entry, string padding, string message ) : void

使用指定的前缀写入多行日志

WriteLogMessage ( LogEntry entry, string contents ) : void

派生类实现此方法写入日志

Method Details

GetDateTime() protected méthode

获取转换时区后的日志记录时间
protected GetDateTime ( LogEntry entry ) : System.DateTime
entry LogEntry 日志条目
Résultat System.DateTime

GetPadding() protected méthode

获取日志消息的填充,将会自动添加在日志消息的每一行的开头
protected GetPadding ( LogEntry entry ) : string
entry LogEntry 当前要记录的日志
Résultat string

GetTypePrefix() protected méthode

获取日志消息的类型前缀,将会自动添加在每一行消息以标识这个消息的类型
protected GetTypePrefix ( LogType type ) : string
type LogType 当前要记录的日志
Résultat string

LogEntry() public méthode

写入一条日志信息
public LogEntry ( LogEntry entry ) : void
entry LogEntry
Résultat void

ReleaseWriter() protected méthode

释放文本编写器
protected ReleaseWriter ( TextWriter writer ) : void
writer System.IO.TextWriter
Résultat void

SplitMultiLine() protected méthode

将多行消息按照换行符拆分成多个字符串
protected SplitMultiLine ( string message ) : string[]
message string 多行消息
Résultat string[]

TextLogger() protected méthode

创建 TextLogger 对象
protected TextLogger ( LogFilter filter = null, TimeZoneInfo timezone = null ) : System
filter LogFilter 日志筛选器
timezone System.TimeZoneInfo 时区信息(默认为UTC-0)
Résultat System

Write() protected méthode

使用指定的前缀写入多行日志
protected Write ( LogEntry entry, string padding, string message ) : void
entry LogEntry 要写入的日志条目
padding string 填充字符串,将会添加在每一行日志的前面
message string 要写入的日志消息
Résultat void

WriteLogMessage() protected abstract méthode

派生类实现此方法写入日志
protected abstract WriteLogMessage ( LogEntry entry, string contents ) : void
entry LogEntry 要写入的日志条目
contents string 要写入的日志内容
Résultat void