How can test modules control the logging block to change the filename of logging during a test?
For CANoe < 7.6 SP3
Example for one single logging block, can easily be extended for multiple logging blocks (for CANoe < 7.6 SP3):
- Insert a system variable that should contain the name of the current logging file.
- Insert (or extend an already existing) CAPL block in the measurement setup. This CAPL block is to be located in the analysis branch that directs to the logging block you want to control.
- Adapt the following example code to your needs:
on sysvar_update sysvar::Logging_Test::StartLoggingWithNewName
char fileName ;
sysGetVariableString(this, fileName, 1000);
- Within the test module, just set the system variable's content to the filename of the intended logging. For example at the beginning of a test module, or a test case, whatever matches your needs.
For CANoe > 7.6 SP3
The log file name can be directly set with: setLogFileName(char strLoggingBlockName, char fileName);