- 10 Apr 2025
- 1 Minute to read
- Print
- DarkLight
- PDF
Log File Setting
- Updated on 10 Apr 2025
- 1 Minute to read
- Print
- DarkLight
- PDF
Introduction
These functions are responsible for setting the log from a camera.
HelloVizionSDK
Function:
void HelloVizionSDK()
def 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}
pyvizionsdk.HelloVizionSDK()
# Hello VizionSDK!
# Version: {VizionSDK Version}
VxSetLogFile
Function:
int VxSetLogFile(const std::string& folderPath)
def VxSetLogFile(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 0 = PASS, return -1 = FAIL.
Example:
const std::string folderPath;
// set the destination path of log file
VxSetLogFile(folderPath);
folderPath = "/saveFolder"
# set the destination path of log file
pyvizionsdk.VxSetLogFile(folderPath)
VxSetLogLevel
Function:
void VxSetLogLevel(VX_LOG_LEVEL level);
def VxSetLogLevel(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.
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,
};
# Ordered from Low to High
class VX_LOG_LEVEL(Enum):
VX_LOG_LEVEL_TRACE = 0
VX_LOG_LEVEL_DEBUG = 1
VX_LOG_LEVEL_INFO = 2
VX_LOG_LEVEL_WARN = 3
VX_LOG_LEVEL_ERROR = 4
VX_LOG_LEVEL_CRITICAL = 5
VX_LOG_LEVEL_OFF = 6
Example:
// Set the log level to information level
VxSetLogLevel(VX_LOG_LEVEL::VX_LOG_LEVEL_INFO);
from pyvizionsdk import VX_LOG_LEVEL
# Set the log level to information level
pyvinzionsdk.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.