This application note describes the logging features of the Spinnaker SDK and provides examples of how you can use logging to troubleshoot your application.
There are two types of logging in Spinnaker: File logging and API logging. File logging writes to files all the Spinnaker log messages that are generated. API logging allows you to add custom log messages to your application.
Spinnaker supports five levels of logging:
You can define the logging level that you want to monitor. Levels are inclusive, that is, if you monitor debug level error, you also monitor all logging levels above it.
Spinnaker generates four log files:
|Log File||Description||Configuration File|
|Spinnaker.log||Spinnaker SDK and GenICam||Log4cpp.spinnaker.property|
|spinview.txt||Spinnaker evaluation application SpinView||SpinView_WPF.config|
Spinnaker log files are stored in:
Log files are configured with property files located in:
C:\Program Files\Point Grey Research\Spinnaker\bin64\vs2013\
If you are using a different Visual Studio, adjust the path accordingly to \vs2015\, or \vs2010\.
By default, the logging level is ERROR, except for the SpinView logging pane which defaults to NOTICE.
To change the logging level, edit the configuration file. For example, to change from ERROR to DEBUG:
Note: When writing your own application that requires log files, ensure that the executable or include path contains the Log4cpp.[Node Level].property file.
You can use the Spinnaker API to add custom logging to your application.
1. Define your customized logging function.
class LoggingEventHandler : public LoggingEvent
//This function displays readily available logging information
void OnLogEvent(LoggingEventDataPtr loggingEventDataPtr)
//Insert custom logging function
2. Register your customized logging function.
3. Set your logging priority level.
There is a source code example in Spinnaker.
Logging.cpp shows how to create a handler to access logging events.
The example creates a user-defined class, LoggingEventHandler, that inherits from the Spinnaker class, LoggingEvent. The child class allows the user to define any properties, parameters, and the event itself while LoggingEvent allows the child class to appropriately interface with the Spinnaker SDK.
In SpinView, the camera is not detected. The SpinView logging pane has no messages about the camera, because it cannot detect it.
1. Configure the GenTL.log to use the debug level of logging.
2. Connect the camera again.
3. View the GenTL.log from C:\ProgramData\Spinnaker\Logs.
[DEBUG] 2017-02-07 08:23:32,069  Entering HAL_UsbCheckDriver()
[DEBUG] 2017-02-07 08:23:32,069  HAL_UsbCheckDriver: Incompatible driver detected
[DEBUG] 2017-02-07 08:23:32,069  Leaving HAL_UsbCheckDriver()
Using the debug log, you can see that an incompatible driver is preventing the camera from being detected.