Remove unnecessary memory copies in logger