Send string to process and logging the string
 @param message [String] Message to logging
 @param command [String] Command to send
 @param secret [Boolearn] Choise to logging command
776542
def write_and_logging(message, command, secret = false)
      logging_message = secret ? message : message + command
      @logger.info logging_message
      if @writer.closed?
        @logger.error "Try to write #{command}, but writer closed"
        @commands.clear
      else
        @writer.puts command
      end
    end
687871
public void sendMessage(Message message)
    {
        ((DualMessageQueue)this.getMessageQueue()).getMessageStack().sendMessage(message);
        
        ((BaseMessage)message).setProcessedByClient(true);     // Make sure any server doesn't send this back up.

        super.sendMessage(message);
    }
1119157
def __send_command(self, command, command_string=b'', response_size=8):
        
        if command not in [const.CMD_CONNECT, const.CMD_AUTH] and not self.is_connect:
            raise ZKErrorConnection("instance are not connected.")

        buf = self.__create_header(command, command_string, self.__session_id, self.__reply_id)
        try:
            if self.tcp:
                top = self.__create_tcp_top(buf)
                self.__sock.send(top)
                self.__tcp_data_recv = self.__sock.recv(response_size + 8)
                self.__tcp_length = self.__test_tcp_top(self.__tcp_data_recv)
                if self.__tcp_length == 0:
                    raise ZKNetworkError("TCP packet invalid")
                self.__header = unpack('<4H', self.__tcp_data_recv[8:16])
                self.__data_recv = self.__tcp_data_recv[8:]
            else:
                self.__sock.sendto(buf, self.__address)
                self.__data_recv = self.__sock.recv(response_size)
                self.__header = unpack('<4H', self.__data_recv[:8])
        except Exception as e:
            raise ZKNetworkError(str(e))

        self.__response = self.__header[0]
        self.__reply_id = self.__header[3]
        self.__data = self.__data_recv[8:]
        if self.__response in [const.CMD_ACK_OK, const.CMD_PREPARE_DATA, const.CMD_DATA]:
            return {
                'status': True,
                'code': self.__response
            }
        return {
            'status': False,
            'code': self.__response
        }
1310757
function logMessage (message) {
  if (!process.send) {
    console.log(message)
  } else {
    process.send(message)
  }
}
87498
def on_pubmsg(self, connection, event):
        
        for message in event.arguments():
            self.log(event, message)
            command_args = filter(None, message.split())
            command_name = command_args.pop(0)
            for handler in self.events["command"]:
                if handler.event.args["command"] == command_name:
                    self.handle_command_event(event, handler, command_args)
98702
function send (command, body) {
  debug('send command "' + command + '" with body ' + body)
  this._xmppClient.send(buildCommandIqStanza(command, body))
  return Q()
}
12397
def command(cmd):
    """"""
    message = create(protobuf.SEND_COMMAND_MESSAGE)
    send_command = message.inner()
    send_command.command = cmd
    return message
456096
function _log(message) {
    if (cluster.isMaster) {
        // write directly to the log file
        console.log(_format(message));
    }
    else {
        // send to master
        cluster.worker.process.send({
            type: "logging",
            data: {
                message: message,
                workerID: cluster.worker.id,
                pid: cluster.worker.process.pid
            }
        });
    }
}
365556
def process_message(self,msg,sock):
    ""
    command=msg[0]
    try: f={'GET':self.get,'SET':self.set,'SUBSCRIBE':self.sub,'PUBLISH':self.pub,
      'PING':self.ping,'GETSET':self.getset,'EXPIRE':self.expire,'DEL':self.delete}[command]
    except KeyError: print msg; raise
    args=msg[1:]
    try: return f(sock,*args) if command in self.SOCK_COMMANDS else f(*args)
    except Exception as e:
      print e
      print msg
      return '-ERROR\r\n'
631178
def cmd(send, msg, _):
    
    msg = msg.encode('utf-8')
    send(hashlib.sha512(msg).hexdigest())
798107
def send_command(self, cmd):
        
        logger.debug('Sending {0} command.'.format(cmd))
        self.comm_chan.sendall(cmd + '\n')
