modified logging function to truncate output and adjusted error output formatting tests to be compatible with both the new and old runtimes