added logit function to log output from a command