mirror of
https://github.com/tmux/tmux.git
synced 2025-01-15 05:09:04 +00:00
tmux doesn't and won't need syslog logging, so remove it and some other unused
functions found by lint. Also move a couple of internal function declarations into file scope.
This commit is contained in:
parent
1675ddb4d1
commit
a7075f1c66
32
log.c
32
log.c
@ -29,9 +29,8 @@
|
|||||||
|
|
||||||
/* Logging type. */
|
/* Logging type. */
|
||||||
#define LOG_TYPE_OFF 0
|
#define LOG_TYPE_OFF 0
|
||||||
#define LOG_TYPE_SYSLOG 1
|
#define LOG_TYPE_TTY 1
|
||||||
#define LOG_TYPE_TTY 2
|
#define LOG_TYPE_FILE 2
|
||||||
#define LOG_TYPE_FILE 3
|
|
||||||
int log_type = LOG_TYPE_OFF;
|
int log_type = LOG_TYPE_OFF;
|
||||||
|
|
||||||
/* Log file, if needed. */
|
/* Log file, if needed. */
|
||||||
@ -40,17 +39,8 @@ FILE *log_file;
|
|||||||
/* Debug level. */
|
/* Debug level. */
|
||||||
int log_level;
|
int log_level;
|
||||||
|
|
||||||
/* Open logging to syslog. */
|
void log_vwrite(int, const char *, va_list);
|
||||||
void
|
__dead void log_vfatal(const char *, va_list);
|
||||||
log_open_syslog(int level)
|
|
||||||
{
|
|
||||||
log_type = LOG_TYPE_SYSLOG;
|
|
||||||
log_level = level;
|
|
||||||
|
|
||||||
openlog(__progname, LOG_PID|LOG_NDELAY, LOG_FACILITY);
|
|
||||||
|
|
||||||
tzset();
|
|
||||||
}
|
|
||||||
|
|
||||||
/* Open logging to tty. */
|
/* Open logging to tty. */
|
||||||
void
|
void
|
||||||
@ -91,17 +81,6 @@ log_close(void)
|
|||||||
log_type = LOG_TYPE_OFF;
|
log_type = LOG_TYPE_OFF;
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Write a log message. */
|
|
||||||
void
|
|
||||||
log_write(int pri, const char *msg, ...)
|
|
||||||
{
|
|
||||||
va_list ap;
|
|
||||||
|
|
||||||
va_start(ap, msg);
|
|
||||||
log_vwrite(pri, msg, ap);
|
|
||||||
va_end(ap);
|
|
||||||
}
|
|
||||||
|
|
||||||
/* Write a log message. */
|
/* Write a log message. */
|
||||||
void
|
void
|
||||||
log_vwrite(int pri, const char *msg, va_list ap)
|
log_vwrite(int pri, const char *msg, va_list ap)
|
||||||
@ -110,9 +89,6 @@ log_vwrite(int pri, const char *msg, va_list ap)
|
|||||||
FILE *f = log_file;
|
FILE *f = log_file;
|
||||||
|
|
||||||
switch (log_type) {
|
switch (log_type) {
|
||||||
case LOG_TYPE_SYSLOG:
|
|
||||||
vsyslog(pri, msg, ap);
|
|
||||||
break;
|
|
||||||
case LOG_TYPE_TTY:
|
case LOG_TYPE_TTY:
|
||||||
if (pri == LOG_INFO)
|
if (pri == LOG_INFO)
|
||||||
f = stdout;
|
f = stdout;
|
||||||
|
5
tmux.h
5
tmux.h
@ -1537,20 +1537,15 @@ uint8_t buffer_read8(struct buffer *);
|
|||||||
int buffer_poll(struct pollfd *, struct buffer *, struct buffer *);
|
int buffer_poll(struct pollfd *, struct buffer *, struct buffer *);
|
||||||
|
|
||||||
/* log.c */
|
/* log.c */
|
||||||
#define LOG_FACILITY LOG_DAEMON
|
|
||||||
void log_open_syslog(int);
|
|
||||||
void log_open_tty(int);
|
void log_open_tty(int);
|
||||||
void log_open_file(int, const char *);
|
void log_open_file(int, const char *);
|
||||||
void log_close(void);
|
void log_close(void);
|
||||||
void log_vwrite(int, const char *, va_list);
|
|
||||||
void log_write(int, const char *, ...);
|
|
||||||
void printflike1 log_warn(const char *, ...);
|
void printflike1 log_warn(const char *, ...);
|
||||||
void printflike1 log_warnx(const char *, ...);
|
void printflike1 log_warnx(const char *, ...);
|
||||||
void printflike1 log_info(const char *, ...);
|
void printflike1 log_info(const char *, ...);
|
||||||
void printflike1 log_debug(const char *, ...);
|
void printflike1 log_debug(const char *, ...);
|
||||||
void printflike1 log_debug2(const char *, ...);
|
void printflike1 log_debug2(const char *, ...);
|
||||||
void printflike1 log_debug3(const char *, ...);
|
void printflike1 log_debug3(const char *, ...);
|
||||||
__dead void log_vfatal(const char *, va_list);
|
|
||||||
__dead void log_fatal(const char *, ...);
|
__dead void log_fatal(const char *, ...);
|
||||||
__dead void log_fatalx(const char *, ...);
|
__dead void log_fatalx(const char *, ...);
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user