logger.py: copy changes from Artus