1
0
mirror of https://github.com/mariadb-corporation/mariadb-columnstore-engine.git synced 2025-12-20 01:42:27 +03:00

Logging to syslog instead of cout/printf

This commit is contained in:
Ben Thompson
2019-02-14 10:50:22 -06:00
parent 17aba1a272
commit 83a6e77278
14 changed files with 59 additions and 53 deletions

View File

@@ -4,6 +4,7 @@
#include <iostream>
#include <sys/types.h>
#include <sys/socket.h>
#include <syslog.h>
#include <string.h>
#define min(x, y) (x < y ? x : y)
@@ -42,7 +43,7 @@ void PosixTask::handleError(const char *name, int errCode)
write(*resp, 4);
// TODO: construct and log a message
cout << name << " caught an error: " << strerror_r(errCode, buf, 80) << endl;
syslog(LOG_ERR, "%s caught an error: %s.",name,strerror_r(errCode, buf, 80));
}
uint PosixTask::getRemainingLength()
@@ -186,7 +187,7 @@ void PosixTask::consumeMsg()
while (remainingLengthInStream > 0)
{
cout << "ERROR: eating data" << endl;
syslog(LOG_ERR, "ERROR: eating data.");
err = ::recv(sock, buf, min(remainingLengthInStream, 1024), 0);
if (err <= 0) {
remainingLengthInStream = 0;