 
   if err?
     callback stderr,stdout
-    log.error "[ERROR]",{err,stdout,stderr}
+    if stdout
+      log.warn "[WARNING]", err, truncateOutput(stderr), truncateOutput stdout
+    else
+      log.error "[ERROR]", err, truncateOutput stderr
   else
     # log.info "[OK] command \"#{command}\" executed for user #{username}"
     callback? null,stdout

      chars = ";&|><*?`$(){}[]!#"
      if containsAnyChar command,chars
        log.debug "exec in a file",command
        prepareForBashExecute options, (err, filename)->          
          unless err
            execute {filename,username},callback
          else

    unlink = no
  else
    log.error "execute can only work with provided .filename or .command"

  cmd = exec execStr, {maxBuffer: 1024*1024}, (err,stdout,stderr)->
    respond {err,stdout,stderr},callback
    fs.unlink filename if unlink is yes
    log.debug "executed", truncateOutput execStr


truncateOutput = (output)->

  if output.length > 300
    "#{output[0...300]} ...[truncated output]"
  else
    output

respond = (options,callback)->

