Interface IContextExceptionLogger
A generic exception logger for IContextWrappers.
Inherited Members
System.IDisposable.Dispose()
Namespace: Google.Cloud.Diagnostics.Common
Assembly: Google.Cloud.Diagnostics.Common.dll
Syntax
public interface IContextExceptionLogger : IDisposable
Methods
Log(Exception, IContextWrapper)
Logs an exception that occurred.
Declaration
void Log(Exception exception, IContextWrapper context)
Parameters
| Type | Name | Description |
|---|---|---|
| System.Exception | exception | The exception to log. Must not be null. |
| IContextWrapper | context | The current context. Must not be null. |
LogAsync(Exception, IContextWrapper, CancellationToken)
Asynchronously logs an exception that occurred.
Declaration
Task LogAsync(Exception exception, IContextWrapper context, CancellationToken cancellationToken = default(CancellationToken))
Parameters
| Type | Name | Description |
|---|---|---|
| System.Exception | exception | The exception to log. Must not be null. |
| IContextWrapper | context | The current context. Must not be null. |
| System.Threading.CancellationToken | cancellationToken | Optional, The token to monitor for cancellation requests. |
Returns
| Type | Description |
|---|---|
| System.Threading.Tasks.Task | A task representing the asynchronous operation. |