Skip to main content
Open topic with navigation CAPL Functions » General » Function Overview » writeToLog

writeToLog

Valid for: CANoe DE • CANoe:lite DE • CANoe4SW DE • CANoe4SW:lite DE

Function Syntax

void writeToLog(char format[], ...);

Description

Writes an output string to an ASCII or BLF logging file. Write is based on the C function printf. The compiler cannot check the format string. Illegal format entries will lead to undefined results. Different to the writeToLogEx function, comment characters (”//”) and a time stamp at the beginning of each line will be printed. Note
  • The maximum length of the resulting string is limited to 1024 characters.
  • As BLF is not a human readable format, the output string cannot be seen directly in a BLF logging file, but only after a conversion into an ASCII logging file.

Parameters

Format string, variables or expressions.

Return Values

Example

void MarkLogFile(int marker) {
// marks line of ASCII logging file with an integer
writeToLog("===> %d",marker);
}
snprintfwritewriteToLogEx