1e662a2
set up logging only when running as the main script This helps with log messages duplication, see T186.