Skip to content

Wexpect logging

Benedek Racz edited this page May 31, 2020 · 1 revision

The logging

Wexpect has a debug logging feature, which is disabled by default. The logs contain useful information about starting and communicating with the console-reader process, which is useful for debugging an issue. Wexpect uses python's built-in logging feature.

How to turn on the logging?

To turn on the logging, set the WEXPECT_LOGGER_LEVEL environment variable to one of the following: SPAM, DEBUG, INFO, WARNING, ERROR. I use DEBUG for testing the start of the wexpect and INFO for longer tests. To set the DEBUG level use the following command:

set WEXPECT_LOGGER_LEVEL=DEBUG

Log files

Wexpect will generate two logfiles: one for the host process, and another for the console-reader process. The log files will be generated into .wlog subdirectory by default, and will be named based on the process PID.

To give a custom name, use the WEXPECT_LOGGER_FILENAME environment variable. (not recommended.)

Clone this wiki locally