improved logging (part 2)