Simple output capturing for the codegen.