log output (script+result) function