still respect `log' when in debug mode

This commit is contained in:
Omar Polo 2023-07-24 14:07:28 +00:00
parent e5f060f0d2
commit e075021085
2 changed files with 4 additions and 4 deletions

6
gmid.c
View File

@ -119,6 +119,9 @@ log_request(struct client *c, int code, const char *meta)
if (ec == -1)
fatal("asprintf");
if (debug)
fprintf(stderr, "%s\n", fmted);
proc_compose(conf->ps, PROC_LOGGER, IMSG_LOG_REQUEST,
fmted, ec + 1);
@ -325,9 +328,6 @@ main_send_logfd(struct conf *conf)
char path[PATH_MAX];
int r, fd = -1;
if (debug)
return 0;
if (conf->log_access) {
r = snprintf(path, sizeof(path), "%s%s%s", conf->chroot,
*conf->chroot == '\0' ? "" : "/", conf->log_access);

View File

@ -37,7 +37,7 @@
#define nitems(_a) (sizeof((_a)) / sizeof((_a)[0]))
#endif
static int logfd = 2; /* stderr */
static int logfd = -1;
static void logger_init(struct privsep *, struct privsep_proc *, void *);
static void logger_shutdown(void);