Add tracing to copy_hex()