Logging is output to stderr. To run a program with logging and save it
to a new file (overwriting an old one if it exists) you can do:
./waf --run 'program-name' > log.out 2>&1
to append to an existing 'log.out' file instead:
./waf --run 'program-name' >> log.out 2>&1