2
0
mirror of https://github.com/meganz/MEGAcmd synced 2025-08-22 09:57:09 +00:00

log messages in cerr & cout

This commit is contained in:
Pablo Martin 2018-09-04 16:36:09 +02:00
parent 7e4db800d3
commit 4bf91ff422
No known key found for this signature in database
GPG Key ID: 1746978B12F13D6E
2 changed files with 7 additions and 0 deletions

View File

@ -539,6 +539,8 @@ int main(int argc, char* argv[])
int outcode = comms->executeCommand(parsedArgs, readresponse, COUT, false);
#endif
cerr << "COMMAND EXECUTED. Closing client app" << endl;
cout << "COUT: COMMAND EXECUTED. Closing client app" << endl;
delete comms;
// do always return positive error codes (POSIX compliant)

View File

@ -780,6 +780,8 @@ int MegaCmdShellCommunications::executeCommand(string command, std::string (*rea
char buffer[1025];
do{
n = recv(newsockfd, buffer, BUFFERSIZE, MSG_NOSIGNAL);
cerr << "read output from server n=" << n << endl;
cout << "COUT: read output from server n=" << n << endl;
if (n)
{
#ifdef _WIN32
@ -803,6 +805,9 @@ int MegaCmdShellCommunications::executeCommand(string command, std::string (*rea
return -1;;
}
cerr << " after received all bytes. last n=" << n << endl;
cout << "COUT: after received all bytes. last n=" << n << endl;
closeSocket(newsockfd);
closeSocket(thesock);
return outcode;