- if (len == LOG_BUF_SIZE) {
- if (!proc->log_overflow) {
- proc->log_buf[LOG_BUF_SIZE] = 0;
- fprintf(stderr, "%s (%d): %s [...]\n", log_prefix, proc->uloop.pid, proc->log_buf);
+ if (proc->log_overflow) {
+ if (newline) {
+ len = newline + 1 - data;
+ proc->log_overflow = false;
+ }
+ } else if (newline) {
+ *newline = 0;
+ len = newline + 1 - data;
+ netifd_log_message(L_NOTICE, "%s (%d): %s\n",
+ log_prefix, proc->uloop.pid, data);
+ } else if (len == s->r.buffer_len) {
+ netifd_log_message(L_NOTICE, "%s (%d): %s [...]\n",
+ log_prefix, proc->uloop.pid, data);