Changeset: 50b3380ceb6f for MonetDB
URL: https://dev.monetdb.org/hg/MonetDB/rev/50b3380ceb6f
Modified Files:
tools/mserver/mserver5.1.in
tools/mserver/mserver5.c
Branch: Mar2025
Log Message:
Implemented a --logging component=level argument to set tracing early.
diffs (47 lines):
diff --git a/tools/mserver/mserver5.1.in b/tools/mserver/mserver5.1.in
--- a/tools/mserver/mserver5.1.in
+++ b/tools/mserver/mserver5.1.in
@@ -181,6 +181,11 @@ that were accidentally left around by ol
(the current version is not known to do this) and so this option should
not normally be used.
.TP
+\fB\-\-logging\fP \fIcomponent\fP\fB=\fP\fIlevel\fP
+Set the specified logging component to the specified level as if the SQL
+query \fBcall logging.setcomplevel(\fP\fIcomponent\fP\fB,\fP\fIlevel\fP\fB)\fP
+had been executed, except this is done before SQL is initialized.
+.TP
\fB\-\-debug\fP[\fB=\fP\fIvalue\fP]
.PD 0
.TP
diff --git a/tools/mserver/mserver5.c b/tools/mserver/mserver5.c
--- a/tools/mserver/mserver5.c
+++ b/tools/mserver/mserver5.c
@@ -322,6 +322,8 @@ main(int argc, char **av)
{"single-user", no_argument, NULL, 0},
{"version", no_argument, NULL, 0},
+ {"logging", required_argument, NULL, 0},
+
{"algorithms", no_argument, NULL, 0},
{"forcemito", no_argument, NULL, 0},
{"heaps", no_argument, NULL, 0},
@@ -474,6 +476,19 @@ main(int argc, char **av)
monet_version();
exit(0);
}
+ if (strcmp(long_options[option_index].name, "logging")
== 0) {
+ char *tmp = strchr(optarg, '=');
+ if (tmp) {
+ *tmp = 0;
+ if
(GDKtracer_set_component_level(optarg, tmp + 1) != GDK_SUCCEED) {
+ fprintf(stderr, "WARNING: could
not set logging component %s to %s\n",
+ optarg, tmp +
1);
+ }
+ } else {
+ fprintf(stderr, "ERROR: --logging flag
requires component=level argument\n");
+ }
+ break;
+ }
/* debugging options */
if (strcmp(long_options[option_index].name,
"algorithms") == 0) {
grpdebug |= GRPalgorithms;
_______________________________________________
checkin-list mailing list -- [email protected]
To unsubscribe send an email to [email protected]