diff options
-rw-r--r-- | channels.c | 10 | ||||
-rw-r--r-- | log.c | 8 | ||||
-rw-r--r-- | log.h | 3 |
3 files changed, 15 insertions, 6 deletions
diff --git a/channels.c b/channels.c index 1de63c216..e90f7fea9 100644 --- a/channels.c +++ b/channels.c | |||
@@ -1,4 +1,4 @@ | |||
1 | /* $OpenBSD: channels.c,v 1.383 2018/07/11 18:53:29 markus Exp $ */ | 1 | /* $OpenBSD: channels.c,v 1.384 2018/07/27 12:03:17 markus Exp $ */ |
2 | /* | 2 | /* |
3 | * Author: Tatu Ylonen <ylo@cs.hut.fi> | 3 | * Author: Tatu Ylonen <ylo@cs.hut.fi> |
4 | * Copyright (c) 1995 Tatu Ylonen <ylo@cs.hut.fi>, Espoo, Finland | 4 | * Copyright (c) 1995 Tatu Ylonen <ylo@cs.hut.fi>, Espoo, Finland |
@@ -608,9 +608,11 @@ channel_free(struct ssh *ssh, Channel *c) | |||
608 | if (c->type == SSH_CHANNEL_MUX_CLIENT) | 608 | if (c->type == SSH_CHANNEL_MUX_CLIENT) |
609 | mux_remove_remote_forwardings(ssh, c); | 609 | mux_remove_remote_forwardings(ssh, c); |
610 | 610 | ||
611 | s = channel_open_message(ssh); | 611 | if (log_level_get() >= SYSLOG_LEVEL_DEBUG3) { |
612 | debug3("channel %d: status: %s", c->self, s); | 612 | s = channel_open_message(ssh); |
613 | free(s); | 613 | debug3("channel %d: status: %s", c->self, s); |
614 | free(s); | ||
615 | } | ||
614 | 616 | ||
615 | channel_close_fds(ssh, c); | 617 | channel_close_fds(ssh, c); |
616 | sshbuf_free(c->input); | 618 | sshbuf_free(c->input); |
@@ -1,4 +1,4 @@ | |||
1 | /* $OpenBSD: log.c,v 1.50 2017/05/17 01:24:17 djm Exp $ */ | 1 | /* $OpenBSD: log.c,v 1.51 2018/07/27 12:03:17 markus Exp $ */ |
2 | /* | 2 | /* |
3 | * Author: Tatu Ylonen <ylo@cs.hut.fi> | 3 | * Author: Tatu Ylonen <ylo@cs.hut.fi> |
4 | * Copyright (c) 1995 Tatu Ylonen <ylo@cs.hut.fi>, Espoo, Finland | 4 | * Copyright (c) 1995 Tatu Ylonen <ylo@cs.hut.fi>, Espoo, Finland |
@@ -105,6 +105,12 @@ static struct { | |||
105 | { NULL, SYSLOG_LEVEL_NOT_SET } | 105 | { NULL, SYSLOG_LEVEL_NOT_SET } |
106 | }; | 106 | }; |
107 | 107 | ||
108 | LogLevel | ||
109 | log_level_get(void) | ||
110 | { | ||
111 | return log_level; | ||
112 | } | ||
113 | |||
108 | SyslogFacility | 114 | SyslogFacility |
109 | log_facility_number(char *name) | 115 | log_facility_number(char *name) |
110 | { | 116 | { |
@@ -1,4 +1,4 @@ | |||
1 | /* $OpenBSD: log.h,v 1.22 2017/05/17 01:24:17 djm Exp $ */ | 1 | /* $OpenBSD: log.h,v 1.23 2018/07/27 12:03:17 markus Exp $ */ |
2 | 2 | ||
3 | /* | 3 | /* |
4 | * Author: Tatu Ylonen <ylo@cs.hut.fi> | 4 | * Author: Tatu Ylonen <ylo@cs.hut.fi> |
@@ -49,6 +49,7 @@ typedef enum { | |||
49 | typedef void (log_handler_fn)(LogLevel, const char *, void *); | 49 | typedef void (log_handler_fn)(LogLevel, const char *, void *); |
50 | 50 | ||
51 | void log_init(char *, LogLevel, SyslogFacility, int); | 51 | void log_init(char *, LogLevel, SyslogFacility, int); |
52 | LogLevel log_level_get(void); | ||
52 | int log_change_level(LogLevel); | 53 | int log_change_level(LogLevel); |
53 | int log_is_on_stderr(void); | 54 | int log_is_on_stderr(void); |
54 | void log_redirect_stderr_to(const char *); | 55 | void log_redirect_stderr_to(const char *); |