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:
Enrico Weigelt, metux IT consult
2024-09-09 16:56:26 +02:00
parent 9a82f5c30b
commit 7c51bcb093
50 changed files with 145 additions and 33 deletions

View File

@@ -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

View File

@@ -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 */

View File

@@ -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"

View File

@@ -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) {

71
os/log_priv.h Normal file
View File

@@ -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 */

View File

@@ -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"

View File

@@ -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"