C# 클래스 Duality.Log

Listens for log entries and writes them to registered ILogOutputs.
파일 보기 프로젝트 열기: BraveSirAndrew/duality 1 사용 예제들

공개 메소드들

메소드 설명
AddOutput ( ILogOutput writer ) : void

Adds an output to write log entries to.

Assembly ( Assembly asm ) : string

Returns a string that can be used for representing a System.Reflection.Assembly in log entries.

ConstructorInfo ( ConstructorInfo info, bool includeDeclaringType = true ) : string

Returns a string that can be used for representing a constructor in log entries.

CurrentMethod ( int skipFrames, bool includeDeclaringType = true ) : string

Returns the name of the caller method.

CurrentStackFrame ( int skipFrames ) : System.Diagnostics.StackFrame

Retrieves the current stack frame.

CurrentType ( int skipFrames ) : string

Returns the name of the caller methods declaring type.

EventInfo ( EventInfo info, bool includeDeclaringType = true ) : string

Returns a string that can be used for representing an event in log entries.

Exception ( Exception e, bool callStack = true ) : string

Returns a string that can be used for representing an exception in log entries. It usually does not include the full call stack and is significantly shorter than an Exceptions ToString method.

FieldInfo ( FieldInfo info, bool includeDeclaringType = true ) : string

Returns a string that can be used for representing a field in log entries.

Log ( string name ) : System

Creates a new Log.

Log ( string name, SharedState stateHolder ) : System

Creates a new Log.

MemberInfo ( MemberInfo info, bool includeDeclaringType = true ) : string

Returns a string that can be used for representing a(ny) member in log entries.

MethodInfo ( MethodBase info, bool includeDeclaringType = true ) : string

Returns a string that can be used for representing a method or constructor in log entries.

MethodInfo ( MethodInfo info, bool includeDeclaringType = true ) : string

Returns a string that can be used for representing a method in log entries.

PopIndent ( ) : void

Decreases the current log entry indent.

PropertyInfo ( PropertyInfo info, bool includeDeclaringType = true ) : string

Returns a string that can be used for representing a property in log entries.

PushIndent ( ) : void

Increases the current log entry indent.

RemoveOutput ( ILogOutput writer ) : void

Removes a certain output.

Type ( Type type ) : string

Returns a string that can be used for representing a System.Type in log entries.

Write ( string format ) : void

Writes a new log entry.

WriteError ( string format ) : void

Writes a new error log entry.

WriteWarning ( string format ) : void

Writes a new warning log entry.

비공개 메소드들

메소드 설명
FindContext ( object obj ) : object
FormatMessage ( string format, object obj ) : string
Log ( ) : System
Write ( LogMessageType type, string format, object context ) : void

메소드 상세

AddOutput() 공개 메소드

Adds an output to write log entries to.
public AddOutput ( ILogOutput writer ) : void
writer ILogOutput
리턴 void

Assembly() 공개 정적인 메소드

Returns a string that can be used for representing a System.Reflection.Assembly in log entries.
public static Assembly ( Assembly asm ) : string
asm System.Reflection.Assembly
리턴 string

ConstructorInfo() 공개 정적인 메소드

Returns a string that can be used for representing a constructor in log entries.
public static ConstructorInfo ( ConstructorInfo info, bool includeDeclaringType = true ) : string
info System.Reflection.ConstructorInfo
includeDeclaringType bool If true, the constructors declaring type is included in the returned name.
리턴 string

CurrentMethod() 공개 정적인 메소드

Returns the name of the caller method.
public static CurrentMethod ( int skipFrames, bool includeDeclaringType = true ) : string
skipFrames int The number of frames to skip. This function itsself is omitted by default.
includeDeclaringType bool If true, the methods declaring type is included in the returned name.
리턴 string

CurrentStackFrame() 공개 정적인 메소드

Retrieves the current stack frame.
public static CurrentStackFrame ( int skipFrames ) : System.Diagnostics.StackFrame
skipFrames int The number of frames to skip. This function itsself is omitted by default.
리턴 System.Diagnostics.StackFrame

CurrentType() 공개 정적인 메소드

Returns the name of the caller methods declaring type.
public static CurrentType ( int skipFrames ) : string
skipFrames int The number of frames to skip. This function itsself is omitted by default.
리턴 string

EventInfo() 공개 정적인 메소드

Returns a string that can be used for representing an event in log entries.
public static EventInfo ( EventInfo info, bool includeDeclaringType = true ) : string
info System.Reflection.EventInfo
includeDeclaringType bool If true, the events declaring type is included in the returned name.
리턴 string

Exception() 공개 정적인 메소드

Returns a string that can be used for representing an exception in log entries. It usually does not include the full call stack and is significantly shorter than an Exceptions ToString method.
public static Exception ( Exception e, bool callStack = true ) : string
e System.Exception
callStack bool
리턴 string

FieldInfo() 공개 정적인 메소드

Returns a string that can be used for representing a field in log entries.
public static FieldInfo ( FieldInfo info, bool includeDeclaringType = true ) : string
info System.Reflection.FieldInfo
includeDeclaringType bool If true, the fields declaring type is included in the returned name.
리턴 string

Log() 공개 메소드

Creates a new Log.
public Log ( string name ) : System
name string The Logs name
리턴 System

Log() 공개 메소드

Creates a new Log.
public Log ( string name, SharedState stateHolder ) : System
name string The Logs name.
stateHolder SharedState The Logs state value holder that may be shared with other Logs.
리턴 System

MemberInfo() 공개 정적인 메소드

Returns a string that can be used for representing a(ny) member in log entries.
public static MemberInfo ( MemberInfo info, bool includeDeclaringType = true ) : string
info System.Reflection.MemberInfo
includeDeclaringType bool If true, the members declaring type is included in the returned name.
리턴 string

MethodInfo() 공개 정적인 메소드

Returns a string that can be used for representing a method or constructor in log entries.
public static MethodInfo ( MethodBase info, bool includeDeclaringType = true ) : string
info System.Reflection.MethodBase
includeDeclaringType bool If true, the methods or constructors declaring type is included in the returned name.
리턴 string

MethodInfo() 공개 정적인 메소드

Returns a string that can be used for representing a method in log entries.
public static MethodInfo ( MethodInfo info, bool includeDeclaringType = true ) : string
info System.Reflection.MethodInfo
includeDeclaringType bool If true, the methods declaring type is included in the returned name.
리턴 string

PopIndent() 공개 메소드

Decreases the current log entry indent.
public PopIndent ( ) : void
리턴 void

PropertyInfo() 공개 정적인 메소드

Returns a string that can be used for representing a property in log entries.
public static PropertyInfo ( PropertyInfo info, bool includeDeclaringType = true ) : string
info System.Reflection.PropertyInfo
includeDeclaringType bool If true, the properties declaring type is included in the returned name.
리턴 string

PushIndent() 공개 메소드

Increases the current log entry indent.
public PushIndent ( ) : void
리턴 void

RemoveOutput() 공개 메소드

Removes a certain output.
public RemoveOutput ( ILogOutput writer ) : void
writer ILogOutput
리턴 void

Type() 공개 정적인 메소드

Returns a string that can be used for representing a System.Type in log entries.
public static Type ( Type type ) : string
type System.Type
리턴 string

Write() 공개 메소드

Writes a new log entry.
public Write ( string format ) : void
format string
리턴 void

WriteError() 공개 메소드

Writes a new error log entry.
public WriteError ( string format ) : void
format string
리턴 void

WriteWarning() 공개 메소드

Writes a new warning log entry.
public WriteWarning ( string format ) : void
format string
리턴 void