Compare commits
12 Commits
master
...
submit/sys
Author | SHA1 | Date | |
---|---|---|---|
|
cc5bf5999c | ||
|
29d0ceb2d6 | ||
|
8b9fdefe82 | ||
|
47bbb3995d | ||
|
f379affc25 | ||
|
65a3954b2e | ||
|
e203a6c57d | ||
|
3640a33077 | ||
|
4fa8b1658b | ||
|
74ccb158eb | ||
|
4e5dad0573 | ||
|
a92d3f2a04 |
|
@ -46,6 +46,7 @@ in this Software without prior written authorization from The Open Group.
|
||||||
#include "os/auth.h"
|
#include "os/auth.h"
|
||||||
#include "os/busfault.h"
|
#include "os/busfault.h"
|
||||||
#include "os/client_priv.h"
|
#include "os/client_priv.h"
|
||||||
|
#include "os/log_priv.h"
|
||||||
#include "os/osdep.h"
|
#include "os/osdep.h"
|
||||||
|
|
||||||
#include "misc.h"
|
#include "misc.h"
|
||||||
|
|
|
@ -36,6 +36,9 @@ from Kaleb S. KEITHLEY
|
||||||
#include <X11/X.h>
|
#include <X11/X.h>
|
||||||
#include <X11/Xproto.h>
|
#include <X11/Xproto.h>
|
||||||
#include <X11/extensions/xf86vmproto.h>
|
#include <X11/extensions/xf86vmproto.h>
|
||||||
|
|
||||||
|
#include "os/log_priv.h"
|
||||||
|
|
||||||
#include "misc.h"
|
#include "misc.h"
|
||||||
#include "dixstruct.h"
|
#include "dixstruct.h"
|
||||||
#include "extnsionst.h"
|
#include "extnsionst.h"
|
||||||
|
|
|
@ -97,6 +97,7 @@ SOFTWARE.
|
||||||
#include "dix/exevents_priv.h"
|
#include "dix/exevents_priv.h"
|
||||||
#include "dix/input_priv.h"
|
#include "dix/input_priv.h"
|
||||||
#include "mi/mi_priv.h"
|
#include "mi/mi_priv.h"
|
||||||
|
#include "os/log_priv.h"
|
||||||
|
|
||||||
#include "inputstr.h"
|
#include "inputstr.h"
|
||||||
#include "windowstr.h"
|
#include "windowstr.h"
|
||||||
|
|
|
@ -28,6 +28,8 @@
|
||||||
#include <dbus/dbus.h>
|
#include <dbus/dbus.h>
|
||||||
#include <sys/select.h>
|
#include <sys/select.h>
|
||||||
|
|
||||||
|
#include "os/log_priv.h"
|
||||||
|
|
||||||
#include "dix.h"
|
#include "dix.h"
|
||||||
#include "os.h"
|
#include "os.h"
|
||||||
|
|
||||||
|
|
|
@ -62,6 +62,7 @@ SOFTWARE.
|
||||||
#include "dix/ptrveloc_priv.h"
|
#include "dix/ptrveloc_priv.h"
|
||||||
#include "mi/mi_priv.h"
|
#include "mi/mi_priv.h"
|
||||||
#include "os/bug_priv.h"
|
#include "os/bug_priv.h"
|
||||||
|
#include "os/log_priv.h"
|
||||||
#include "os/osdep.h"
|
#include "os/osdep.h"
|
||||||
#include "xkb/xkbsrv_priv.h"
|
#include "xkb/xkbsrv_priv.h"
|
||||||
|
|
||||||
|
|
|
@ -60,6 +60,7 @@ Equipment Corporation.
|
||||||
#include "dix/dix_priv.h"
|
#include "dix/dix_priv.h"
|
||||||
#include "dix/gc_priv.h"
|
#include "dix/gc_priv.h"
|
||||||
#include "os/auth.h"
|
#include "os/auth.h"
|
||||||
|
#include "os/log_priv.h"
|
||||||
|
|
||||||
#include "scrnintstr.h"
|
#include "scrnintstr.h"
|
||||||
#include "resource.h"
|
#include "resource.h"
|
||||||
|
|
|
@ -127,6 +127,7 @@ Equipment Corporation.
|
||||||
#include "os/bug_priv.h"
|
#include "os/bug_priv.h"
|
||||||
#include "os/client_priv.h"
|
#include "os/client_priv.h"
|
||||||
#include "os/fmt.h"
|
#include "os/fmt.h"
|
||||||
|
#include "os/log_priv.h"
|
||||||
#include "xkb/xkbsrv_priv.h"
|
#include "xkb/xkbsrv_priv.h"
|
||||||
|
|
||||||
#include "misc.h"
|
#include "misc.h"
|
||||||
|
|
|
@ -33,6 +33,7 @@
|
||||||
#include "dix/input_priv.h"
|
#include "dix/input_priv.h"
|
||||||
#include "mi/mi_priv.h"
|
#include "mi/mi_priv.h"
|
||||||
#include "os/bug_priv.h"
|
#include "os/bug_priv.h"
|
||||||
|
#include "os/log_priv.h"
|
||||||
|
|
||||||
#include "inputstr.h"
|
#include "inputstr.h"
|
||||||
#include "scrnintstr.h"
|
#include "scrnintstr.h"
|
||||||
|
|
|
@ -28,6 +28,7 @@
|
||||||
#include "dix/dix_priv.h"
|
#include "dix/dix_priv.h"
|
||||||
#include "os/cmdline.h"
|
#include "os/cmdline.h"
|
||||||
#include "os/ddx_priv.h"
|
#include "os/ddx_priv.h"
|
||||||
|
#include "os/log_priv.h"
|
||||||
#include "os/osdep.h"
|
#include "os/osdep.h"
|
||||||
|
|
||||||
#include "ephyr.h"
|
#include "ephyr.h"
|
||||||
|
@ -288,10 +289,8 @@ ddxProcessArgument(int argc, char **argv, int i)
|
||||||
}
|
}
|
||||||
else if (!strcmp(argv[i], "-verbosity")) {
|
else if (!strcmp(argv[i], "-verbosity")) {
|
||||||
if (i + 1 < argc && argv[i + 1][0] != '-') {
|
if (i + 1 < argc && argv[i + 1][0] != '-') {
|
||||||
int verbosity = atoi(argv[i + 1]);
|
logVerbosity = atoi(argv[i + 1]);
|
||||||
|
EPHYR_LOG("set verbosiry to %d\n", logVerbosity);
|
||||||
LogSetParameter(XLOG_VERBOSITY, verbosity);
|
|
||||||
EPHYR_LOG("set verbosiry to %d\n", verbosity);
|
|
||||||
return 2;
|
return 2;
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
|
|
|
@ -50,6 +50,7 @@
|
||||||
#include <sys/types.h>
|
#include <sys/types.h>
|
||||||
#include <grp.h>
|
#include <grp.h>
|
||||||
|
|
||||||
|
#include "os/log_priv.h"
|
||||||
#include "os/osdep.h"
|
#include "os/osdep.h"
|
||||||
|
|
||||||
#include "xf86.h"
|
#include "xf86.h"
|
||||||
|
@ -827,13 +828,11 @@ configServerFlags(XF86ConfFlagsPtr flagsconf, XF86OptionPtr layoutopts)
|
||||||
{
|
{
|
||||||
if ((s = xf86GetOptValString(FlagOptions, FLAG_LOG))) {
|
if ((s = xf86GetOptValString(FlagOptions, FLAG_LOG))) {
|
||||||
if (!xf86NameCmp(s, "flush")) {
|
if (!xf86NameCmp(s, "flush")) {
|
||||||
LogMessageVerb(X_CONFIG, 1, "Flushing logfile enabled\n");
|
LogMessageVerb(X_CONFIG, 1, "flush log flag is noop\n");
|
||||||
LogSetParameter(XLOG_FLUSH, TRUE);
|
|
||||||
}
|
}
|
||||||
else if (!xf86NameCmp(s, "sync")) {
|
else if (!xf86NameCmp(s, "sync")) {
|
||||||
LogMessageVerb(X_CONFIG, 1, "Syncing logfile enabled\n");
|
LogMessageVerb(X_CONFIG, 1, "Syncing logfile enabled\n");
|
||||||
LogSetParameter(XLOG_FLUSH, TRUE);
|
logSync = TRUE;
|
||||||
LogSetParameter(XLOG_SYNC, TRUE);
|
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
LogMessageVerb(X_WARNING, 1, "Unknown Log option\n");
|
LogMessageVerb(X_WARNING, 1, "Unknown Log option\n");
|
||||||
|
|
|
@ -64,6 +64,7 @@
|
||||||
#include "dix/dix_priv.h"
|
#include "dix/dix_priv.h"
|
||||||
#include "dix/input_priv.h"
|
#include "dix/input_priv.h"
|
||||||
#include "mi/mi_priv.h"
|
#include "mi/mi_priv.h"
|
||||||
|
#include "os/log_priv.h"
|
||||||
|
|
||||||
#include "misc.h"
|
#include "misc.h"
|
||||||
#include "xf86.h"
|
#include "xf86.h"
|
||||||
|
|
|
@ -44,6 +44,7 @@
|
||||||
#include "dix/dix_priv.h"
|
#include "dix/dix_priv.h"
|
||||||
#include "dix/input_priv.h"
|
#include "dix/input_priv.h"
|
||||||
#include "mi/mi_priv.h"
|
#include "mi/mi_priv.h"
|
||||||
|
#include "os/log_priv.h"
|
||||||
|
|
||||||
#include "os.h"
|
#include "os.h"
|
||||||
#include "servermd.h"
|
#include "servermd.h"
|
||||||
|
|
|
@ -58,6 +58,7 @@
|
||||||
#include "mi/mi_priv.h"
|
#include "mi/mi_priv.h"
|
||||||
#include "os/cmdline.h"
|
#include "os/cmdline.h"
|
||||||
#include "os/ddx_priv.h"
|
#include "os/ddx_priv.h"
|
||||||
|
#include "os/log_priv.h"
|
||||||
#include "os/osdep.h"
|
#include "os/osdep.h"
|
||||||
|
|
||||||
#include "servermd.h"
|
#include "servermd.h"
|
||||||
|
@ -870,14 +871,14 @@ void
|
||||||
xf86SetVerbosity(int verb)
|
xf86SetVerbosity(int verb)
|
||||||
{
|
{
|
||||||
xf86Verbose = verb;
|
xf86Verbose = verb;
|
||||||
LogSetParameter(XLOG_VERBOSITY, verb);
|
logVerbosity = verb;
|
||||||
}
|
}
|
||||||
|
|
||||||
void
|
void
|
||||||
xf86SetLogVerbosity(int verb)
|
xf86SetLogVerbosity(int verb)
|
||||||
{
|
{
|
||||||
xf86LogVerbose = verb;
|
xf86LogVerbose = verb;
|
||||||
LogSetParameter(XLOG_FILE_VERBOSITY, verb);
|
logFileVerbosity = verb;
|
||||||
}
|
}
|
||||||
|
|
||||||
static void
|
static void
|
||||||
|
|
|
@ -85,6 +85,9 @@
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#include <X11/X.h>
|
#include <X11/X.h>
|
||||||
|
|
||||||
|
#include "os/log_priv.h"
|
||||||
|
|
||||||
#include "xf86Modes.h"
|
#include "xf86Modes.h"
|
||||||
#include "xf86Crtc.h"
|
#include "xf86Crtc.h"
|
||||||
#include "os.h"
|
#include "os.h"
|
||||||
|
|
|
@ -39,6 +39,9 @@
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#include <X11/X.h>
|
#include <X11/X.h>
|
||||||
|
|
||||||
|
#include "os/log_priv.h"
|
||||||
|
|
||||||
#include "os.h"
|
#include "os.h"
|
||||||
#include "xf86.h"
|
#include "xf86.h"
|
||||||
#include "xf86Priv.h"
|
#include "xf86Priv.h"
|
||||||
|
|
|
@ -30,18 +30,17 @@
|
||||||
#include <xorg-config.h>
|
#include <xorg-config.h>
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
#include <X11/X.h>
|
||||||
|
|
||||||
|
#include "os/log_priv.h"
|
||||||
|
|
||||||
#include "misc.h"
|
#include "misc.h"
|
||||||
#include "xf86.h"
|
#include "xf86.h"
|
||||||
|
|
||||||
#include <X11/X.h>
|
|
||||||
#include "scrnintstr.h"
|
#include "scrnintstr.h"
|
||||||
#include "regionstr.h"
|
#include "regionstr.h"
|
||||||
#include "xf86fbman.h"
|
#include "xf86fbman.h"
|
||||||
|
|
||||||
/*
|
|
||||||
#define DEBUG
|
|
||||||
*/
|
|
||||||
|
|
||||||
static DevPrivateKeyRec xf86FBManagerKeyRec;
|
static DevPrivateKeyRec xf86FBManagerKeyRec;
|
||||||
static DevPrivateKey xf86FBManagerKey;
|
static DevPrivateKey xf86FBManagerKey;
|
||||||
|
|
||||||
|
|
|
@ -35,8 +35,11 @@
|
||||||
#include <ctype.h>
|
#include <ctype.h>
|
||||||
#include <stdlib.h>
|
#include <stdlib.h>
|
||||||
#include <unistd.h>
|
#include <unistd.h>
|
||||||
#include <X11/X.h>
|
|
||||||
#include <pciaccess.h>
|
#include <pciaccess.h>
|
||||||
|
#include <X11/X.h>
|
||||||
|
|
||||||
|
#include "os/log_priv.h"
|
||||||
|
|
||||||
#include "os.h"
|
#include "os.h"
|
||||||
#include "Pci.h"
|
#include "Pci.h"
|
||||||
#include "xf86.h"
|
#include "xf86.h"
|
||||||
|
|
|
@ -36,6 +36,8 @@
|
||||||
#include <stdio.h>
|
#include <stdio.h>
|
||||||
#include <string.h>
|
#include <string.h>
|
||||||
|
|
||||||
|
#include "os/log_priv.h"
|
||||||
|
|
||||||
#include "xf86.h"
|
#include "xf86.h"
|
||||||
#include "vbe.h"
|
#include "vbe.h"
|
||||||
#include "vbeModes.h"
|
#include "vbeModes.h"
|
||||||
|
|
|
@ -293,6 +293,15 @@ file verbosity level. When the
|
||||||
value is supplied, the log file verbosity level is set to that value.
|
value is supplied, the log file verbosity level is set to that value.
|
||||||
The default log file verbosity level is 3.
|
The default log file verbosity level is 3.
|
||||||
.TP 8
|
.TP 8
|
||||||
|
.BR \-syslogverbose " [\fIn\fP]"
|
||||||
|
Sets the verbosity level for information printed to syslog. If the
|
||||||
|
.I n
|
||||||
|
value isn't supplied, each occurrence of this option increments the log
|
||||||
|
file verbosity level. When the
|
||||||
|
.I n
|
||||||
|
value is supplied, the log file verbosity level is set to that value.
|
||||||
|
The default log file verbosity level is 0 (silent).
|
||||||
|
.TP 8
|
||||||
.BI \-modulepath " searchpath"
|
.BI \-modulepath " searchpath"
|
||||||
Set the module search path to
|
Set the module search path to
|
||||||
.IR searchpath .
|
.IR searchpath .
|
||||||
|
|
|
@ -10,6 +10,8 @@
|
||||||
#include <fcntl.h>
|
#include <fcntl.h>
|
||||||
#include <errno.h>
|
#include <errno.h>
|
||||||
|
|
||||||
|
#include "os/log_priv.h"
|
||||||
|
|
||||||
#include "os.h"
|
#include "os.h"
|
||||||
#include "xf86.h"
|
#include "xf86.h"
|
||||||
#include "xf86Priv.h"
|
#include "xf86Priv.h"
|
||||||
|
|
|
@ -4,6 +4,9 @@
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#include <X11/X.h>
|
#include <X11/X.h>
|
||||||
|
|
||||||
|
#include "os/log_priv.h"
|
||||||
|
|
||||||
#include "os.h"
|
#include "os.h"
|
||||||
#include "xf86.h"
|
#include "xf86.h"
|
||||||
#include "xf86Priv.h"
|
#include "xf86Priv.h"
|
||||||
|
|
|
@ -59,6 +59,7 @@
|
||||||
#include <errno.h>
|
#include <errno.h>
|
||||||
#include <X11/X.h>
|
#include <X11/X.h>
|
||||||
|
|
||||||
|
#include "os/log_priv.h"
|
||||||
#include "os/xserver_poll.h"
|
#include "os/xserver_poll.h"
|
||||||
|
|
||||||
#include "xf86.h"
|
#include "xf86.h"
|
||||||
|
|
|
@ -16,6 +16,9 @@
|
||||||
#include <unistd.h>
|
#include <unistd.h>
|
||||||
|
|
||||||
#include <X11/X.h>
|
#include <X11/X.h>
|
||||||
|
|
||||||
|
#include "os/log_priv.h"
|
||||||
|
|
||||||
#include "misc.h"
|
#include "misc.h"
|
||||||
|
|
||||||
#include "xf86.h"
|
#include "xf86.h"
|
||||||
|
|
|
@ -23,6 +23,7 @@ is" without express or implied warranty.
|
||||||
#include "dix/screenint_priv.h"
|
#include "dix/screenint_priv.h"
|
||||||
#include "mi/mi_priv.h"
|
#include "mi/mi_priv.h"
|
||||||
#include "os/ddx_priv.h"
|
#include "os/ddx_priv.h"
|
||||||
|
#include "os/log_priv.h"
|
||||||
#include "os/osdep.h"
|
#include "os/osdep.h"
|
||||||
|
|
||||||
#include "screenint.h"
|
#include "screenint.h"
|
||||||
|
|
|
@ -35,6 +35,7 @@
|
||||||
#include <X11/Xproto.h>
|
#include <X11/Xproto.h>
|
||||||
|
|
||||||
#include "os/ddx_priv.h"
|
#include "os/ddx_priv.h"
|
||||||
|
#include "os/log_priv.h"
|
||||||
#include "os/osdep.h"
|
#include "os/osdep.h"
|
||||||
|
|
||||||
#include "os.h"
|
#include "os.h"
|
||||||
|
|
|
@ -30,6 +30,8 @@
|
||||||
#include <drm_fourcc.h>
|
#include <drm_fourcc.h>
|
||||||
#include <wayland-util.h>
|
#include <wayland-util.h>
|
||||||
|
|
||||||
|
#include "os/log_priv.h"
|
||||||
|
|
||||||
#include "xwayland-dmabuf.h"
|
#include "xwayland-dmabuf.h"
|
||||||
#include "xwayland-glamor-gbm.h"
|
#include "xwayland-glamor-gbm.h"
|
||||||
#include "xwayland-screen.h"
|
#include "xwayland-screen.h"
|
||||||
|
|
|
@ -35,6 +35,7 @@
|
||||||
#include "mi/mi_priv.h"
|
#include "mi/mi_priv.h"
|
||||||
#include "mi/mipointer_priv.h"
|
#include "mi/mipointer_priv.h"
|
||||||
#include "os/bug_priv.h"
|
#include "os/bug_priv.h"
|
||||||
|
#include "os/log_priv.h"
|
||||||
|
|
||||||
#include <inputstr.h>
|
#include <inputstr.h>
|
||||||
#include <xkbsrv.h>
|
#include <xkbsrv.h>
|
||||||
|
|
|
@ -32,6 +32,7 @@
|
||||||
#include "dix/dix_priv.h"
|
#include "dix/dix_priv.h"
|
||||||
#include "dix/input_priv.h"
|
#include "dix/input_priv.h"
|
||||||
#include "randr/randrstr_priv.h"
|
#include "randr/randrstr_priv.h"
|
||||||
|
#include "os/log_priv.h"
|
||||||
|
|
||||||
#include "xwayland-cvt.h"
|
#include "xwayland-cvt.h"
|
||||||
#include "xwayland-output.h"
|
#include "xwayland-output.h"
|
||||||
|
|
|
@ -40,6 +40,7 @@
|
||||||
#include "dix/input_priv.h"
|
#include "dix/input_priv.h"
|
||||||
#include "dix/property_priv.h"
|
#include "dix/property_priv.h"
|
||||||
#include "os/client_priv.h"
|
#include "os/client_priv.h"
|
||||||
|
#include "os/log_priv.h"
|
||||||
#include "os/osdep.h"
|
#include "os/osdep.h"
|
||||||
#include "os/xserver_poll.h"
|
#include "os/xserver_poll.h"
|
||||||
|
|
||||||
|
|
|
@ -34,6 +34,7 @@
|
||||||
|
|
||||||
#include "dix/dix_priv.h"
|
#include "dix/dix_priv.h"
|
||||||
#include "dix/property_priv.h"
|
#include "dix/property_priv.h"
|
||||||
|
#include "os/log_priv.h"
|
||||||
|
|
||||||
#include "compositeext.h"
|
#include "compositeext.h"
|
||||||
#include "compint.h"
|
#include "compint.h"
|
||||||
|
|
|
@ -33,6 +33,7 @@
|
||||||
#include "dix/dix_priv.h"
|
#include "dix/dix_priv.h"
|
||||||
#include "dix/input_priv.h"
|
#include "dix/input_priv.h"
|
||||||
#include "os/client_priv.h"
|
#include "os/client_priv.h"
|
||||||
|
#include "os/log_priv.h"
|
||||||
|
|
||||||
#include <inputstr.h>
|
#include <inputstr.h>
|
||||||
#include <inpututils.h>
|
#include <inpututils.h>
|
||||||
|
|
|
@ -41,6 +41,7 @@
|
||||||
#include "os/client_priv.h"
|
#include "os/client_priv.h"
|
||||||
#include "os/ddx_priv.h"
|
#include "os/ddx_priv.h"
|
||||||
#include "os/fmt.h"
|
#include "os/fmt.h"
|
||||||
|
#include "os/log_priv.h"
|
||||||
#include "os/osdep.h"
|
#include "os/osdep.h"
|
||||||
#include "os/xserver_poll.h"
|
#include "os/xserver_poll.h"
|
||||||
|
|
||||||
|
@ -134,7 +135,6 @@ static int init_fd = -1;
|
||||||
static int wm_fd = -1;
|
static int wm_fd = -1;
|
||||||
static int listen_fds[5] = { -1, -1, -1, -1, -1 };
|
static int listen_fds[5] = { -1, -1, -1, -1, -1 };
|
||||||
static int listen_fd_count = 0;
|
static int listen_fd_count = 0;
|
||||||
static int verbosity = 0;
|
|
||||||
|
|
||||||
static void
|
static void
|
||||||
xwl_show_version(void)
|
xwl_show_version(void)
|
||||||
|
@ -237,12 +237,11 @@ ddxProcessArgument(int argc, char *argv[], int i)
|
||||||
|
|
||||||
val = strtol(argv[i], &end, 0);
|
val = strtol(argv[i], &end, 0);
|
||||||
if (*end == '\0') {
|
if (*end == '\0') {
|
||||||
verbosity = val;
|
logVerbosity = val;
|
||||||
LogSetParameter(XLOG_VERBOSITY, verbosity);
|
|
||||||
return 2;
|
return 2;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
LogSetParameter(XLOG_VERBOSITY, ++verbosity);
|
logVerbosity++;
|
||||||
return 1;
|
return 1;
|
||||||
}
|
}
|
||||||
else if (strcmp(argv[i], "-version") == 0) {
|
else if (strcmp(argv[i], "-version") == 0) {
|
||||||
|
|
|
@ -37,6 +37,7 @@ from The Open Group.
|
||||||
#include "dix/dix_priv.h"
|
#include "dix/dix_priv.h"
|
||||||
#include "dix/screenint_priv.h"
|
#include "dix/screenint_priv.h"
|
||||||
#include "os/ddx_priv.h"
|
#include "os/ddx_priv.h"
|
||||||
|
#include "os/log_priv.h"
|
||||||
#include "os/osdep.h"
|
#include "os/osdep.h"
|
||||||
|
|
||||||
#include "winmsg.h"
|
#include "winmsg.h"
|
||||||
|
@ -643,9 +644,8 @@ OsVendorInit(void)
|
||||||
g_pszLogFile = LogInit(g_pszLogFile, ".old");
|
g_pszLogFile = LogInit(g_pszLogFile, ".old");
|
||||||
|
|
||||||
}
|
}
|
||||||
LogSetParameter(XLOG_FLUSH, 1);
|
logVerbosity = 2;
|
||||||
LogSetParameter(XLOG_VERBOSITY, g_iLogVerbose);
|
logFileVerbosity = 2;
|
||||||
LogSetParameter(XLOG_FILE_VERBOSITY, g_iLogVerbose);
|
|
||||||
|
|
||||||
/* Log the version information */
|
/* Log the version information */
|
||||||
if (serverGeneration == 1)
|
if (serverGeneration == 1)
|
||||||
|
|
|
@ -78,6 +78,8 @@
|
||||||
#include <xwin-config.h>
|
#include <xwin-config.h>
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
#include "os/log_priv.h"
|
||||||
|
|
||||||
#include "glwindows.h"
|
#include "glwindows.h"
|
||||||
#include <glx/glxserver.h>
|
#include <glx/glxserver.h>
|
||||||
#include <glx/glxutil.h>
|
#include <glx/glxutil.h>
|
||||||
|
@ -297,7 +299,7 @@ fbConfigsDump(unsigned int n, __GLXconfig * c, PixelFormatRejectStats *rejects)
|
||||||
LogMessage(X_INFO, "ignored pixel formats: %d not OpenGL, %d unknown pixel type, %d unaccelerated\n",
|
LogMessage(X_INFO, "ignored pixel formats: %d not OpenGL, %d unknown pixel type, %d unaccelerated\n",
|
||||||
rejects->notOpenGL, rejects->unknownPixelType, rejects->unaccelerated);
|
rejects->notOpenGL, rejects->unknownPixelType, rejects->unaccelerated);
|
||||||
|
|
||||||
if (g_iLogVerbose < 3)
|
if (logVerbosity < 3)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
ErrorF
|
ErrorF
|
||||||
|
@ -572,7 +574,7 @@ glxWinScreenProbe(ScreenPtr pScreen)
|
||||||
if (!wgl_extensions)
|
if (!wgl_extensions)
|
||||||
wgl_extensions = "";
|
wgl_extensions = "";
|
||||||
|
|
||||||
if (g_iLogVerbose >= 3) {
|
if (logVerbosity >= 3) {
|
||||||
glxLogExtensions("GL_EXTENSIONS: ", gl_extensions);
|
glxLogExtensions("GL_EXTENSIONS: ", gl_extensions);
|
||||||
glxLogExtensions("WGL_EXTENSIONS: ", wgl_extensions);
|
glxLogExtensions("WGL_EXTENSIONS: ", wgl_extensions);
|
||||||
}
|
}
|
||||||
|
|
|
@ -109,7 +109,7 @@ srcs_windows += [
|
||||||
|
|
||||||
rsrc = windows.compile_resources(
|
rsrc = windows.compile_resources(
|
||||||
'XWin.rc',
|
'XWin.rc',
|
||||||
include_directories: include_directories('../../include/'),
|
include_directories: include_directories('../../include/', '../..'),
|
||||||
depend_files: ['XWin.exe.manifest', 'X.ico'],
|
depend_files: ['XWin.exe.manifest', 'X.ico'],
|
||||||
)
|
)
|
||||||
srcs_windows += rsrc
|
srcs_windows += rsrc
|
||||||
|
|
|
@ -32,6 +32,7 @@
|
||||||
#include <xwin-config.h>
|
#include <xwin-config.h>
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
#include "os/log_priv.h"
|
||||||
#include "os/osdep.h"
|
#include "os/osdep.h"
|
||||||
|
|
||||||
#include <../xfree86/common/xorgVersion.h>
|
#include <../xfree86/common/xorgVersion.h>
|
||||||
|
|
|
@ -69,7 +69,6 @@ const char *g_pszLogFile = DEFAULT_LOGDIR "/XWin.%s.log";
|
||||||
const char *g_pszLogFile = "XWin.log";
|
const char *g_pszLogFile = "XWin.log";
|
||||||
Bool g_fLogFileChanged = FALSE;
|
Bool g_fLogFileChanged = FALSE;
|
||||||
#endif
|
#endif
|
||||||
int g_iLogVerbose = 2;
|
|
||||||
Bool g_fLogInited = FALSE;
|
Bool g_fLogInited = FALSE;
|
||||||
char *g_pszCommandLine = NULL;
|
char *g_pszCommandLine = NULL;
|
||||||
Bool g_fSilentFatalError = FALSE;
|
Bool g_fSilentFatalError = FALSE;
|
||||||
|
|
|
@ -45,7 +45,6 @@ extern const char *g_pszLogFile;
|
||||||
#ifdef RELOCATE_PROJECTROOT
|
#ifdef RELOCATE_PROJECTROOT
|
||||||
extern Bool g_fLogFileChanged;
|
extern Bool g_fLogFileChanged;
|
||||||
#endif
|
#endif
|
||||||
extern int g_iLogVerbose;
|
|
||||||
extern Bool g_fLogInited;
|
extern Bool g_fLogInited;
|
||||||
|
|
||||||
extern Bool g_fAuthEnabled;
|
extern Bool g_fAuthEnabled;
|
||||||
|
|
|
@ -36,8 +36,9 @@ from The Open Group.
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#include "os/cmdline.h"
|
#include "os/cmdline.h"
|
||||||
#include "os/osdep.h"
|
|
||||||
#include "os/ddx_priv.h"
|
#include "os/ddx_priv.h"
|
||||||
|
#include "os/log_priv.h"
|
||||||
|
#include "os/osdep.h"
|
||||||
|
|
||||||
#include <../xfree86/common/xorgVersion.h>
|
#include <../xfree86/common/xorgVersion.h>
|
||||||
#include "win.h"
|
#include "win.h"
|
||||||
|
@ -996,7 +997,7 @@ ddxProcessArgument(int argc, char *argv[], int i)
|
||||||
*/
|
*/
|
||||||
if (IS_OPTION("-logverbose")) {
|
if (IS_OPTION("-logverbose")) {
|
||||||
CHECK_ARGS(1);
|
CHECK_ARGS(1);
|
||||||
g_iLogVerbose = atoi(argv[++i]);
|
logVerbosity = atoi(argv[++i]);
|
||||||
return 2;
|
return 2;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -333,15 +333,6 @@ conf_data.set('WSCONS_SUPPORT', supports_wscons ? '1' : false)
|
||||||
conf_data.set('XSERVER_LIBPCIACCESS', get_option('pciaccess') ? '1' : false)
|
conf_data.set('XSERVER_LIBPCIACCESS', get_option('pciaccess') ? '1' : false)
|
||||||
conf_data.set('XSERVER_PLATFORM_BUS', build_udev_kms ? '1' : false)
|
conf_data.set('XSERVER_PLATFORM_BUS', build_udev_kms ? '1' : false)
|
||||||
|
|
||||||
configure_file(output : 'dix-config.h',
|
|
||||||
configuration : conf_data)
|
|
||||||
|
|
||||||
configure_file(output : 'xorg-server.h',
|
|
||||||
input : 'xorg-server.h.meson.in',
|
|
||||||
configuration : conf_data,
|
|
||||||
install: build_xorg,
|
|
||||||
install_dir: xorgsdkdir)
|
|
||||||
|
|
||||||
version_data = configuration_data()
|
version_data = configuration_data()
|
||||||
version_data.set('VENDOR_RELEASE', '@0@'.format(release))
|
version_data.set('VENDOR_RELEASE', '@0@'.format(release))
|
||||||
version_data.set_quoted('VENDOR_NAME', get_option('vendor_name'))
|
version_data.set_quoted('VENDOR_NAME', get_option('vendor_name'))
|
||||||
|
|
28
include/os.h
28
include/os.h
|
@ -280,14 +280,6 @@ extern _X_EXPORT int
|
||||||
timingsafe_memcmp(const void *b1, const void *b2, size_t len);
|
timingsafe_memcmp(const void *b1, const void *b2, size_t len);
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
/* Logging. */
|
|
||||||
typedef enum _LogParameter {
|
|
||||||
XLOG_FLUSH,
|
|
||||||
XLOG_SYNC,
|
|
||||||
XLOG_VERBOSITY,
|
|
||||||
XLOG_FILE_VERBOSITY
|
|
||||||
} LogParameter;
|
|
||||||
|
|
||||||
/* Flags for log messages. */
|
/* Flags for log messages. */
|
||||||
typedef enum {
|
typedef enum {
|
||||||
X_PROBED, /* Value was probed */
|
X_PROBED, /* Value was probed */
|
||||||
|
@ -304,14 +296,6 @@ typedef enum {
|
||||||
X_UNKNOWN = -1 /* unknown -- this must always be last */
|
X_UNKNOWN = -1 /* unknown -- this must always be last */
|
||||||
} MessageType;
|
} MessageType;
|
||||||
|
|
||||||
extern _X_EXPORT const char *
|
|
||||||
LogInit(const char *fname, const char *backup);
|
|
||||||
extern void
|
|
||||||
LogSetDisplay(void);
|
|
||||||
extern _X_EXPORT void
|
|
||||||
LogClose(enum ExitCode error);
|
|
||||||
extern _X_EXPORT Bool
|
|
||||||
LogSetParameter(LogParameter param, int value);
|
|
||||||
extern _X_EXPORT void
|
extern _X_EXPORT void
|
||||||
LogVMessageVerb(MessageType type, int verb, const char *format, va_list args)
|
LogVMessageVerb(MessageType type, int verb, const char *format, va_list args)
|
||||||
_X_ATTRIBUTE_PRINTF(3, 0);
|
_X_ATTRIBUTE_PRINTF(3, 0);
|
||||||
|
@ -322,7 +306,7 @@ extern _X_EXPORT void
|
||||||
LogMessage(MessageType type, const char *format, ...)
|
LogMessage(MessageType type, const char *format, ...)
|
||||||
_X_ATTRIBUTE_PRINTF(2, 3);
|
_X_ATTRIBUTE_PRINTF(2, 3);
|
||||||
|
|
||||||
extern _X_EXPORT void
|
void
|
||||||
LogVHdrMessageVerb(MessageType type, int verb,
|
LogVHdrMessageVerb(MessageType type, int verb,
|
||||||
const char *msg_format, va_list msg_args,
|
const char *msg_format, va_list msg_args,
|
||||||
const char *hdr_format, va_list hdr_args)
|
const char *hdr_format, va_list hdr_args)
|
||||||
|
@ -340,17 +324,11 @@ FatalError(const char *f, ...)
|
||||||
_X_ATTRIBUTE_PRINTF(1, 2)
|
_X_ATTRIBUTE_PRINTF(1, 2)
|
||||||
_X_NORETURN;
|
_X_NORETURN;
|
||||||
|
|
||||||
#ifdef DEBUG
|
|
||||||
#define DebugF ErrorF
|
|
||||||
#else
|
|
||||||
#define DebugF(...) /* */
|
|
||||||
#endif
|
|
||||||
|
|
||||||
extern _X_EXPORT void
|
extern _X_EXPORT void
|
||||||
ErrorF(const char *f, ...)
|
ErrorF(const char *f, ...)
|
||||||
_X_ATTRIBUTE_PRINTF(1, 2);
|
_X_ATTRIBUTE_PRINTF(1, 2);
|
||||||
extern _X_EXPORT void
|
|
||||||
LogPrintMarkers(void);
|
void LogPrintMarkers(void);
|
||||||
|
|
||||||
extern _X_EXPORT void
|
extern _X_EXPORT void
|
||||||
xorg_backtrace(void);
|
xorg_backtrace(void);
|
||||||
|
|
11
meson.build
11
meson.build
|
@ -924,3 +924,14 @@ if build_docs or build_docs_devel
|
||||||
configuration: docxmlconfig
|
configuration: docxmlconfig
|
||||||
)
|
)
|
||||||
endif
|
endif
|
||||||
|
|
||||||
|
# finally write config files. doing that very late, so other subdirs still
|
||||||
|
# have a change to add config items
|
||||||
|
configure_file(output : 'dix-config.h',
|
||||||
|
configuration : conf_data)
|
||||||
|
|
||||||
|
configure_file(output : 'xorg-server.h',
|
||||||
|
input : 'include/xorg-server.h.meson.in',
|
||||||
|
configuration : conf_data,
|
||||||
|
install: build_xorg,
|
||||||
|
install_dir: xorgsdkdir)
|
||||||
|
|
|
@ -87,6 +87,7 @@
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#include "os/auth.h"
|
#include "os/auth.h"
|
||||||
|
#include "os/log_priv.h"
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Try to determine a PID for a client from its connection
|
* Try to determine a PID for a client from its connection
|
||||||
|
|
|
@ -0,0 +1,32 @@
|
||||||
|
/* SPDX-License-Identifier: MIT OR X11
|
||||||
|
*
|
||||||
|
* Copyright © 2024 Enrico Weigelt, metux IT consult <info@metux.net>
|
||||||
|
*
|
||||||
|
* @brief command line helper functions
|
||||||
|
*/
|
||||||
|
|
||||||
|
#include <dix-config.h>
|
||||||
|
|
||||||
|
#include <string.h>
|
||||||
|
#include <stdlib.h>
|
||||||
|
|
||||||
|
#include "os/cmdline.h"
|
||||||
|
|
||||||
|
int ProcessCmdLineMultiInt(int argc, char *argv[], int *idx, const char* name, int *value)
|
||||||
|
{
|
||||||
|
if (strcmp(argv[*idx], name))
|
||||||
|
return 0;
|
||||||
|
|
||||||
|
int i2 = *idx+1;
|
||||||
|
if (i2 < argc && argv[i2]) {
|
||||||
|
char *end;
|
||||||
|
long val = strtol(argv[i2], &end, 0);
|
||||||
|
if (*end == '\0') {
|
||||||
|
(*idx)++;
|
||||||
|
(*value) = val;
|
||||||
|
return 1;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
(*value)++;
|
||||||
|
return 1;
|
||||||
|
}
|
15
os/cmdline.h
15
os/cmdline.h
|
@ -17,4 +17,19 @@ void UseMsg(void);
|
||||||
void ProcessCommandLine(int argc, char * argv[]);
|
void ProcessCommandLine(int argc, char * argv[]);
|
||||||
void CheckUserParameters(int argc, char **argv, char **envp);
|
void CheckUserParameters(int argc, char **argv, char **envp);
|
||||||
|
|
||||||
|
/*
|
||||||
|
* @brief check for and parse an counting-flag or value-flag option
|
||||||
|
*
|
||||||
|
* Parses an option that may either be used for setting an integer value or
|
||||||
|
* given one or multiple times (without argument) to increase an value
|
||||||
|
*
|
||||||
|
* @param argc total number of elements in argv
|
||||||
|
* @param argv array of pointers to cmdline argument strings
|
||||||
|
* @param idx pointer to current index in argv -- eventually will be modified
|
||||||
|
* @param name the command line argument name
|
||||||
|
* @param value pointer to the field holding the setting value
|
||||||
|
* @return non-zero if the flag was found and parsed
|
||||||
|
*/
|
||||||
|
int ProcessCmdLineMultiInt(int argc, char *argv[], int *idx, const char* name, int *value);
|
||||||
|
|
||||||
#endif /* _XSERVER_OS_CMELINE_H */
|
#endif /* _XSERVER_OS_CMELINE_H */
|
||||||
|
|
|
@ -98,6 +98,7 @@ SOFTWARE.
|
||||||
#include "os/audit.h"
|
#include "os/audit.h"
|
||||||
#include "os/auth.h"
|
#include "os/auth.h"
|
||||||
#include "os/client_priv.h"
|
#include "os/client_priv.h"
|
||||||
|
#include "os/log_priv.h"
|
||||||
#include "os/osdep.h"
|
#include "os/osdep.h"
|
||||||
|
|
||||||
#include "misc.h" /* for typedef of pointer */
|
#include "misc.h" /* for typedef of pointer */
|
||||||
|
|
|
@ -35,6 +35,7 @@
|
||||||
|
|
||||||
#include "dix/input_priv.h"
|
#include "dix/input_priv.h"
|
||||||
#include "os/ddx_priv.h"
|
#include "os/ddx_priv.h"
|
||||||
|
#include "os/log_priv.h"
|
||||||
|
|
||||||
#include "inputstr.h"
|
#include "inputstr.h"
|
||||||
#include "opaque.h"
|
#include "opaque.h"
|
||||||
|
|
118
os/log.c
118
os/log.c
|
@ -88,12 +88,17 @@ OR PERFORMANCE OF THIS SOFTWARE.
|
||||||
#include <X11/Xfuncproto.h>
|
#include <X11/Xfuncproto.h>
|
||||||
#include <X11/Xos.h>
|
#include <X11/Xos.h>
|
||||||
|
|
||||||
|
#ifdef CONFIG_SYSLOG
|
||||||
|
#include <syslog.h>
|
||||||
|
#endif
|
||||||
|
|
||||||
#include "dix/dix_priv.h"
|
#include "dix/dix_priv.h"
|
||||||
#include "dix/input_priv.h"
|
#include "dix/input_priv.h"
|
||||||
#include "os/audit.h"
|
#include "os/audit.h"
|
||||||
#include "os/bug_priv.h"
|
#include "os/bug_priv.h"
|
||||||
#include "os/ddx_priv.h"
|
#include "os/ddx_priv.h"
|
||||||
#include "os/fmt.h"
|
#include "os/fmt.h"
|
||||||
|
#include "os/log_priv.h"
|
||||||
#include "os/osdep.h"
|
#include "os/osdep.h"
|
||||||
|
|
||||||
#include "opaque.h"
|
#include "opaque.h"
|
||||||
|
@ -109,13 +114,18 @@ OR PERFORMANCE OF THIS SOFTWARE.
|
||||||
/* Default logging parameters. */
|
/* Default logging parameters. */
|
||||||
#define DEFAULT_LOG_VERBOSITY 0
|
#define DEFAULT_LOG_VERBOSITY 0
|
||||||
#define DEFAULT_LOG_FILE_VERBOSITY 3
|
#define DEFAULT_LOG_FILE_VERBOSITY 3
|
||||||
|
#define DEFAULT_SYSLOG_VERBOSITY 0
|
||||||
|
|
||||||
|
Bool logSync = FALSE;
|
||||||
|
int logVerbosity = DEFAULT_LOG_VERBOSITY;
|
||||||
|
int logFileVerbosity = DEFAULT_LOG_FILE_VERBOSITY;
|
||||||
|
|
||||||
|
#ifdef CONFIG_SYSLOG
|
||||||
|
int xorgSyslogVerbosity = DEFAULT_SYSLOG_VERBOSITY;
|
||||||
|
const char *xorgSyslogIdent = "X";
|
||||||
|
#endif
|
||||||
|
|
||||||
static FILE *logFile = NULL;
|
|
||||||
static int logFileFd = -1;
|
static int logFileFd = -1;
|
||||||
static Bool logFlush = FALSE;
|
|
||||||
static Bool logSync = FALSE;
|
|
||||||
static int logVerbosity = DEFAULT_LOG_VERBOSITY;
|
|
||||||
static int logFileVerbosity = 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;
|
||||||
|
@ -201,6 +211,24 @@ LogFilePrep(const char *fname, const char *backup, const char *idstring)
|
||||||
}
|
}
|
||||||
#pragma GCC diagnostic pop
|
#pragma GCC diagnostic pop
|
||||||
|
|
||||||
|
static inline void doLogSync(void) {
|
||||||
|
#ifndef WIN32
|
||||||
|
fsync(logFileFd);
|
||||||
|
#endif
|
||||||
|
}
|
||||||
|
|
||||||
|
static void initSyslog(void) {
|
||||||
|
#ifdef CONFIG_SYSLOG
|
||||||
|
char buffer[4096];
|
||||||
|
strcpy(buffer, xorgSyslogIdent);
|
||||||
|
|
||||||
|
snprintf(buffer, sizeof(buffer), "%s :%s", xorgSyslogIdent, (display ? display : "<>"));
|
||||||
|
|
||||||
|
/* initialize syslog */
|
||||||
|
openlog(buffer, LOG_PID, LOG_LOCAL1);
|
||||||
|
#endif
|
||||||
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* LogInit is called to start logging to a file. It is also called (with
|
* LogInit is called to start logging to a file. It is also called (with
|
||||||
* NULL arguments) when logging to a file is not wanted. It must always be
|
* NULL arguments) when logging to a file is not wanted. It must always be
|
||||||
|
@ -236,19 +264,14 @@ LogInit(const char *fname, const char *backup)
|
||||||
saved_log_backup = strdup(backup);
|
saved_log_backup = strdup(backup);
|
||||||
} else
|
} else
|
||||||
logFileName = LogFilePrep(fname, backup, display);
|
logFileName = LogFilePrep(fname, backup, display);
|
||||||
if ((logFile = fopen(logFileName, "w")) == NULL)
|
|
||||||
FatalError("Cannot open log file \"%s\"\n", logFileName);
|
|
||||||
setvbuf(logFile, NULL, _IONBF, 0);
|
|
||||||
|
|
||||||
logFileFd = fileno(logFile);
|
if ((logFileFd = open(logFileName, O_WRONLY | O_CREAT, S_IRUSR|S_IWUSR|S_IRGRP)) == -1)
|
||||||
|
FatalError("Cannot open log file \"%s\": %s\n", logFileName, strerror(errno));
|
||||||
|
|
||||||
/* Flush saved log information. */
|
/* Flush saved log information. */
|
||||||
if (saveBuffer && bufferSize > 0) {
|
if (saveBuffer && bufferSize > 0) {
|
||||||
fwrite(saveBuffer, bufferPos, 1, logFile);
|
write(logFileFd, saveBuffer, bufferPos);
|
||||||
fflush(logFile);
|
doLogSync();
|
||||||
#ifndef WIN32
|
|
||||||
fsync(fileno(logFile));
|
|
||||||
#endif
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -263,6 +286,7 @@ LogInit(const char *fname, const char *backup)
|
||||||
}
|
}
|
||||||
needBuffer = FALSE;
|
needBuffer = FALSE;
|
||||||
|
|
||||||
|
initSyslog();
|
||||||
return logFileName;
|
return logFileName;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -294,44 +318,23 @@ LogSetDisplay(void)
|
||||||
free(saved_log_fname);
|
free(saved_log_fname);
|
||||||
free(saved_log_backup);
|
free(saved_log_backup);
|
||||||
}
|
}
|
||||||
|
initSyslog();
|
||||||
}
|
}
|
||||||
|
|
||||||
void
|
void
|
||||||
LogClose(enum ExitCode error)
|
LogClose(enum ExitCode error)
|
||||||
{
|
{
|
||||||
if (logFile) {
|
if (logFileFd != -1) {
|
||||||
int msgtype = (error == EXIT_NO_ERROR) ? X_INFO : X_ERROR;
|
int msgtype = (error == EXIT_NO_ERROR) ? X_INFO : X_ERROR;
|
||||||
LogMessageVerb(msgtype, -1,
|
LogMessageVerb(msgtype, -1,
|
||||||
"Server terminated %s (%d). Closing log file.\n",
|
"Server terminated %s (%d). Closing log file.\n",
|
||||||
(error == EXIT_NO_ERROR) ? "successfully" : "with error",
|
(error == EXIT_NO_ERROR) ? "successfully" : "with error",
|
||||||
error);
|
error);
|
||||||
fclose(logFile);
|
close(logFileFd);
|
||||||
logFile = NULL;
|
|
||||||
logFileFd = -1;
|
logFileFd = -1;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
Bool
|
|
||||||
LogSetParameter(LogParameter param, int value)
|
|
||||||
{
|
|
||||||
switch (param) {
|
|
||||||
case XLOG_FLUSH:
|
|
||||||
logFlush = value ? TRUE : FALSE;
|
|
||||||
return TRUE;
|
|
||||||
case XLOG_SYNC:
|
|
||||||
logSync = value ? TRUE : FALSE;
|
|
||||||
return TRUE;
|
|
||||||
case XLOG_VERBOSITY:
|
|
||||||
logVerbosity = value;
|
|
||||||
return TRUE;
|
|
||||||
case XLOG_FILE_VERBOSITY:
|
|
||||||
logFileVerbosity = value;
|
|
||||||
return TRUE;
|
|
||||||
default:
|
|
||||||
return FALSE;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
enum {
|
enum {
|
||||||
LMOD_LONG = 0x1,
|
LMOD_LONG = 0x1,
|
||||||
LMOD_LONGLONG = 0x2,
|
LMOD_LONGLONG = 0x2,
|
||||||
|
@ -550,6 +553,19 @@ vpnprintf(char *string, int size_in, const char *f, va_list args)
|
||||||
return s_idx;
|
return s_idx;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
static void
|
||||||
|
LogSyslogWrite(int verb, const char *buf, size_t len, Bool end_line) {
|
||||||
|
#ifdef CONFIG_SYSLOG
|
||||||
|
if (inSignalContext) // syslog() ins't signal-safe yet :(
|
||||||
|
return; // shall we try syslog(2) syscall instead ?
|
||||||
|
|
||||||
|
if (verb >= 0 && xorgSyslogVerbosity < verb)
|
||||||
|
return;
|
||||||
|
|
||||||
|
syslog(LOG_PID, "%.*s", (int)len, buf);
|
||||||
|
#endif
|
||||||
|
}
|
||||||
|
|
||||||
/* This function does the actual log message writes. It must be signal safe.
|
/* This function does the actual log message writes. It must be signal safe.
|
||||||
* When attempting to call non-signal-safe functions, guard them with a check
|
* When attempting to call non-signal-safe functions, guard them with a check
|
||||||
* of the inSignalContext global variable. */
|
* of the inSignalContext global variable. */
|
||||||
|
@ -559,37 +575,31 @@ LogSWrite(int verb, const char *buf, size_t len, Bool end_line)
|
||||||
static Bool newline = TRUE;
|
static Bool newline = TRUE;
|
||||||
int ret;
|
int ret;
|
||||||
|
|
||||||
|
LogSyslogWrite(verb, buf, len, end_line);
|
||||||
|
|
||||||
if (verb < 0 || logVerbosity >= verb)
|
if (verb < 0 || logVerbosity >= verb)
|
||||||
ret = write(2, buf, len);
|
ret = write(2, buf, len);
|
||||||
|
|
||||||
if (verb < 0 || logFileVerbosity >= verb) {
|
if (verb < 0 || logFileVerbosity >= verb) {
|
||||||
if (inSignalContext && logFileFd >= 0) {
|
if (inSignalContext && logFileFd >= 0) {
|
||||||
ret = write(logFileFd, buf, len);
|
ret = write(logFileFd, buf, len);
|
||||||
#ifndef WIN32
|
if (logSync)
|
||||||
if (logFlush && logSync)
|
doLogSync();
|
||||||
fsync(logFileFd);
|
|
||||||
#endif
|
|
||||||
}
|
}
|
||||||
else if (!inSignalContext && logFile) {
|
else if (!inSignalContext && logFileFd != -1) {
|
||||||
if (newline) {
|
if (newline) {
|
||||||
time_t t = time(NULL);
|
time_t t = time(NULL);
|
||||||
struct tm tm;
|
struct tm tm;
|
||||||
char fmt_tm[32];
|
char fmt_tm[32];
|
||||||
|
|
||||||
localtime_r(&t, &tm);
|
localtime_r(&t, &tm);
|
||||||
strftime(fmt_tm, sizeof(fmt_tm) - 1, "%Y-%m-%d %H:%M:%S", &tm);
|
strftime(fmt_tm, sizeof(fmt_tm) - 1, "[%Y-%m-%d %H:%M:%S] ", &tm);
|
||||||
|
write(logFileFd, fmt_tm, strlen(fmt_tm));
|
||||||
fprintf(logFile, "[%s] ", fmt_tm);
|
|
||||||
}
|
}
|
||||||
newline = end_line;
|
newline = end_line;
|
||||||
fwrite(buf, len, 1, logFile);
|
write(logFileFd, buf, len);
|
||||||
if (logFlush) {
|
if (logSync)
|
||||||
fflush(logFile);
|
doLogSync();
|
||||||
#ifndef WIN32
|
|
||||||
if (logSync)
|
|
||||||
fsync(fileno(logFile));
|
|
||||||
#endif
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
else if (!inSignalContext && needBuffer) {
|
else if (!inSignalContext && needBuffer) {
|
||||||
if (len > bufferUnused) {
|
if (len > bufferUnused) {
|
||||||
|
|
|
@ -0,0 +1,95 @@
|
||||||
|
/* SPDX-License-Identifier: MIT OR X11
|
||||||
|
*
|
||||||
|
* Copyright © 2024 Enrico Weigelt, metux IT consult <info@metux.net>
|
||||||
|
*/
|
||||||
|
#ifndef _XSERVER_LOG_PRIV_H
|
||||||
|
#define _XSERVER_LOG_PRIV_H
|
||||||
|
|
||||||
|
#include <sys/types.h>
|
||||||
|
#include <X11/Xdefs.h>
|
||||||
|
|
||||||
|
#include "include/os.h"
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @brief force fsync() on each log write
|
||||||
|
*
|
||||||
|
* If set to TRUE, force fsync() on each log write.
|
||||||
|
*/
|
||||||
|
extern Bool logSync;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @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 logVerbosity;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @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 logFileVerbosity;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @brief syslog verbosity
|
||||||
|
*
|
||||||
|
* The verbosity level of logging to syslog. All messages with
|
||||||
|
* verbosity level below this one will be sent to local syslog daemon.
|
||||||
|
*/
|
||||||
|
extern int xorgSyslogVerbosity;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @brief syslog identifier
|
||||||
|
*
|
||||||
|
* The identifier prefix used for syslog logging.
|
||||||
|
* Per default will be filled with basename(argv[0]). DDX'es can override
|
||||||
|
* this before calling LogInit()
|
||||||
|
*/
|
||||||
|
extern const char *xorgSyslogIdent;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @brief initialize logging and open log files
|
||||||
|
*
|
||||||
|
* Make backup of existing log file, create a new one and open it for logging.
|
||||||
|
*
|
||||||
|
* - May be called with NULL or "", if no logging is desired.
|
||||||
|
*
|
||||||
|
* - Must always be called, otherwise log messages will fill up the buffer and
|
||||||
|
* let it grow infinitely.
|
||||||
|
*
|
||||||
|
* - if "%s" is present in fname, it will be replaced with the display string or pid
|
||||||
|
*
|
||||||
|
* @param fname log file name template. if NULL, dont write any log.
|
||||||
|
* @param backup name for the old logfile.
|
||||||
|
* @return new log file name
|
||||||
|
*/
|
||||||
|
const char* LogInit(const char *fname, const char *backup);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @brief rename the current log file according display name
|
||||||
|
*
|
||||||
|
* Renames the current log file with per display prefix (e.g. "Xorg.log.0")
|
||||||
|
*
|
||||||
|
*/
|
||||||
|
void LogSetDisplay(void);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @brief log exit code, then flush and close log file and write
|
||||||
|
*
|
||||||
|
* Logs the exit code (and success/error state), then flush and close log file.
|
||||||
|
*/
|
||||||
|
void LogClose(enum ExitCode error);
|
||||||
|
|
||||||
|
#ifdef DEBUG
|
||||||
|
/**
|
||||||
|
* @brief log debug messages (like errors) if symbol DEBUG is defined
|
||||||
|
*/
|
||||||
|
#define DebugF ErrorF
|
||||||
|
#else
|
||||||
|
#define DebugF(...) /* */
|
||||||
|
#endif
|
||||||
|
|
||||||
|
#endif /* _XSERVER_LOG_PRIV_H */
|
|
@ -5,6 +5,7 @@ srcs_os = [
|
||||||
'auth.c',
|
'auth.c',
|
||||||
'backtrace.c',
|
'backtrace.c',
|
||||||
'client.c',
|
'client.c',
|
||||||
|
'cmdline.c',
|
||||||
'connection.c',
|
'connection.c',
|
||||||
'fmt.c',
|
'fmt.c',
|
||||||
'inputthread.c',
|
'inputthread.c',
|
||||||
|
@ -22,6 +23,8 @@ srcs_os = [
|
||||||
'log.c',
|
'log.c',
|
||||||
]
|
]
|
||||||
|
|
||||||
|
conf_data.set('CONFIG_SYSLOG', cc.has_header('syslog.h') ? '1' : false)
|
||||||
|
|
||||||
# Wrapper code for missing C library functions. Note that conf_data contains either '1' or false.
|
# Wrapper code for missing C library functions. Note that conf_data contains either '1' or false.
|
||||||
srcs_libc = []
|
srcs_libc = []
|
||||||
if conf_data.get('HAVE_REALLOCARRAY').to_int() == 0
|
if conf_data.get('HAVE_REALLOCARRAY').to_int() == 0
|
||||||
|
|
|
@ -60,6 +60,7 @@ SOFTWARE.
|
||||||
|
|
||||||
#include "dix/dix_priv.h"
|
#include "dix/dix_priv.h"
|
||||||
#include "os/busfault.h"
|
#include "os/busfault.h"
|
||||||
|
#include "os/log_priv.h"
|
||||||
#include "os/osdep.h"
|
#include "os/osdep.h"
|
||||||
#include "os/serverlock.h"
|
#include "os/serverlock.h"
|
||||||
|
|
||||||
|
|
15
os/utils.c
15
os/utils.c
|
@ -77,8 +77,7 @@ __stdcall unsigned long GetTickCount(void);
|
||||||
#define TRANS_REOPEN
|
#define TRANS_REOPEN
|
||||||
#include <X11/Xtrans/Xtrans.h>
|
#include <X11/Xtrans/Xtrans.h>
|
||||||
|
|
||||||
#include "os/audit.h"
|
#include <libgen.h>
|
||||||
#include "os/client_priv.h"
|
|
||||||
|
|
||||||
#include "input.h"
|
#include "input.h"
|
||||||
#include "dixfont.h"
|
#include "dixfont.h"
|
||||||
|
@ -106,10 +105,13 @@ __stdcall unsigned long GetTickCount(void);
|
||||||
|
|
||||||
#include "dix/dix_priv.h"
|
#include "dix/dix_priv.h"
|
||||||
#include "dix/input_priv.h"
|
#include "dix/input_priv.h"
|
||||||
|
#include "os/audit.h"
|
||||||
#include "os/auth.h"
|
#include "os/auth.h"
|
||||||
#include "os/bug_priv.h"
|
#include "os/bug_priv.h"
|
||||||
|
#include "os/client_priv.h"
|
||||||
#include "os/cmdline.h"
|
#include "os/cmdline.h"
|
||||||
#include "os/ddx_priv.h"
|
#include "os/ddx_priv.h"
|
||||||
|
#include "os/log_priv.h"
|
||||||
#include "os/osdep.h"
|
#include "os/osdep.h"
|
||||||
#include "os/serverlock.h"
|
#include "os/serverlock.h"
|
||||||
|
|
||||||
|
@ -439,6 +441,12 @@ ProcessCommandLine(int argc, char *argv[])
|
||||||
}
|
}
|
||||||
SeatId = getenv("XDG_SEAT");
|
SeatId = getenv("XDG_SEAT");
|
||||||
|
|
||||||
|
#ifdef CONFIG_SYSLOG
|
||||||
|
xorgSyslogIdent = getenv("SYSLOG_IDENT");
|
||||||
|
if (!xorgSyslogIdent)
|
||||||
|
xorgSyslogIdent = strdup(basename(argv[0]));
|
||||||
|
#endif
|
||||||
|
|
||||||
for (i = 1; i < argc; i++) {
|
for (i = 1; i < argc; i++) {
|
||||||
/* call ddx first, so it can peek/override if it wants */
|
/* call ddx first, so it can peek/override if it wants */
|
||||||
if ((skip = ddxProcessArgument(argc, argv, i))) {
|
if ((skip = ddxProcessArgument(argc, argv, i))) {
|
||||||
|
@ -805,6 +813,9 @@ ProcessCommandLine(int argc, char *argv[])
|
||||||
else
|
else
|
||||||
UseMsg();
|
UseMsg();
|
||||||
}
|
}
|
||||||
|
#ifdef CONFIG_SYSLOG
|
||||||
|
else if (ProcessCmdLineMultiInt(argc, argv, &i, "-syslogverbose", &xorgSyslogVerbosity));
|
||||||
|
#endif
|
||||||
else {
|
else {
|
||||||
ErrorF("Unrecognized option: %s\n", argv[i]);
|
ErrorF("Unrecognized option: %s\n", argv[i]);
|
||||||
UseMsg();
|
UseMsg();
|
||||||
|
|
|
@ -30,6 +30,7 @@
|
||||||
#include <unistd.h>
|
#include <unistd.h>
|
||||||
|
|
||||||
#include "os/fmt.h"
|
#include "os/fmt.h"
|
||||||
|
#include "os/log_priv.h"
|
||||||
|
|
||||||
#include "assert.h"
|
#include "assert.h"
|
||||||
#include "misc.h"
|
#include "misc.h"
|
||||||
|
@ -149,7 +150,7 @@ number_formatting(void)
|
||||||
-0x7FFFFFFFFFFFFFFF, /* Maximum 64-bit signed number */
|
-0x7FFFFFFFFFFFFFFF, /* Maximum 64-bit signed number */
|
||||||
} ;
|
} ;
|
||||||
|
|
||||||
LogSetParameter(XLOG_VERBOSITY, -1);
|
logVerbosity = -1;
|
||||||
|
|
||||||
for (i = 0; i < ARRAY_SIZE(unsigned_tests); i++)
|
for (i = 0; i < ARRAY_SIZE(unsigned_tests); i++)
|
||||||
assert(check_number_format_test(unsigned_tests[i]));
|
assert(check_number_format_test(unsigned_tests[i]));
|
||||||
|
@ -181,7 +182,7 @@ static void logging_format(void)
|
||||||
uintptr_t ptr;
|
uintptr_t ptr;
|
||||||
char *fname = NULL;
|
char *fname = NULL;
|
||||||
|
|
||||||
LogSetParameter(XLOG_VERBOSITY, -1);
|
logVerbosity = -1;
|
||||||
|
|
||||||
/* set up buf to contain ".....end" */
|
/* set up buf to contain ".....end" */
|
||||||
memset(buf, '.', sizeof(buf));
|
memset(buf, '.', sizeof(buf));
|
||||||
|
|
|
@ -29,9 +29,12 @@ THE USE OR PERFORMANCE OF THIS SOFTWARE.
|
||||||
#include <stdio.h>
|
#include <stdio.h>
|
||||||
#include <X11/X.h>
|
#include <X11/X.h>
|
||||||
#include <X11/Xproto.h>
|
#include <X11/Xproto.h>
|
||||||
|
#include <X11/keysym.h>
|
||||||
|
|
||||||
|
#include "os/log_priv.h"
|
||||||
|
|
||||||
#include "misc.h"
|
#include "misc.h"
|
||||||
#include "inputstr.h"
|
#include "inputstr.h"
|
||||||
#include <X11/keysym.h>
|
|
||||||
#include <xkbsrv.h>
|
#include <xkbsrv.h>
|
||||||
|
|
||||||
/***====================================================================***/
|
/***====================================================================***/
|
||||||
|
|
|
@ -39,6 +39,7 @@ THE USE OR PERFORMANCE OF THIS SOFTWARE.
|
||||||
#include <X11/extensions/XKM.h>
|
#include <X11/extensions/XKM.h>
|
||||||
|
|
||||||
#include "dix/dix_priv.h"
|
#include "dix/dix_priv.h"
|
||||||
|
#include "os/log_priv.h"
|
||||||
#include "os/osdep.h"
|
#include "os/osdep.h"
|
||||||
#include "xkb/xkbfile_priv.h"
|
#include "xkb/xkbfile_priv.h"
|
||||||
#include "xkb/xkbfmisc_priv.h"
|
#include "xkb/xkbfmisc_priv.h"
|
||||||
|
|
|
@ -41,6 +41,7 @@
|
||||||
#include <X11/Xatom.h>
|
#include <X11/Xatom.h>
|
||||||
#include <X11/keysym.h>
|
#include <X11/keysym.h>
|
||||||
|
|
||||||
|
#include "os/log_priv.h"
|
||||||
#include "xkb/xkbrules_priv.h"
|
#include "xkb/xkbrules_priv.h"
|
||||||
|
|
||||||
#include "misc.h"
|
#include "misc.h"
|
||||||
|
|
|
@ -37,6 +37,7 @@ THE USE OR PERFORMANCE OF THIS SOFTWARE.
|
||||||
#include <X11/extensions/XIproto.h>
|
#include <X11/extensions/XIproto.h>
|
||||||
|
|
||||||
#include "dix/input_priv.h"
|
#include "dix/input_priv.h"
|
||||||
|
#include "os/log_priv.h"
|
||||||
#include "xkb/xkbsrv_priv.h"
|
#include "xkb/xkbsrv_priv.h"
|
||||||
|
|
||||||
#include "exglobals.h"
|
#include "exglobals.h"
|
||||||
|
|
|
@ -34,6 +34,7 @@ THE USE OR PERFORMANCE OF THIS SOFTWARE.
|
||||||
#include <X11/extensions/XIproto.h>
|
#include <X11/extensions/XIproto.h>
|
||||||
|
|
||||||
#include "dix/exevents_priv.h"
|
#include "dix/exevents_priv.h"
|
||||||
|
#include "os/log_priv.h"
|
||||||
|
|
||||||
#include "inputstr.h"
|
#include "inputstr.h"
|
||||||
#include "exglobals.h"
|
#include "exglobals.h"
|
||||||
|
|
|
@ -41,6 +41,7 @@ THE USE OR PERFORMANCE OF THIS SOFTWARE.
|
||||||
|
|
||||||
#include "os/bug_priv.h"
|
#include "os/bug_priv.h"
|
||||||
#include "os/cmdline.h"
|
#include "os/cmdline.h"
|
||||||
|
#include "os/log_priv.h"
|
||||||
#include "xkb/xkbsrv_priv.h"
|
#include "xkb/xkbsrv_priv.h"
|
||||||
|
|
||||||
#include "misc.h"
|
#include "misc.h"
|
||||||
|
|
|
@ -34,6 +34,7 @@ THE USE OR PERFORMANCE OF THIS SOFTWARE.
|
||||||
#include <X11/keysym.h>
|
#include <X11/keysym.h>
|
||||||
|
|
||||||
#include "dix/input_priv.h"
|
#include "dix/input_priv.h"
|
||||||
|
#include "os/log_priv.h"
|
||||||
#include "xkb/xkbsrv_priv.h"
|
#include "xkb/xkbsrv_priv.h"
|
||||||
|
|
||||||
#include "misc.h"
|
#include "misc.h"
|
||||||
|
|
|
@ -58,6 +58,7 @@ DEALINGS IN THE SOFTWARE.
|
||||||
#define XK_CYRILLIC
|
#define XK_CYRILLIC
|
||||||
#include <X11/keysym.h>
|
#include <X11/keysym.h>
|
||||||
|
|
||||||
|
#include "os/log_priv.h"
|
||||||
#include "xkb/xkbsrv_priv.h"
|
#include "xkb/xkbsrv_priv.h"
|
||||||
|
|
||||||
#include "os.h"
|
#include "os.h"
|
||||||
|
|
|
@ -34,6 +34,7 @@
|
||||||
#include <X11/keysym.h>
|
#include <X11/keysym.h>
|
||||||
#include <X11/extensions/XKMformat.h>
|
#include <X11/extensions/XKMformat.h>
|
||||||
|
|
||||||
|
#include "os/log_priv.h"
|
||||||
#include "xkb/xkbfile_priv.h"
|
#include "xkb/xkbfile_priv.h"
|
||||||
#include "xkb/xkbfmisc_priv.h"
|
#include "xkb/xkbfmisc_priv.h"
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue