Any CAPL function to disable logging block when simulation is ON and activate it back required?

105 Views Asked by At

Trying to take logs in .pcap format n post process from trace window, I'm using startlogging and stoplogging capl functions as of now . When I'm stopping it pauses and resumes when I start again. I want it to be overwritten again when I start it. Need capl functions.

1

There are 1 best solutions below

4
MSpiller On

You have to close the log file before starting the logging block again.

The CAPL call to do so is closeLogFile(<loggingBlockName>)

When you call startLogging again after closing, the old file will be overwritten.


If you use CANoe earlier than version 17 closeLogFile is not available.

Then your only option is to rename or delete the logfile before calling startLogFile. E.g.:

sysExecCmd("del", "<path to log file>")
startLogging(<loggingBlockName>);