C# 클래스 Catel.Logging.LogManager

Log manager that allows external libraries to subscribe to logging of Catel. The manager automatically adds an instance of the DebugLogListener to the list of listeners so the tracing is available in debug mode. To remove this listener, call ClearListeners before doing any initialization.
파일 보기 프로젝트 열기: Catel/Catel

공개 메소드들

메소드 설명
AddDebugListener ( bool ignoreCatelLogging = false ) : ILogListener

Registers the default debug listener. Starting with Catel 2.4, the debug listener is no longer attached for performance reasons. To register the debug listener, call this method. When an instance of the DebugLogListener is already registered, the existing instance is returned.

AddListener ( ILogListener listener ) : void

Adds a log listener which will receive all log events. This method does not check whether the listener is already added to the list of registered listeners.

ClearListeners ( ) : void

Clears all the current listeners.

FlushAll ( ) : void

Flushes all listeners that implement the IBatchLogListener by calling IBatchLogListener.Flush.

GetListeners ( ) : IEnumerable

Gets all the currently registered log listeners.

GetLogger ( Type type ) : ILog

Gets the logger for the specified type.

IsListenerRegistered ( ILogListener listener ) : bool

Determines whether the specified listener is already registered or not.

LoadListenersFromConfiguration ( Configuration configuration, Assembly assembly = null ) : void

Loads the listeners from the specified configuration.

LoadListenersFromConfigurationFile ( string configurationFilePath, Assembly assembly = null ) : void

Loads the listeners from the specified configuration file.

RemoveListener ( ILogListener listener ) : void

Removes the a log listener which will stop receiving all log events.

비공개 메소드들

메소드 설명
FlushAllAsync ( ) : System.Threading.Tasks.Task
GetCurrentClassLogger ( ) : ILog
GetThreadSafeLogListeners ( ) : List

Gets the current log listeners in a thread-safe manner.

IsListenerInterested ( ILogListener listener, LogEvent logEvent ) : bool

Determines whether the specified listener is interested in the log event.

LogManager ( ) : System

Initializes static members of the LogManager class.

OnLogMessage ( object sender, LogMessageEventArgs e ) : void

Called when one of the logs has written a log message.

메소드 상세

AddDebugListener() 공개 정적인 메소드

Registers the default debug listener. Starting with Catel 2.4, the debug listener is no longer attached for performance reasons. To register the debug listener, call this method. When an instance of the DebugLogListener is already registered, the existing instance is returned.
public static AddDebugListener ( bool ignoreCatelLogging = false ) : ILogListener
ignoreCatelLogging bool
리턴 ILogListener

AddListener() 공개 정적인 메소드

Adds a log listener which will receive all log events. This method does not check whether the listener is already added to the list of registered listeners.
The is null.
public static AddListener ( ILogListener listener ) : void
listener ILogListener The listener.
리턴 void

ClearListeners() 공개 정적인 메소드

Clears all the current listeners.
public static ClearListeners ( ) : void
리턴 void

FlushAll() 공개 정적인 메소드

Flushes all listeners that implement the IBatchLogListener by calling IBatchLogListener.Flush.
public static FlushAll ( ) : void
리턴 void

GetListeners() 공개 정적인 메소드

Gets all the currently registered log listeners.
public static GetListeners ( ) : IEnumerable
리턴 IEnumerable

GetLogger() 공개 정적인 메소드

Gets the logger for the specified type.
The is null.
public static GetLogger ( Type type ) : ILog
type System.Type The type.
리턴 ILog

IsListenerRegistered() 공개 정적인 메소드

Determines whether the specified listener is already registered or not.
The is null.
public static IsListenerRegistered ( ILogListener listener ) : bool
listener ILogListener The listener.
리턴 bool

LoadListenersFromConfiguration() 공개 정적인 메소드

Loads the listeners from the specified configuration.
public static LoadListenersFromConfiguration ( Configuration configuration, Assembly assembly = null ) : void
configuration System.Configuration.Configuration The configuration.
assembly System.Reflection.Assembly The assembly to determine product info. If null, the entry assembly will be used.
리턴 void

LoadListenersFromConfigurationFile() 공개 정적인 메소드

Loads the listeners from the specified configuration file.
public static LoadListenersFromConfigurationFile ( string configurationFilePath, Assembly assembly = null ) : void
configurationFilePath string The configuration file path.
assembly System.Reflection.Assembly The assembly to determine product info. If null, the entry assembly will be used.
리턴 void

RemoveListener() 공개 정적인 메소드

Removes the a log listener which will stop receiving all log events.
The is null.
public static RemoveListener ( ILogListener listener ) : void
listener ILogListener The listener.
리턴 void