diff --git a/hw/xfree86/common/xf86Init.c b/hw/xfree86/common/xf86Init.c index 62ac51c45..cef6a829d 100644 --- a/hw/xfree86/common/xf86Init.c +++ b/hw/xfree86/common/xf86Init.c @@ -881,7 +881,7 @@ xf86SetLogVerbosity(int verb) int save = xf86LogVerbose; xf86LogVerbose = verb; - LogSetParameter(XLOG_FILE_VERBOSITY, verb); + xorgLogFileVerbosity = verb; return save; } diff --git a/hw/xwin/InitOutput.c b/hw/xwin/InitOutput.c index 1df1ea0a0..68d441b90 100644 --- a/hw/xwin/InitOutput.c +++ b/hw/xwin/InitOutput.c @@ -648,7 +648,7 @@ OsVendorInit(void) } xorgLogVerbosity = g_iLogVerbose; - LogSetParameter(XLOG_FILE_VERBOSITY, g_iLogVerbose); + xorgLogFileVerbosity = g_iLogVerbose; /* Log the version information */ if (serverGeneration == 1) diff --git a/os/log.c b/os/log.c index 8d0b81891..f3f1e944f 100644 --- a/os/log.c +++ b/os/log.c @@ -124,7 +124,7 @@ void (*OsVendorVErrorFProc) (const char *, va_list args) = NULL; static int logFileFd = -1; static Bool logSync = FALSE; int xorgLogVerbosity = DEFAULT_LOG_VERBOSITY; -static int logFileVerbosity = DEFAULT_LOG_FILE_VERBOSITY; +int xorgLogFileVerbosity = DEFAULT_LOG_FILE_VERBOSITY; /* Buffer to information logged before the log file is opened. */ static char *saveBuffer = NULL; @@ -355,7 +355,7 @@ LogSetParameter(LogParameter param, int value) xorgLogVerbosity = value; return TRUE; case XLOG_FILE_VERBOSITY: - logFileVerbosity = value; + xorgLogFileVerbosity = value; return TRUE; default: return FALSE; @@ -604,7 +604,7 @@ LogSWrite(int verb, const char *buf, size_t len, Bool end_line) if (verb < 0 || xorgLogVerbosity >= verb) ret = write(2, buf, len); - if (verb < 0 || logFileVerbosity >= verb) { + if (verb < 0 || xorgLogFileVerbosity >= verb) { if (inSignalContext && logFileFd >= 0) { ret = write(logFileFd, buf, len); if (logSync) @@ -673,7 +673,7 @@ LogMessageTypeVerbString(MessageType type, int verb) if (type == X_ERROR) verb = 0; - if (xorgLogVerbosity < verb && logFileVerbosity < verb) + if (xorgLogVerbosity < verb && xorgLogFileVerbosity < verb) return NULL; switch (type) { diff --git a/os/log_priv.h b/os/log_priv.h index cf81e0db4..28f6fb26c 100644 --- a/os/log_priv.h +++ b/os/log_priv.h @@ -76,4 +76,12 @@ int LogSetParameter(LogParameter param, int value); */ extern int xorgLogVerbosity; +/** + * @brief log file verbosity + * + * The verbosity level of logging to per-display file. All messages with + * verbosity level below this one will be written to the log file. + */ +extern int xorgLogFileVerbosity; + #endif /* __XORG_OS_LOGGING_H */