os: unexport internal logging functions
Lots of logging functions, especially init and teardown aren't called by any drivers/modules, so no need to keep them exported. Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
This commit is contained in:
parent
9a82f5c30b
commit
7c51bcb093
|
@ -48,6 +48,7 @@ in this Software without prior written authorization from The Open Group.
|
|||
#include "os/auth.h"
|
||||
#include "os/busfault.h"
|
||||
#include "os/client_priv.h"
|
||||
#include "os/log_priv.h"
|
||||
#include "os/osdep.h"
|
||||
#include "Xext/panoramiX.h"
|
||||
#include "Xext/panoramiXsrv.h"
|
||||
|
|
|
@ -36,6 +36,9 @@ from Kaleb S. KEITHLEY
|
|||
#include <X11/X.h>
|
||||
#include <X11/Xproto.h>
|
||||
#include <X11/extensions/xf86vmproto.h>
|
||||
|
||||
#include "os/log_priv.h"
|
||||
|
||||
#include "misc.h"
|
||||
#include "dixstruct.h"
|
||||
#include "extnsionst.h"
|
||||
|
|
|
@ -98,6 +98,7 @@ SOFTWARE.
|
|||
#include "dix/input_priv.h"
|
||||
#include "dix/resource_priv.h"
|
||||
#include "mi/mi_priv.h"
|
||||
#include "os/log_priv.h"
|
||||
#include "xkb/xkbsrv_priv.h"
|
||||
|
||||
#include "inputstr.h"
|
||||
|
|
|
@ -28,6 +28,8 @@
|
|||
#include <dbus/dbus.h>
|
||||
#include <sys/select.h>
|
||||
|
||||
#include "os/log_priv.h"
|
||||
|
||||
#include "dix.h"
|
||||
#include "os.h"
|
||||
|
||||
|
|
|
@ -63,6 +63,7 @@ SOFTWARE.
|
|||
#include "dix/resource_priv.h"
|
||||
#include "mi/mi_priv.h"
|
||||
#include "os/bug_priv.h"
|
||||
#include "os/log_priv.h"
|
||||
#include "os/osdep.h"
|
||||
#include "xkb/xkbsrv_priv.h"
|
||||
|
||||
|
|
|
@ -61,6 +61,7 @@ Equipment Corporation.
|
|||
#include "dix/gc_priv.h"
|
||||
#include "include/swaprep.h"
|
||||
#include "os/auth.h"
|
||||
#include "os/log_priv.h"
|
||||
|
||||
#include "scrnintstr.h"
|
||||
#include "resource.h"
|
||||
|
|
|
@ -130,6 +130,7 @@ Equipment Corporation.
|
|||
#include "os/bug_priv.h"
|
||||
#include "os/client_priv.h"
|
||||
#include "os/fmt.h"
|
||||
#include "os/log_priv.h"
|
||||
#include "Xext/panoramiX.h"
|
||||
#include "Xext/panoramiXsrv.h"
|
||||
#include "xkb/xkbsrv_priv.h"
|
||||
|
|
|
@ -34,6 +34,7 @@
|
|||
#include "dix/resource_priv.h"
|
||||
#include "mi/mi_priv.h"
|
||||
#include "os/bug_priv.h"
|
||||
#include "os/log_priv.h"
|
||||
|
||||
#include "inputstr.h"
|
||||
#include "scrnintstr.h"
|
||||
|
|
|
@ -28,6 +28,7 @@
|
|||
#include "dix/dix_priv.h"
|
||||
#include "os/cmdline.h"
|
||||
#include "os/ddx_priv.h"
|
||||
#include "os/log_priv.h"
|
||||
#include "os/osdep.h"
|
||||
|
||||
#include "ephyr.h"
|
||||
|
|
|
@ -51,6 +51,7 @@
|
|||
#include <grp.h>
|
||||
|
||||
#include "dix/resource_priv.h"
|
||||
#include "os/log_priv.h"
|
||||
#include "os/osdep.h"
|
||||
#include "xkb/xkbsrv_priv.h"
|
||||
|
||||
|
|
|
@ -65,6 +65,7 @@
|
|||
#include "dix/input_priv.h"
|
||||
#include "include/property.h"
|
||||
#include "mi/mi_priv.h"
|
||||
#include "os/log_priv.h"
|
||||
|
||||
#include "misc.h"
|
||||
#include "xf86.h"
|
||||
|
|
|
@ -44,6 +44,7 @@
|
|||
#include "dix/dix_priv.h"
|
||||
#include "dix/input_priv.h"
|
||||
#include "mi/mi_priv.h"
|
||||
#include "os/log_priv.h"
|
||||
|
||||
#include "os.h"
|
||||
#include "servermd.h"
|
||||
|
|
|
@ -58,6 +58,7 @@
|
|||
#include "mi/mi_priv.h"
|
||||
#include "os/cmdline.h"
|
||||
#include "os/ddx_priv.h"
|
||||
#include "os/log_priv.h"
|
||||
#include "os/osdep.h"
|
||||
#include "randr/randrstr_priv.h"
|
||||
|
||||
|
|
|
@ -85,6 +85,9 @@
|
|||
#endif
|
||||
|
||||
#include <X11/X.h>
|
||||
|
||||
#include "os/log_priv.h"
|
||||
|
||||
#include "xf86Modes.h"
|
||||
#include "xf86Crtc.h"
|
||||
#include "os.h"
|
||||
|
|
|
@ -39,6 +39,9 @@
|
|||
#endif
|
||||
|
||||
#include <X11/X.h>
|
||||
|
||||
#include "os/log_priv.h"
|
||||
|
||||
#include "os.h"
|
||||
#include "xf86.h"
|
||||
#include "xf86Priv.h"
|
||||
|
|
|
@ -31,16 +31,16 @@
|
|||
|
||||
#include "dix/screen_hooks_priv.h"
|
||||
|
||||
#include <X11/X.h>
|
||||
|
||||
#include "os/log_priv.h"
|
||||
|
||||
#include "misc.h"
|
||||
#include "xf86.h"
|
||||
#include "scrnintstr.h"
|
||||
#include "regionstr.h"
|
||||
#include "xf86fbman.h"
|
||||
|
||||
/*
|
||||
#define DEBUG
|
||||
*/
|
||||
|
||||
typedef struct {
|
||||
FBAreaPtr(*AllocateOffscreenArea) (ScreenPtr pScreen,
|
||||
int w, int h,
|
||||
|
|
|
@ -35,8 +35,11 @@
|
|||
#include <ctype.h>
|
||||
#include <stdlib.h>
|
||||
#include <unistd.h>
|
||||
#include <X11/X.h>
|
||||
#include <pciaccess.h>
|
||||
#include <X11/X.h>
|
||||
|
||||
#include "os/log_priv.h"
|
||||
|
||||
#include "os.h"
|
||||
#include "Pci.h"
|
||||
#include "xf86.h"
|
||||
|
|
|
@ -36,6 +36,8 @@
|
|||
#include <stdio.h>
|
||||
#include <string.h>
|
||||
|
||||
#include "os/log_priv.h"
|
||||
|
||||
#include "xf86.h"
|
||||
#include "vbe.h"
|
||||
#include "vbeModes.h"
|
||||
|
|
|
@ -10,6 +10,8 @@
|
|||
#include <fcntl.h>
|
||||
#include <errno.h>
|
||||
|
||||
#include "os/log_priv.h"
|
||||
|
||||
#include "os.h"
|
||||
#include "xf86.h"
|
||||
#include "xf86Priv.h"
|
||||
|
|
|
@ -4,6 +4,9 @@
|
|||
#endif
|
||||
|
||||
#include <X11/X.h>
|
||||
|
||||
#include "os/log_priv.h"
|
||||
|
||||
#include "os.h"
|
||||
#include "xf86.h"
|
||||
#include "xf86Priv.h"
|
||||
|
|
|
@ -59,6 +59,7 @@
|
|||
#include <errno.h>
|
||||
#include <X11/X.h>
|
||||
|
||||
#include "os/log_priv.h"
|
||||
#include "os/xserver_poll.h"
|
||||
|
||||
#include "xf86.h"
|
||||
|
|
|
@ -16,6 +16,9 @@
|
|||
#include <unistd.h>
|
||||
|
||||
#include <X11/X.h>
|
||||
|
||||
#include "os/log_priv.h"
|
||||
|
||||
#include "misc.h"
|
||||
|
||||
#include "xf86.h"
|
||||
|
|
|
@ -36,6 +36,7 @@
|
|||
|
||||
#include "miext/extinit_priv.h"
|
||||
#include "os/ddx_priv.h"
|
||||
#include "os/log_priv.h"
|
||||
#include "os/osdep.h"
|
||||
|
||||
#include "os.h"
|
||||
|
|
|
@ -30,6 +30,8 @@
|
|||
#include <drm_fourcc.h>
|
||||
#include <wayland-util.h>
|
||||
|
||||
#include "os/log_priv.h"
|
||||
|
||||
#include "xwayland-dmabuf.h"
|
||||
#include "xwayland-glamor-gbm.h"
|
||||
#include "xwayland-screen.h"
|
||||
|
|
|
@ -35,6 +35,7 @@
|
|||
#include "mi/mi_priv.h"
|
||||
#include "mi/mipointer_priv.h"
|
||||
#include "os/bug_priv.h"
|
||||
#include "os/log_priv.h"
|
||||
#include "xkb/xkbsrv_priv.h"
|
||||
|
||||
#include <inputstr.h>
|
||||
|
|
|
@ -33,6 +33,7 @@
|
|||
#include "dix/input_priv.h"
|
||||
#include "dix/resource_priv.h"
|
||||
#include "randr/randrstr_priv.h"
|
||||
#include "os/log_priv.h"
|
||||
|
||||
#include "xwayland-cvt.h"
|
||||
#include "xwayland-output.h"
|
||||
|
|
|
@ -43,6 +43,7 @@
|
|||
#include "dix/screen_hooks_priv.h"
|
||||
#include "miext/extinit_priv.h"
|
||||
#include "os/client_priv.h"
|
||||
#include "os/log_priv.h"
|
||||
#include "os/osdep.h"
|
||||
#include "os/xserver_poll.h"
|
||||
|
||||
|
|
|
@ -35,6 +35,7 @@
|
|||
#include "dix/dix_priv.h"
|
||||
#include "dix/property_priv.h"
|
||||
#include "dix/resource_priv.h"
|
||||
#include "os/log_priv.h"
|
||||
|
||||
#include "compositeext.h"
|
||||
#include "compint.h"
|
||||
|
|
|
@ -33,6 +33,7 @@
|
|||
#include "dix/dix_priv.h"
|
||||
#include "dix/input_priv.h"
|
||||
#include "os/client_priv.h"
|
||||
#include "os/log_priv.h"
|
||||
|
||||
#include <inputstr.h>
|
||||
#include <inpututils.h>
|
||||
|
|
|
@ -43,6 +43,7 @@
|
|||
#include "os/client_priv.h"
|
||||
#include "os/ddx_priv.h"
|
||||
#include "os/fmt.h"
|
||||
#include "os/log_priv.h"
|
||||
#include "os/osdep.h"
|
||||
#include "os/xserver_poll.h"
|
||||
|
||||
|
|
|
@ -38,6 +38,7 @@ from The Open Group.
|
|||
#include "dix/screenint_priv.h"
|
||||
#include "miext/extinit_priv.h"
|
||||
#include "os/ddx_priv.h"
|
||||
#include "os/log_priv.h"
|
||||
#include "os/osdep.h"
|
||||
#include "xkb/xkbsrv_priv.h"
|
||||
|
||||
|
|
|
@ -32,6 +32,7 @@
|
|||
#include <xwin-config.h>
|
||||
#endif
|
||||
|
||||
#include "os/log_priv.h"
|
||||
#include "os/osdep.h"
|
||||
|
||||
#include <../xfree86/common/xorgVersion.h>
|
||||
|
|
27
include/os.h
27
include/os.h
|
@ -269,13 +269,6 @@ extern _X_EXPORT int
|
|||
timingsafe_memcmp(const void *b1, const void *b2, size_t len);
|
||||
#endif
|
||||
|
||||
/* Logging. */
|
||||
typedef enum _LogParameter {
|
||||
XLOG_SYNC,
|
||||
XLOG_VERBOSITY,
|
||||
XLOG_FILE_VERBOSITY
|
||||
} LogParameter;
|
||||
|
||||
/* Flags for log messages. */
|
||||
typedef enum {
|
||||
X_PROBED, /* Value was probed */
|
||||
|
@ -292,14 +285,6 @@ typedef enum {
|
|||
X_UNKNOWN = -1 /* unknown -- this must always be last */
|
||||
} 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
|
||||
LogVMessageVerb(MessageType type, int verb, const char *format, va_list args)
|
||||
_X_ATTRIBUTE_PRINTF(3, 0);
|
||||
|
@ -310,7 +295,7 @@ extern _X_EXPORT void
|
|||
LogMessage(MessageType type, const char *format, ...)
|
||||
_X_ATTRIBUTE_PRINTF(2, 3);
|
||||
|
||||
extern _X_EXPORT void
|
||||
void
|
||||
LogVHdrMessageVerb(MessageType type, int verb,
|
||||
const char *msg_format, va_list msg_args,
|
||||
const char *hdr_format, va_list hdr_args)
|
||||
|
@ -328,17 +313,11 @@ FatalError(const char *f, ...)
|
|||
_X_ATTRIBUTE_PRINTF(1, 2)
|
||||
_X_NORETURN;
|
||||
|
||||
#ifdef DEBUG
|
||||
#define DebugF ErrorF
|
||||
#else
|
||||
#define DebugF(...) /* */
|
||||
#endif
|
||||
|
||||
extern _X_EXPORT void
|
||||
ErrorF(const char *f, ...)
|
||||
_X_ATTRIBUTE_PRINTF(1, 2);
|
||||
extern _X_EXPORT void
|
||||
LogPrintMarkers(void);
|
||||
|
||||
void LogPrintMarkers(void);
|
||||
|
||||
extern _X_EXPORT void
|
||||
xorg_backtrace(void);
|
||||
|
|
|
@ -87,6 +87,7 @@
|
|||
#endif
|
||||
|
||||
#include "os/auth.h"
|
||||
#include "os/log_priv.h"
|
||||
|
||||
/**
|
||||
* Try to determine a PID for a client from its connection
|
||||
|
|
|
@ -98,6 +98,7 @@ SOFTWARE.
|
|||
#include "os/audit.h"
|
||||
#include "os/auth.h"
|
||||
#include "os/client_priv.h"
|
||||
#include "os/log_priv.h"
|
||||
#include "os/osdep.h"
|
||||
|
||||
#include "misc.h" /* for typedef of pointer */
|
||||
|
|
|
@ -35,6 +35,7 @@
|
|||
|
||||
#include "dix/input_priv.h"
|
||||
#include "os/ddx_priv.h"
|
||||
#include "os/log_priv.h"
|
||||
|
||||
#include "inputstr.h"
|
||||
#include "opaque.h"
|
||||
|
|
3
os/log.c
3
os/log.c
|
@ -94,6 +94,7 @@ OR PERFORMANCE OF THIS SOFTWARE.
|
|||
#include "os/bug_priv.h"
|
||||
#include "os/ddx_priv.h"
|
||||
#include "os/fmt.h"
|
||||
#include "os/log_priv.h"
|
||||
#include "os/osdep.h"
|
||||
|
||||
#include "opaque.h"
|
||||
|
@ -309,7 +310,7 @@ LogClose(enum ExitCode error)
|
|||
}
|
||||
}
|
||||
|
||||
Bool
|
||||
int
|
||||
LogSetParameter(LogParameter param, int value)
|
||||
{
|
||||
switch (param) {
|
||||
|
|
|
@ -0,0 +1,71 @@
|
|||
/* SPDX-License-Identifier: MIT OR X11
|
||||
*
|
||||
* Copyright © 2024 Enrico Weigelt, metux IT consult <info@metux.net>
|
||||
*/
|
||||
#ifndef __XORG_OS_LOGGING_H
|
||||
#define __XORG_OS_LOGGING_H
|
||||
|
||||
#include "include/os.h"
|
||||
|
||||
/**
|
||||
* @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);
|
||||
|
||||
/* @brief parameters for LogSetParameter() */
|
||||
typedef enum {
|
||||
XLOG_SYNC, /* enable/disable fsync() after each log file write */
|
||||
XLOG_VERBOSITY, /* set console log verbosity */
|
||||
XLOG_FILE_VERBOSITY, /* set log file verbosity */
|
||||
} LogParameter;
|
||||
|
||||
/**
|
||||
* @brief set log file paremeters
|
||||
*
|
||||
* Set various (int) logging parameters, eg. verbosity.
|
||||
* See XLOG_* defines
|
||||
*
|
||||
* @param ID of the parameter to set
|
||||
* @param value the new value
|
||||
* @result TRUE if successful
|
||||
*/
|
||||
int LogSetParameter(LogParameter param, int value);
|
||||
|
||||
#ifdef DEBUG
|
||||
/**
|
||||
* @brief log debug messages (like errors) if symbol DEBUG is defined
|
||||
*/
|
||||
#define DebugF ErrorF
|
||||
#else
|
||||
#define DebugF(...) /* */
|
||||
#endif
|
||||
|
||||
#endif /* __XORG_OS_LOGGING_H */
|
|
@ -60,6 +60,7 @@ SOFTWARE.
|
|||
|
||||
#include "dix/dix_priv.h"
|
||||
#include "os/busfault.h"
|
||||
#include "os/log_priv.h"
|
||||
#include "os/osdep.h"
|
||||
#include "os/serverlock.h"
|
||||
|
||||
|
|
|
@ -67,9 +67,6 @@ OR PERFORMANCE OF THIS SOFTWARE.
|
|||
#define TRANS_REOPEN
|
||||
#include <X11/Xtrans/Xtrans.h>
|
||||
|
||||
#include "os/audit.h"
|
||||
#include "os/client_priv.h"
|
||||
|
||||
#include "input.h"
|
||||
#include "dixfont.h"
|
||||
#include <X11/fonts/libxfont2.h>
|
||||
|
@ -97,10 +94,13 @@ OR PERFORMANCE OF THIS SOFTWARE.
|
|||
#include "dix/dix_priv.h"
|
||||
#include "dix/input_priv.h"
|
||||
#include "miext/extinit_priv.h"
|
||||
#include "os/audit.h"
|
||||
#include "os/auth.h"
|
||||
#include "os/bug_priv.h"
|
||||
#include "os/cmdline.h"
|
||||
#include "os/client_priv.h"
|
||||
#include "os/ddx_priv.h"
|
||||
#include "os/log_priv.h"
|
||||
#include "os/osdep.h"
|
||||
#include "os/serverlock.h"
|
||||
#include "xkb/xkbsrv_priv.h"
|
||||
|
|
|
@ -30,6 +30,7 @@
|
|||
#include <unistd.h>
|
||||
|
||||
#include "os/fmt.h"
|
||||
#include "os/log_priv.h"
|
||||
|
||||
#include "assert.h"
|
||||
#include "misc.h"
|
||||
|
|
|
@ -31,6 +31,7 @@ THE USE OR PERFORMANCE OF THIS SOFTWARE.
|
|||
#include <X11/Xproto.h>
|
||||
#include <X11/keysym.h>
|
||||
|
||||
#include "os/log_priv.h"
|
||||
#include "xkb/xkbsrv_priv.h"
|
||||
|
||||
#include "misc.h"
|
||||
|
|
|
@ -39,6 +39,7 @@ THE USE OR PERFORMANCE OF THIS SOFTWARE.
|
|||
#include <X11/extensions/XKM.h>
|
||||
|
||||
#include "dix/dix_priv.h"
|
||||
#include "os/log_priv.h"
|
||||
#include "os/osdep.h"
|
||||
#include "xkb/xkbfile_priv.h"
|
||||
#include "xkb/xkbfmisc_priv.h"
|
||||
|
|
|
@ -41,6 +41,7 @@
|
|||
#include <X11/Xatom.h>
|
||||
#include <X11/keysym.h>
|
||||
|
||||
#include "os/log_priv.h"
|
||||
#include "xkb/xkbrules_priv.h"
|
||||
|
||||
#include "misc.h"
|
||||
|
|
|
@ -37,6 +37,7 @@ THE USE OR PERFORMANCE OF THIS SOFTWARE.
|
|||
#include <X11/extensions/XIproto.h>
|
||||
|
||||
#include "dix/input_priv.h"
|
||||
#include "os/log_priv.h"
|
||||
#include "xkb/xkbsrv_priv.h"
|
||||
|
||||
#include "exglobals.h"
|
||||
|
|
|
@ -35,6 +35,7 @@ THE USE OR PERFORMANCE OF THIS SOFTWARE.
|
|||
|
||||
#include "dix/exevents_priv.h"
|
||||
#include "dix/input_priv.h"
|
||||
#include "os/log_priv.h"
|
||||
#include "xkb/xkbsrv_priv.h"
|
||||
|
||||
#include "inputstr.h"
|
||||
|
|
|
@ -41,6 +41,7 @@ THE USE OR PERFORMANCE OF THIS SOFTWARE.
|
|||
|
||||
#include "os/bug_priv.h"
|
||||
#include "os/cmdline.h"
|
||||
#include "os/log_priv.h"
|
||||
#include "xkb/xkbsrv_priv.h"
|
||||
|
||||
#include "misc.h"
|
||||
|
|
|
@ -34,6 +34,7 @@ THE USE OR PERFORMANCE OF THIS SOFTWARE.
|
|||
#include <X11/keysym.h>
|
||||
|
||||
#include "dix/input_priv.h"
|
||||
#include "os/log_priv.h"
|
||||
#include "xkb/xkbsrv_priv.h"
|
||||
|
||||
#include "misc.h"
|
||||
|
|
|
@ -59,6 +59,7 @@ DEALINGS IN THE SOFTWARE.
|
|||
#include <X11/keysym.h>
|
||||
|
||||
#include "dix/input_priv.h"
|
||||
#include "os/log_priv.h"
|
||||
#include "xkb/xkbsrv_priv.h"
|
||||
|
||||
#include "os.h"
|
||||
|
|
|
@ -34,6 +34,7 @@
|
|||
#include <X11/keysym.h>
|
||||
#include <X11/extensions/XKMformat.h>
|
||||
|
||||
#include "os/log_priv.h"
|
||||
#include "xkb/xkbfile_priv.h"
|
||||
#include "xkb/xkbfmisc_priv.h"
|
||||
#include "xkb/xkbsrv_priv.h"
|
||||
|
|
Loading…
Reference in New Issue