CVB.Net 15.1
Loading...
Searching...
No Matches
Module Class Referencesealed

A telemetry module or artifact. A module represents an instrumented entity that has a dedicated configuration. More...

Inherits INativeHandle.

Public Member Functions

void Dispose (bool disposing)
 IDisposable helper function.
 
void Dispose ()
 IDisposable implementation.
 
 Module (string name, string version)
 Creates a new module.
 
 Module (string name, Version version)
 Creates a new module.
 
Span StartSpan ([CallerMemberName] string name="")
 Creates a new Span object.
 
void Log (LogLevel logLevel, string message)
 Logs a single message.
 
void LogDebug (string message)
 Logs a single message with LogLevel.Debug.
 
void LogInfo (string message)
 Logs a single message with LogLevel.Info.
 
void LogWarning (string message)
 Logs a single message with LogLevel.Warning.
 
void LogError (string message)
 Logs a single message with LogLevel.Error.
 
void LogFatal (string message)
 Logs a single message with LogLevel.Fatal.
 
Log LogExtended (LogLevel logLevel)
 Creates a log object you can manually add messages and attributes to using Log.AddMessage(string) and Log.AddAttribute(string, string).
 
Log LogDebugExtended ()
 Creates a log object with LogLevel.Debug you can manually add messages and attributes to using Log.AddMessage(string) and Log.AddAttribute(string, string).
 
Log LogInfoExtended ()
 Creates a log object with LogLevel.Info you can manually add messages and attributes to using Log.AddMessage(string) and Log.AddAttribute(string, string).
 
Log LogWarningExtended ()
 Creates a log object with LogLevel.Warning you can manually add messages and attributes to using Log.AddMessage(string) and Log.AddAttribute(string, string).
 
Log LogErrorExtended ()
 Creates a log object with LogLevel.Error you can manually add messages and attributes to using Log.AddMessage(string) and Log.AddAttribute(string, string).
 
Log LogFatalExtended ()
 Creates a log object with LogLevel.Fatal you can manually add messages and attributes to using Log.AddMessage(string) and Log.AddAttribute(string, string).
 

Properties

bool WouldTrace [get]
 Returns true if tracing is enabled.
 
bool WouldLog [get]
 Returns true if logging is enabled.
 
LogLevel LogLevel [get]
 The maximum LogLevel that will be logged if WouldLog is true.
 
IntPtr Handle [get]
 Native handle of the Module.
 
bool IsDisposed [get]
 Gets if the native handle has been disposed.
 

Events

NativeHandleEventDelegate ObjectDisposing
 Raised when this object is about to be disposed via the IDisposable.Dispose method.
 
- Events inherited from INativeHandle
NativeHandleEventDelegate ObjectDisposing
 Raised when this object is about to be disposed via the IDisposable.Dispose method.
 

Detailed Description

A telemetry module or artifact. A module represents an instrumented entity that has a dedicated configuration.

Be aware that multiple module instances may conflict within the same process. Users are encouraged to define a singleton instance for their module.

Constructor & Destructor Documentation

◆ Module() [1/2]

Module ( string name,
string version )

Creates a new module.

Parameters
nameName of the module.
versionVersion of the module.

◆ Module() [2/2]

Module ( string name,
Version version )

Creates a new module.

Parameters
nameName of the module.
versionVersion of the module.

Member Function Documentation

◆ Dispose()

void Dispose ( bool disposing)

IDisposable helper function.

Parameters
disposing

◆ Log()

void Log ( LogLevel logLevel,
string message )

Logs a single message.

Parameters
logLevelLogLevel of the message.
messageThe message to log.

◆ LogDebug()

void LogDebug ( string message)

Logs a single message with LogLevel.Debug.

Parameters
messageMessage to log.

◆ LogDebugExtended()

Log LogDebugExtended ( )

Creates a log object with LogLevel.Debug you can manually add messages and attributes to using Log.AddMessage(string) and Log.AddAttribute(string, string).

Returns
Newly created log object.

◆ LogError()

void LogError ( string message)

Logs a single message with LogLevel.Error.

Parameters
messageMessage to log.

◆ LogErrorExtended()

Log LogErrorExtended ( )

Creates a log object with LogLevel.Error you can manually add messages and attributes to using Log.AddMessage(string) and Log.AddAttribute(string, string).

Returns
Newly created log object.

◆ LogExtended()

Log LogExtended ( LogLevel logLevel)

Creates a log object you can manually add messages and attributes to using Log.AddMessage(string) and Log.AddAttribute(string, string).

Parameters
logLevelLogLevel of the log object.
Returns
Newly created log object.

◆ LogFatal()

void LogFatal ( string message)

Logs a single message with LogLevel.Fatal.

Parameters
messageMessage to log.

◆ LogFatalExtended()

Log LogFatalExtended ( )

Creates a log object with LogLevel.Fatal you can manually add messages and attributes to using Log.AddMessage(string) and Log.AddAttribute(string, string).

Returns
Newly created log object.

◆ LogInfo()

void LogInfo ( string message)

Logs a single message with LogLevel.Info.

Parameters
messageMessage to log.

◆ LogInfoExtended()

Log LogInfoExtended ( )

Creates a log object with LogLevel.Info you can manually add messages and attributes to using Log.AddMessage(string) and Log.AddAttribute(string, string).

Returns
Newly created log object.

◆ LogWarning()

void LogWarning ( string message)

Logs a single message with LogLevel.Warning.

Parameters
messageMessage to log.

◆ LogWarningExtended()

Log LogWarningExtended ( )

Creates a log object with LogLevel.Warning you can manually add messages and attributes to using Log.AddMessage(string) and Log.AddAttribute(string, string).

Returns
Newly created log object.

◆ StartSpan()

Span StartSpan ( [CallerMemberName] string name = "")

Creates a new Span object.

Parameters
nameName of the span.
Returns
Newly created span object.

Event Documentation

◆ ObjectDisposing

NativeHandleEventDelegate ObjectDisposing

Raised when this object is about to be disposed via the IDisposable.Dispose method.

This event is raised right before this object is disposed. The dispose itself cannot be canceled.