Changeset: df546e7d74cc for MonetDB
URL: https://dev.monetdb.org/hg/MonetDB/rev/df546e7d74cc
Modified Files:
        tools/merovingian/ChangeLog.Sep2022
        tools/merovingian/daemon/merovingian.c
Branch: Sep2022
Log Message:

Merge with Jan2022 branch.


diffs (50 lines):

diff --git a/tools/merovingian/ChangeLog.Sep2022 
b/tools/merovingian/ChangeLog.Sep2022
--- a/tools/merovingian/ChangeLog.Sep2022
+++ b/tools/merovingian/ChangeLog.Sep2022
@@ -1,3 +1,6 @@
 # ChangeLog file for sql/src/backends/monet5/merovingian
 # This file is updated with mchangelog
 
+* Wed Oct 12 2022 Sjoerd Mullender <sjo...@acm.org>
+- Stop logging references to monetdbd's logfile in said logfile.
+
diff --git a/tools/merovingian/daemon/merovingian.c 
b/tools/merovingian/daemon/merovingian.c
--- a/tools/merovingian/daemon/merovingian.c
+++ b/tools/merovingian/daemon/merovingian.c
@@ -186,7 +186,15 @@ logFD(dpair dp, int fd, const char *type
                                /* empty line, don't bother */
                                continue;
                        }
-                       if (dp->input[fd].cnt < 30000 && 
strncmp(dp->input[fd].buf, q, (size_t) (p + 1 - q)) == 0) {
+                       *p = 0;                         /* was '\n' which we do 
not store */
+                       char *s;
+                       if ((s = strstr(q, "monetdbd's logfile")) != NULL) {
+                               while (--s > q && *s != ',')
+                                       ;
+                               /* shorten message with reference to logfile */
+                               *s = '\0';
+                       }
+                       if (dp->input[fd].cnt < 30000 && 
strcmp(dp->input[fd].buf, q) == 0) {
                                /* repeat of last message */
                                dp->input[fd].cnt++;
                                dp->input[fd].ts = now;
@@ -197,16 +205,15 @@ logFD(dpair dp, int fd, const char *type
                                        strftime(tmptime, sizeof(tmptime), 
"%Y-%m-%d %H:%M:%S",
                                                         
localtime(&dp->input[fd].ts));
                                        if (dp->input[fd].cnt == 1)
-                                               fprintf(stream, "%s %s 
%s[%lld]: %s",
+                                               fprintf(stream, "%s %s 
%s[%lld]: %s\n",
                                                                tmptime, type, 
dbname, pid, dp->input[fd].buf);
                                        else
-                                               fprintf(stream, "%s %s 
%s[%lld]: message repeated %d times: %s",
+                                               fprintf(stream, "%s %s 
%s[%lld]: message repeated %d times: %s\n",
                                                                tmptime, type, 
dbname, pid, dp->input[fd].cnt, dp->input[fd].buf);
                                }
                                dp->input[fd].ts = now;
                                dp->input[fd].cnt = 0;
-                               strncpy(dp->input[fd].buf, q, p + 1 - q);
-                               dp->input[fd].buf[p + 1 - q] = '\0';
+                               strcpy(dp->input[fd].buf, q);
                                fprintf(stream, "%s %s %s[%lld]: %.*s\n",
                                                mytime, type, dbname, pid, 
(int) (p - q), q);
                        }
_______________________________________________
checkin-list mailing list -- checkin-list@monetdb.org
To unsubscribe send an email to checkin-list-le...@monetdb.org

Reply via email to