Fix a critical bug where logging was not protecting against % in format strings.