diff --git a/hw/kdrive/ephyr/ephyrinit.c b/hw/kdrive/ephyr/ephyrinit.c index 881bc2ea9..767fccd0f 100644 --- a/hw/kdrive/ephyr/ephyrinit.c +++ b/hw/kdrive/ephyr/ephyrinit.c @@ -289,10 +289,8 @@ ddxProcessArgument(int argc, char **argv, int i) } else if (!strcmp(argv[i], "-verbosity")) { if (i + 1 < argc && argv[i + 1][0] != '-') { - int verbosity = atoi(argv[i + 1]); - - LogSetParameter(XLOG_VERBOSITY, verbosity); - EPHYR_LOG("set verbosiry to %d\n", verbosity); + xorgLogVerbosity = atoi(argv[i + 1]); + EPHYR_LOG("set verbosiry to %d\n", xorgLogVerbosity); return 2; } else { diff --git a/hw/xfree86/common/xf86Init.c b/hw/xfree86/common/xf86Init.c index 3a524f664..5e419f9bd 100644 --- a/hw/xfree86/common/xf86Init.c +++ b/hw/xfree86/common/xf86Init.c @@ -868,7 +868,7 @@ void xf86SetVerbosity(int verb) { xf86Verbose = verb; - LogSetParameter(XLOG_VERBOSITY, verb); + xorgLogVerbosity = verb; } void diff --git a/hw/xwayland/xwayland.c b/hw/xwayland/xwayland.c index 556ddfb9d..783dd6226 100644 --- a/hw/xwayland/xwayland.c +++ b/hw/xwayland/xwayland.c @@ -234,11 +234,11 @@ ddxProcessArgument(int argc, char *argv[], int i) val = strtol(argv[i], &end, 0); if (*end == '\0') { verbosity = val; - LogSetParameter(XLOG_VERBOSITY, verbosity); + xorgLogVerbosity = verbosity; return 2; } } - LogSetParameter(XLOG_VERBOSITY, ++verbosity); + xorgLogVerbosity = ++verbosity; return 1; } else if (strcmp(argv[i], "-version") == 0) { diff --git a/hw/xwin/InitOutput.c b/hw/xwin/InitOutput.c index 948c22c68..0fe63b9f5 100644 --- a/hw/xwin/InitOutput.c +++ b/hw/xwin/InitOutput.c @@ -534,7 +534,7 @@ OsVendorInit(void) g_pszLogFile = LogInit(g_pszLogFile, ".old"); } - LogSetParameter(XLOG_VERBOSITY, g_iLogVerbose); + xorgLogVerbosity = g_iLogVerbose; LogSetParameter(XLOG_FILE_VERBOSITY, g_iLogVerbose); /* Log the version information */ diff --git a/os/log.c b/os/log.c index 28497ba8f..00c588f71 100644 --- a/os/log.c +++ b/os/log.c @@ -113,7 +113,7 @@ OR PERFORMANCE OF THIS SOFTWARE. static int logFileFd = -1; static Bool logSync = FALSE; -static int logVerbosity = DEFAULT_LOG_VERBOSITY; +int xorgLogVerbosity = DEFAULT_LOG_VERBOSITY; static int logFileVerbosity = DEFAULT_LOG_FILE_VERBOSITY; /* Buffer to information logged before the log file is opened. */ @@ -318,7 +318,7 @@ LogSetParameter(LogParameter param, int value) logSync = value ? TRUE : FALSE; return TRUE; case XLOG_VERBOSITY: - logVerbosity = value; + xorgLogVerbosity = value; return TRUE; case XLOG_FILE_VERBOSITY: logFileVerbosity = value; @@ -555,7 +555,7 @@ LogSWrite(int verb, const char *buf, size_t len, Bool end_line) static Bool newline = TRUE; int ret; - if (verb < 0 || logVerbosity >= verb) + if (verb < 0 || xorgLogVerbosity >= verb) ret = write(2, buf, len); if (verb < 0 || logFileVerbosity >= verb) { @@ -607,7 +607,7 @@ LogMessageTypeVerbString(MessageType type, int verb) if (type == X_ERROR) verb = 0; - if (logVerbosity < verb && logFileVerbosity < verb) + if (xorgLogVerbosity < verb && logFileVerbosity < verb) return NULL; switch (type) { diff --git a/os/log_priv.h b/os/log_priv.h index 682aa4e25..cf81e0db4 100644 --- a/os/log_priv.h +++ b/os/log_priv.h @@ -68,4 +68,12 @@ int LogSetParameter(LogParameter param, int value); #define DebugF(...) /* */ #endif +/** + * @brief console log verbosity (stderr) + * + * The verbosity level of logging to console. All messages with verbosity + * level below this one will be written to stderr + */ +extern int xorgLogVerbosity; + #endif /* __XORG_OS_LOGGING_H */ diff --git a/test/signal-logging.c b/test/signal-logging.c index 11cdcadb5..e0122e601 100644 --- a/test/signal-logging.c +++ b/test/signal-logging.c @@ -150,7 +150,7 @@ number_formatting(void) -0x7FFFFFFFFFFFFFFF, /* Maximum 64-bit signed number */ } ; - LogSetParameter(XLOG_VERBOSITY, -1); + xorgLogVerbosity = -1; for (i = 0; i < ARRAY_SIZE(unsigned_tests); i++) assert(check_number_format_test(unsigned_tests[i])); @@ -182,7 +182,7 @@ static void logging_format(void) uintptr_t ptr; char *fname = NULL; - LogSetParameter(XLOG_VERBOSITY, -1); + xorgLogVerbosity = -1; /* set up buf to contain ".....end" */ memset(buf, '.', sizeof(buf));