Log result and code