1179987
def send_command(self, command, *arguments):
        
        self.api.send_command(self, command, *arguments)
833538
@Override
	public final void messageReceived(final IoSession session, final Object message)
			throws Exception {
		final String str = message.toString();
		
		// Parse the command
		String cmd = null;
		final String[] args = str.trim().split("[\t ]");
		if (args.length>0) {
			cmd = args[0];
		}
		
		
		List<String> lstArg = new ArrayList<String>();
		if (args.length>0) {
			boolean isArg=false;
			int index=0;
			for (String val : args) {
				if (val.equals("-a")) {
					lstArg.add(val);
					index++;
					isArg=true;
				} else {
					if (val.length()>0) {
						if (isArg && val.charAt(0)!='-' && val.indexOf('=')==-1) {
							lstArg.set(index-1, lstArg.get(index-1)+" "+val);
						} else {
							lstArg.add(val);
							index++;
						}
					} else {
						lstArg.set(index-1, lstArg.get(index-1)+" ");
					}
				}
			}
		}
		
		// Try to launch the command
		final TcpCommand command = TcpIpCommands.getCommands().get(cmd);
		String result = null;
		
		// launch the command and get the result
		if (command != null) {
			if (args.length>1) {
				try {
				String[] finalArgs = new String[lstArg.size()];
				for (int i=0; i< finalArgs.length; i++) {
					String[] argSplit=lstArg.get(i).split("=");
					if (argSplit.length==2 && argSplit[1].charAt(0)=='"' && argSplit[1].charAt(argSplit[1].length()-1)=='"' ) {
						finalArgs[i]=argSplit[0]+"="+argSplit[1].substring(1, argSplit[1].length()-1);
					} else {
						finalArgs[i]=lstArg.get(i);
					}
				}
				result = command.process(session, Arrays.copyOfRange(finalArgs, 1, finalArgs.length));
				} catch (Exception e) {
					result = LaunchingMessageKind.ELAUNCH0007.format(cmd, e);
				}
			} else {
				result = command.process(session, new String[]{});
			}
		} else {
			session.write("command unknown :"+cmd);
		}
		// If the command returned a result, write it for the user
		if (result != null) {
			session.write(result);
		} else {
			session.write("");
		}
		session.write(ENDLINE);
		session.write(ENDLINE);
		session.write("> ");
	}
917004
def command_post_hook(*args)
      command = args.shift
      method = to_method_name("#{command}_post_hook")
      if respond_to?(method)
        send(method, *args)
      end
    end
1090467
@Override
    public boolean sendCommand(String command) {
        try {
            sendCommand2(command);
        } catch (Exception ex) {
            logger.error("Could not run command " + command, ex);
            return false;
        }
        return true;
    }
135042
def send(self, command: str, **kwargs: Any) -> None:
        
        packed_command = pack_command(command, **kwargs).strip()
        self.send_raw(packed_command)
1318714
def call(command, stdin=None, stdout=subprocess.PIPE, env=os.environ, cwd=None,
         shell=False, output_log_level=logging.INFO, sensitive_info=False):
    
    if not sensitive_info:
        logger.debug("calling command: %s" % command)
    else:
        logger.debug("calling command with sensitive information")
    try:
        args = command if shell else whitespace_smart_split(command)
        kw = {}
        if not shell and not which(args[0], cwd=cwd):
            raise CommandMissingException(args[0])
        if shell:
            kw['shell'] = True
        process = subprocess.Popen(args, stdin=subprocess.PIPE, stdout=stdout,
                                   stderr=subprocess.STDOUT, env=env, cwd=cwd,
                                   **kw)
        output = process.communicate(input=stdin)[0]
        if output is not None:
            try:
                logger.log(output_log_level, output.decode('utf-8'))
            except UnicodeDecodeError:
                pass
        return (process.returncode, output)
    except OSError:
        e = sys.exc_info()[1]
        if not sensitive_info:
            logger.exception("Error running command: %s" % command)
            logger.error("Root directory: %s" % cwd)
            if stdin:
                logger.error("stdin: %s" % stdin)
        raise e