LogText

This parameter allows the insertion of custom text into the log file generated in a debug session.

  Note

Using this parameter starts recording debug information automatically if the logging functionality was inactive. It is not needed to call SetValue with the LogStatus parameter afterwards to activate a debug session.

Availability

It is available since PCAN-Basic version 1.0.0.

Supported By

  • None: Logging parameters are used globally, i.e., they are not tied to a specific PCAN Channel, but to a specific process.

Access Mode

This parameter is write-only. It can only be written.

Possible Values

This value is a string containing the data to be inserted into the log file. There is no limit to the length of the string, but it is recommended that it not exceed 256 bytes (inclusive null-termination).

Default Value

Does not apply. This is a value that can only be written.

Initialization Status

Set: Not relevant since this parameter is not channel dependent.

Example

The following code shows how to insert custom information in a log file:

C#
if (Api.SetValue(PcanChannel.None, PcanParameter.LogText, "This is the beginning of a debug session") == PcanStatus.OK)
    Console.WriteLine("Custom information has been successfully written to the log file.");
else
    Console.WriteLine("Error writing into the log file.");

See Also