When logging commands, quote special characters