Skip to main content

Log File Setting

Introduction

These functions are responsible for setting the log from a camera.

HelloVizionSDK

Function:

void HelloVizionSDK()

Function Description:

  • This function is used to get the version of the VizionSDK from the log.

Parameter Description:

  • This function does not take any input parameters.

Example:

HelloVizionSDK();
// Hello VizionSDK!
// Version: {VizionSDK Version}

VxSetLogFile

Function:

int VxSetLogFile(const std::string& folderPath)

Function Description:

  • This function is used to set the destination path where to save the log file.

Parameter Description:

  • folderPath : A string constants of folder path.

  • Return : return 0 = PASS, return -1 = FAIL.

Example:

const std::string folderPath;
// set the destination path of log file
VxSetLogFile(folderPath);

VxSetLogLevel

Function:

void VxSetLogLevel(VX_LOG_LEVEL level);

Function Description:

  • This function is for setting the log level, determining the verbosity of log messages.

Parameter Description:

  • level : The parameter is a VX_LOG_LEVEL variable that represents the level of the log.

    info

    Logging levels follow an order from low to high, meaning that setting a specific level enables logging for that level and all higher severity levels.

  • VX_LOG_LEVEL format:

    // Ordered from Low to High
    enum class VX_LOG_LEVEL {
    VX_LOG_LEVEL_TRACE,
    VX_LOG_LEVEL_DEBUG,
    VX_LOG_LEVEL_INFO,
    VX_LOG_LEVEL_WARN,
    VX_LOG_LEVEL_ERROR,
    VX_LOG_LEVEL_CRITICAL,
    VX_LOG_LEVEL_OFF,
    };

Example:

// Set the log level to information level
VxSetLogLevel(VX_LOG_LEVEL::VX_LOG_LEVEL_INFO);

Explanation of Levels(Ordered from Low to High):

  • VX_LOG_LEVEL_TRACE : Provides the most detailed logging, capturing step-by-step execution flow.
  • VX_LOG_LEVEL_DEBUG : Includes debugging information for developers, offering insights into internal operations and variable states.
  • VX_LOG_LEVEL_INFO (Default) : Logs general operational events, such as initialization, configuration changes, and so on.
  • VX_LOG_LEVEL_WARN : Highlights potential issues that do not immediately impact functionality.
  • VX_LOG_LEVEL_ERROR : Captures critical issues that disrupt specific functionalities but do not cause system-wide failure.
  • VX_LOG_LEVEL_CRITICAL : Logs severe errors that may lead to system or application failure, requiring urgent attention.
  • VX_LOG_LEVEL_OFF : Disables all logging, preventing any messages from being recorded.