C# Класс GSF.Diagnostics.Logger

Manages the collection and reporting of logging information in a system.
Показать файл Открыть проект

Private Properties

Свойство Тип Описание
CurrentDomain_FirstChanceException void
CurrentDomain_UnhandledException void
DisposeStackMessage void
DisposeSuppressionFlags void
GrowStackDisposal void
Initialize void
Logger System
Shutdown void

Открытые методы

Метод Описание
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.

Приватные методы

Метод Описание
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.

Описание методов

AppendStackMessages() публичный статический Метод

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
Результат IDisposable

AppendStackMessages() публичный статический Метод

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
Результат IDisposable

CreatePublisher() публичный статический Метод

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.
Результат LogPublisher

CreateSubscriber() публичный статический Метод

Creates a LogSubscriber
public static CreateSubscriber ( VerboseLevel level = VerboseLevel.None ) : LogSubscriber
level VerboseLevel
Результат LogSubscriber

GetStackMessages() публичный статический Метод

Searches the current stack frame for all related messages that will be published with this message.
public static GetStackMessages ( ) : LogStackMessages
Результат LogStackMessages

OverrideSuppressLogMessages() публичный статический Метод

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
Результат IDisposable

SuppressFirstChanceExceptionLogMessages() публичный статический Метод

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
Результат IDisposable

SuppressLogMessages() публичный статический Метод

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
Результат IDisposable

SwallowException() публичный статический Метод

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.
Результат void