Dlib FaceLandmark Detector 2.0.3
Enox Software
Loading...
Searching...
No Matches
DlibFaceLandmarkDetector.Extensions.DlibDebug Class Reference

Dlib Debug utilities. More...

Static Public Member Functions

static bool IsDebugMode ()
 Gets whether debug mode is enabled.
 
static bool IsThrowException ()
 Gets whether Dlib exceptions are thrown.
 
static void SetDebugMode (bool debugMode, bool throwException, Action< string > callback)
 Sets the debug mode with a callback.
 
static void SetDebugMode (bool debugMode, bool throwException=false)
 Sets the debug mode.
 

Detailed Description

Dlib Debug utilities.

Member Function Documentation

◆ IsDebugMode()

static bool DlibFaceLandmarkDetector.Extensions.DlibDebug.IsDebugMode ( )
static

Gets whether debug mode is enabled.

Returns
True if debug mode is enabled, false otherwise.

◆ IsThrowException()

static bool DlibFaceLandmarkDetector.Extensions.DlibDebug.IsThrowException ( )
static

Gets whether Dlib exceptions are thrown.

Returns
True if exceptions are thrown, false otherwise.

◆ SetDebugMode() [1/2]

static void DlibFaceLandmarkDetector.Extensions.DlibDebug.SetDebugMode ( bool debugMode,
bool throwException,
Action< string > callback )
static

Sets the debug mode with a callback.

If debugMode is true, the error log of the Native side Dlib will be displayed via EngineLog. However, if throwException is true, DlibException is thrown instead of calling EngineLog.LogError(object). The callback is maintained even when debug mode is turned off, allowing it to be reused when debug mode is turned on again. To clear the callback, call this method with null as the callback parameter.

Please use as follows.

{
// DlibException handling
// Publish DlibException to EngineLog.LogError.
DlibDebug.SetDebugMode(true, false);
// Code that causes an error.
@iverbatim
// Throw DlibException.
DlibDebug.SetDebugMode(true, true);
try
{
// Code that causes an error.
}
catch (Exception e)
{
EngineLog.Log("DlibException: " + e);
}
// Callback string of DlibException.
DlibDebug.SetDebugMode(true, true, (str) =>
{
EngineLog.Log("DlibException: " + str);
});
try
{
// Code that causes an error.
}
catch (Exception e)
{
EngineLog.Log("DlibException: " + e);
}
DlibDebug.SetDebugMode(false);
@endiverbatim }
Centralizes engine-specific log output.
Definition EngineLog_Integration.cs:9
static void Log(object message)
Writes a log message through the configured logger.
Definition EngineLog.cs:35
Dlib Debug utilities.
Definition DlibDebug.cs:10
static void SetDebugMode(bool debugMode, bool throwException=false)
Sets the debug mode.
Definition DlibDebug.cs:98
Parameters
debugModeIf true, the error log of the Native side Dlib will be displayed via EngineLog.
throwExceptionIf true, DlibException is thrown instead of calling EngineLog.LogError(object).
callbackCallback called when an Dlib error occurs on the Native side. The callback is maintained even when debug mode is turned off. To clear the callback, pass null as this parameter.

◆ SetDebugMode() [2/2]

static void DlibFaceLandmarkDetector.Extensions.DlibDebug.SetDebugMode ( bool debugMode,
bool throwException = false )
static

Sets the debug mode.

If debugMode is true, the error log of the Native side Dlib will be displayed via EngineLog. However, if throwException is true, DlibException is thrown instead of calling EngineLog.LogError(object).

Please use as follows.

{
// DlibException handling
// Publish DlibException to EngineLog.LogError.
DlibDebug.SetDebugMode(true, false);
// Code that causes an error.
@iverbatim
// Throw DlibException.
DlibDebug.SetDebugMode(true, true);
try
{
// Code that causes an error.
}
catch (Exception e)
{
EngineLog.Log("DlibException: " + e);
}
DlibDebug.SetDebugMode(false);
@endiverbatim }
Parameters
debugModeIf true, the error log of the Native side Dlib will be displayed via EngineLog.
throwExceptionIf true, DlibException is thrown instead of calling EngineLog.LogError(object).

The documentation for this class was generated from the following file: