C# 클래스 RTools.Util.Logger

This is a simple implementation of a Logger class. The purpose is to threshold output based on a verbosity setting, format messages similarly, and collect all message writes such that they can be redirected easily. You (and I) should probably use the Apache Software Foundation's log4net instead of this class.
This doesn't implement much of the functionality possible with this interface. This could redirect messages to other text writers, forward messages to subscribers, etc.
파일 보기 프로젝트 열기: PaulMineau/AIMA.Net

보호된 프로퍼티들

프로퍼티 타입 설명
log Logger
name string
verbosity VerbosityLevel

공개 메소드들

메소드 설명
Debug ( string msg ) : void

Write a string of this particular verbosity. This will not output the string unless the verbosity is greater than or equal to this object's threshold. This prepends the level of the message and the name of this Logger.

Error ( string msg ) : void

Write a string of this particular verbosity. This will not output the string unless the verbosity is greater than or equal to this object's threshold. This prepends the level of the message and the name of this Logger.

Info ( string msg ) : void

Write a string of this particular verbosity. This will not output the string unless the verbosity is greater than or equal to this object's threshold. This prepends the level of the message and the name of this Logger.

Logger ( ) : System

Default constructor.

Logger ( string name ) : System

Construct and set name.

TestSelf ( ) : bool

A simple static self test method.

Warn ( string msg ) : void

Write a string of this particular verbosity. This will not output the string unless the verbosity is greater than or equal to this object's threshold. This prepends the level of the message and the name of this Logger.

Write ( string msg ) : void

Write a string with no verbosity checking and no formatting.

WriteLine ( string msg ) : void

Write a line with no verbosity checking and no formatting.

메소드 상세

Debug() 공개 메소드

Write a string of this particular verbosity. This will not output the string unless the verbosity is greater than or equal to this object's threshold. This prepends the level of the message and the name of this Logger.
public Debug ( string msg ) : void
msg string The format string.
리턴 void

Error() 공개 메소드

Write a string of this particular verbosity. This will not output the string unless the verbosity is greater than or equal to this object's threshold. This prepends the level of the message and the name of this Logger.
public Error ( string msg ) : void
msg string The format string.
리턴 void

Info() 공개 메소드

Write a string of this particular verbosity. This will not output the string unless the verbosity is greater than or equal to this object's threshold. This prepends the level of the message and the name of this Logger.
public Info ( string msg ) : void
msg string The format string.
리턴 void

Logger() 공개 메소드

Default constructor.
public Logger ( ) : System
리턴 System

Logger() 공개 메소드

Construct and set name.
public Logger ( string name ) : System
name string The name for this logger. This name /// is prepended to output messages (except Out messages).
리턴 System

TestSelf() 공개 정적인 메소드

A simple static self test method.
public static TestSelf ( ) : bool
리턴 bool

Warn() 공개 메소드

Write a string of this particular verbosity. This will not output the string unless the verbosity is greater than or equal to this object's threshold. This prepends the level of the message and the name of this Logger.
public Warn ( string msg ) : void
msg string The format string.
리턴 void

Write() 공개 메소드

Write a string with no verbosity checking and no formatting.
public Write ( string msg ) : void
msg string The format string.
리턴 void

WriteLine() 공개 메소드

Write a line with no verbosity checking and no formatting.
public WriteLine ( string msg ) : void
msg string The format string.
리턴 void

프로퍼티 상세

log 보호되어 있는 정적으로 프로퍼티

Backer for Log.
protected static Logger log
리턴 Logger

name 보호되어 있는 프로퍼티

The name is prepended to all messages.
protected string name
리턴 string

verbosity 보호되어 있는 프로퍼티

The verbosity of this logger. Messages are filtered based on this setting.
protected VerbosityLevel verbosity
리턴 VerbosityLevel