Create truncate_with_logging.js