C# Class GSF.Diagnostics.Logger

Manages the collection and reporting of logging information in a system.
Afficher le fichier Open project: GridProtectionAlliance/gsf

Private Properties

Свойство Type Description
CurrentDomain_FirstChanceException void
CurrentDomain_UnhandledException void
DisposeStackMessage void
DisposeSuppressionFlags void
GrowStackDisposal void
Initialize void
Logger System
Shutdown void

Méthodes publiques

Méthode Description
AppendStackMessages ( LogStackMessages messages ) : IDisposable

Temporarily appends data to the thread's stack so the data can be propagated to any messages generated on this thread. Be sure to call Dispose on the returned object to remove this from the stack.

AppendStackMessages ( string key, string value ) : IDisposable

Temporarily appends data to the thread's stack so the data can be propagated to any messages generated on this thread. Be sure to call Dispose on the returned object to remove this from the stack.

CreatePublisher ( Type type, MessageClass classification ) : LogPublisher

Looks up the type of the log source

CreateSubscriber ( VerboseLevel level = VerboseLevel.None ) : LogSubscriber

Creates a LogSubscriber

GetStackMessages ( ) : LogStackMessages

Searches the current stack frame for all related messages that will be published with this message.

OverrideSuppressLogMessages ( ) : IDisposable

Sets a flag that will allow log messages to be raised again. Remember to dispose of the callback to remove this override.

SuppressFirstChanceExceptionLogMessages ( ) : IDisposable

Sets a flag that will prevent First Chance Exception log messages from being raised on this thread. Remember to dispose of the callback to remove this suppression.

SuppressLogMessages ( ) : IDisposable

Sets a flag that will prevent log messages from being raised on this thread. Remember to dispose of the callback to remove this suppression.

SwallowException ( Exception ex, string message = null, string details = null, MessageFlags additionalFlags = MessageFlags.None ) : void

Logs that a first chance exception was intentionally not handled for the provided reason. In the LogFileViewer it will filter messages differently if it was indicated that they were swallowed.

Private Methods

Méthode Description
CurrentDomain_FirstChanceException ( object sender, System e ) : void
CurrentDomain_UnhandledException ( object sender, UnhandledExceptionEventArgs e ) : void
DisposeStackMessage ( int depth ) : void
DisposeSuppressionFlags ( int depth ) : void
GrowStackDisposal ( int desiredSize ) : void
Initialize ( ) : void

Ensures that the logger has been initialized.

Logger ( ) : System
Shutdown ( ) : void

Ensures that the logger is properly shutdown. This is called from ShutdownHandler.

Method Details

AppendStackMessages() public static méthode

Temporarily appends data to the thread's stack so the data can be propagated to any messages generated on this thread. Be sure to call Dispose on the returned object to remove this from the stack.
public static AppendStackMessages ( LogStackMessages messages ) : IDisposable
messages LogStackMessages
Résultat IDisposable

AppendStackMessages() public static méthode

Temporarily appends data to the thread's stack so the data can be propagated to any messages generated on this thread. Be sure to call Dispose on the returned object to remove this from the stack.
public static AppendStackMessages ( string key, string value ) : IDisposable
key string
value string
Résultat IDisposable

CreatePublisher() public static méthode

Looks up the type of the log source
public static CreatePublisher ( Type type, MessageClass classification ) : LogPublisher
type System.Type the type
classification MessageClass the classification of the type of messages that this publisher will raise.
Résultat LogPublisher

CreateSubscriber() public static méthode

Creates a LogSubscriber
public static CreateSubscriber ( VerboseLevel level = VerboseLevel.None ) : LogSubscriber
level VerboseLevel
Résultat LogSubscriber

GetStackMessages() public static méthode

Searches the current stack frame for all related messages that will be published with this message.
public static GetStackMessages ( ) : LogStackMessages
Résultat LogStackMessages

OverrideSuppressLogMessages() public static méthode

Sets a flag that will allow log messages to be raised again. Remember to dispose of the callback to remove this override.
public static OverrideSuppressLogMessages ( ) : IDisposable
Résultat IDisposable

SuppressFirstChanceExceptionLogMessages() public static méthode

Sets a flag that will prevent First Chance Exception log messages from being raised on this thread. Remember to dispose of the callback to remove this suppression.
public static SuppressFirstChanceExceptionLogMessages ( ) : IDisposable
Résultat IDisposable

SuppressLogMessages() public static méthode

Sets a flag that will prevent log messages from being raised on this thread. Remember to dispose of the callback to remove this suppression.
public static SuppressLogMessages ( ) : IDisposable
Résultat IDisposable

SwallowException() public static méthode

Logs that a first chance exception was intentionally not handled for the provided reason. In the LogFileViewer it will filter messages differently if it was indicated that they were swallowed.
public static SwallowException ( Exception ex, string message = null, string details = null, MessageFlags additionalFlags = MessageFlags.None ) : void
ex System.Exception the exception that was swallowed
message string message to include, such as a reason why it was swallowed.
details string additional details.
additionalFlags MessageFlags additional flags that can be set with this swallowed exception.
Résultat void