diff --git a/hw/kdrive/ephyr/ephyrinit.c b/hw/kdrive/ephyr/ephyrinit.c index 6e55057d0..9c771af6c 100644 --- a/hw/kdrive/ephyr/ephyrinit.c +++ b/hw/kdrive/ephyr/ephyrinit.c @@ -291,10 +291,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 4bb564937..62ac51c45 100644 --- a/hw/xfree86/common/xf86Init.c +++ b/hw/xfree86/common/xf86Init.c @@ -871,7 +871,7 @@ xf86SetVerbosity(int verb) int save = xf86Verbose; xf86Verbose = verb; - LogSetParameter(XLOG_VERBOSITY, verb); + xorgLogVerbosity = verb; return save; } diff --git a/hw/xwayland/xwayland.c b/hw/xwayland/xwayland.c index e281c334c..6f0c7f2a7 100644 --- a/hw/xwayland/xwayland.c +++ b/hw/xwayland/xwayland.c @@ -236,11 +236,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 b90503952..1df1ea0a0 100644 --- a/hw/xwin/InitOutput.c +++ b/hw/xwin/InitOutput.c @@ -647,7 +647,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 eeb703be6..8d0b81891 100644 --- a/os/log.c +++ b/os/log.c @@ -123,7 +123,7 @@ void (*OsVendorVErrorFProc) (const char *, va_list args) = NULL; 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. */ @@ -352,7 +352,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; @@ -601,7 +601,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) { @@ -673,7 +673,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 37828652f..f96673b08 100644 --- a/test/signal-logging.c +++ b/test/signal-logging.c @@ -152,7 +152,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])); @@ -184,7 +184,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));