os: directly set log file verbosity level, instead of using LogSetParameter()
No need for extra call to some demuxer function for nothing but setting a simple int variable. Setting verbosity level really is nothing more than just writing some value into a variable, so it's trivial to just to do that, instead of having an unncessarily complex "universal setter" for that. Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
This commit is contained in:
parent
ae7c32abf6
commit
09a95d82de
|
@ -875,7 +875,7 @@ void
|
||||||
xf86SetLogVerbosity(int verb)
|
xf86SetLogVerbosity(int verb)
|
||||||
{
|
{
|
||||||
xf86LogVerbose = verb;
|
xf86LogVerbose = verb;
|
||||||
LogSetParameter(XLOG_FILE_VERBOSITY, verb);
|
xorgLogFileVerbosity = verb;
|
||||||
}
|
}
|
||||||
|
|
||||||
static void
|
static void
|
||||||
|
|
|
@ -535,7 +535,7 @@ OsVendorInit(void)
|
||||||
|
|
||||||
}
|
}
|
||||||
xorgLogVerbosity = g_iLogVerbose;
|
xorgLogVerbosity = g_iLogVerbose;
|
||||||
LogSetParameter(XLOG_FILE_VERBOSITY, g_iLogVerbose);
|
xorgLogFileVerbosity = g_iLogVerbose;
|
||||||
|
|
||||||
/* Log the version information */
|
/* Log the version information */
|
||||||
if (serverGeneration == 1)
|
if (serverGeneration == 1)
|
||||||
|
|
8
os/log.c
8
os/log.c
|
@ -114,7 +114,7 @@ OR PERFORMANCE OF THIS SOFTWARE.
|
||||||
static int logFileFd = -1;
|
static int logFileFd = -1;
|
||||||
static Bool logSync = FALSE;
|
static Bool logSync = FALSE;
|
||||||
int xorgLogVerbosity = DEFAULT_LOG_VERBOSITY;
|
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. */
|
/* Buffer to information logged before the log file is opened. */
|
||||||
static char *saveBuffer = NULL;
|
static char *saveBuffer = NULL;
|
||||||
|
@ -321,7 +321,7 @@ LogSetParameter(LogParameter param, int value)
|
||||||
xorgLogVerbosity = value;
|
xorgLogVerbosity = value;
|
||||||
return TRUE;
|
return TRUE;
|
||||||
case XLOG_FILE_VERBOSITY:
|
case XLOG_FILE_VERBOSITY:
|
||||||
logFileVerbosity = value;
|
xorgLogFileVerbosity = value;
|
||||||
return TRUE;
|
return TRUE;
|
||||||
default:
|
default:
|
||||||
return FALSE;
|
return FALSE;
|
||||||
|
@ -558,7 +558,7 @@ LogSWrite(int verb, const char *buf, size_t len, Bool end_line)
|
||||||
if (verb < 0 || xorgLogVerbosity >= verb)
|
if (verb < 0 || xorgLogVerbosity >= verb)
|
||||||
ret = write(2, buf, len);
|
ret = write(2, buf, len);
|
||||||
|
|
||||||
if (verb < 0 || logFileVerbosity >= verb) {
|
if (verb < 0 || xorgLogFileVerbosity >= verb) {
|
||||||
if (inSignalContext && logFileFd >= 0) {
|
if (inSignalContext && logFileFd >= 0) {
|
||||||
ret = write(logFileFd, buf, len);
|
ret = write(logFileFd, buf, len);
|
||||||
if (logSync)
|
if (logSync)
|
||||||
|
@ -607,7 +607,7 @@ LogMessageTypeVerbString(MessageType type, int verb)
|
||||||
if (type == X_ERROR)
|
if (type == X_ERROR)
|
||||||
verb = 0;
|
verb = 0;
|
||||||
|
|
||||||
if (xorgLogVerbosity < verb && logFileVerbosity < verb)
|
if (xorgLogVerbosity < verb && xorgLogFileVerbosity < verb)
|
||||||
return NULL;
|
return NULL;
|
||||||
|
|
||||||
switch (type) {
|
switch (type) {
|
||||||
|
|
|
@ -76,4 +76,12 @@ int LogSetParameter(LogParameter param, int value);
|
||||||
*/
|
*/
|
||||||
extern int xorgLogVerbosity;
|
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 */
|
#endif /* __XORG_OS_LOGGING_H */
|
||||||
|
|
Loading…
Reference in New Issue