replace getLogString with ensureString