mirror of
https://github.com/omar-polo/gmid.git
synced 2024-09-29 22:12:12 +02:00
still respect `log' when in debug mode
This commit is contained in:
parent
e5f060f0d2
commit
e075021085
6
gmid.c
6
gmid.c
@ -119,6 +119,9 @@ log_request(struct client *c, int code, const char *meta)
|
|||||||
if (ec == -1)
|
if (ec == -1)
|
||||||
fatal("asprintf");
|
fatal("asprintf");
|
||||||
|
|
||||||
|
if (debug)
|
||||||
|
fprintf(stderr, "%s\n", fmted);
|
||||||
|
|
||||||
proc_compose(conf->ps, PROC_LOGGER, IMSG_LOG_REQUEST,
|
proc_compose(conf->ps, PROC_LOGGER, IMSG_LOG_REQUEST,
|
||||||
fmted, ec + 1);
|
fmted, ec + 1);
|
||||||
|
|
||||||
@ -325,9 +328,6 @@ main_send_logfd(struct conf *conf)
|
|||||||
char path[PATH_MAX];
|
char path[PATH_MAX];
|
||||||
int r, fd = -1;
|
int r, fd = -1;
|
||||||
|
|
||||||
if (debug)
|
|
||||||
return 0;
|
|
||||||
|
|
||||||
if (conf->log_access) {
|
if (conf->log_access) {
|
||||||
r = snprintf(path, sizeof(path), "%s%s%s", conf->chroot,
|
r = snprintf(path, sizeof(path), "%s%s%s", conf->chroot,
|
||||||
*conf->chroot == '\0' ? "" : "/", conf->log_access);
|
*conf->chroot == '\0' ? "" : "/", conf->log_access);
|
||||||
|
2
logger.c
2
logger.c
@ -37,7 +37,7 @@
|
|||||||
#define nitems(_a) (sizeof((_a)) / sizeof((_a)[0]))
|
#define nitems(_a) (sizeof((_a)) / sizeof((_a)[0]))
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
static int logfd = 2; /* stderr */
|
static int logfd = -1;
|
||||||
|
|
||||||
static void logger_init(struct privsep *, struct privsep_proc *, void *);
|
static void logger_init(struct privsep *, struct privsep_proc *, void *);
|
||||||
static void logger_shutdown(void);
|
static void logger_shutdown(void);
|
||||||
|
Loading…
Reference in New Issue
Block a user