Show / Hide Table of Contents

Class LoggerExtensions

Extensions class containing methods to log the results of extension methods

Inheritance
object
LoggerExtensions
Inherited Members
object.Equals(object)
object.Equals(object, object)
object.GetHashCode()
object.GetType()
object.MemberwiseClone()
object.ReferenceEquals(object, object)
object.ToString()
Namespace: Cognite.Extensions
Assembly: Cognite.Extensions.dll
Syntax
public static class LoggerExtensions

Methods

| Edit this page View Source

LogCogniteError<TError>(ILogger, CogniteError<TError>, RequestType, bool, LogLevel, LogLevel)

Log a description of the error, with how the values that caused it as well as the number of objects that were affected by it.

Declaration
public static void LogCogniteError<TError>(this ILogger logger, CogniteError<TError> error, RequestType requestType, bool ignoreExisting, LogLevel handledLevel = LogLevel.Debug, LogLevel fatalLevel = LogLevel.Error)
Parameters
Type Name Description
ILogger logger

Logger to log the error to

CogniteError<TError> error

Error to log

RequestType requestType

Request that caused the error

bool ignoreExisting

True to not log errors caused by items already present in CDF

LogLevel handledLevel

Log level of errors that were handled by the utils

LogLevel fatalLevel

Log level of errors that could not be handled and caused the request to fail

Type Parameters
Name Description
TError
| Edit this page View Source

LogResult<TError>(ILogger, CogniteResult<TError>, RequestType, bool, LogLevel, LogLevel, LogLevel)

Log the CogniteResult object and all its errors.

Declaration
public static void LogResult<TError>(this ILogger logger, CogniteResult<TError> result, RequestType requestType, bool ignoreExisting, LogLevel infoLevel = LogLevel.Information, LogLevel handledErrorLevel = LogLevel.Debug, LogLevel fatalLevel = LogLevel.Error)
Parameters
Type Name Description
ILogger logger

Logger to write to

CogniteResult<TError> result

Result to log

RequestType requestType

Request type

bool ignoreExisting

True to not log errors caused by items already present in CDF

LogLevel infoLevel

Level for summary information about the request

LogLevel handledErrorLevel

Log level of errors that were handled by the utils

LogLevel fatalLevel

Log level of errors that could not be handled and caused the request to fail

Type Parameters
Name Description
TError

Type of reported error

| Edit this page View Source

LogResult<TResult, TError>(ILogger, CogniteResult<TResult, TError>, RequestType, bool, LogLevel, LogLevel, LogLevel)

Log the CogniteResult object and all its errors.

Declaration
public static void LogResult<TResult, TError>(this ILogger logger, CogniteResult<TResult, TError> result, RequestType requestType, bool ignoreExisting, LogLevel infoLevel = LogLevel.Information, LogLevel handledErrorLevel = LogLevel.Debug, LogLevel fatalLevel = LogLevel.Error)
Parameters
Type Name Description
ILogger logger

Logger to write to

CogniteResult<TResult, TError> result

Result to log

RequestType requestType

Request type

bool ignoreExisting

True to not log errors caused by items already present in CDF

LogLevel infoLevel

Level for summary information about the request

LogLevel handledErrorLevel

Log level of errors that were handled by the utils

LogLevel fatalLevel

Log level of errors that could not be handled and caused the request to fail

Type Parameters
Name Description
TResult

Type of result

TError

Type of reported error

  • Edit this page
  • View Source
In this article
Back to top Generated by DocFX