logger: backport from 3.13