summaryrefslogtreecommitdiffstats
path: root/sysdep/unix
diff options
context:
space:
mode:
authorMartin Mares <mj@ucw.cz>2000-05-30 00:10:18 +0200
committerMartin Mares <mj@ucw.cz>2000-05-30 00:10:18 +0200
commit4761efdb43aa128fa0326963d88debe8fb942c84 (patch)
tree483e33ce446335643fc4f83148a386df87b47e4d /sysdep/unix
parent26eee1c33ac90ccbc5753afac06d34980fade2b8 (diff)
downloadbird-4761efdb43aa128fa0326963d88debe8fb942c84.tar
bird-4761efdb43aa128fa0326963d88debe8fb942c84.zip
Tracing of CLI connections/commands can be now controlled
by `debug commands <level>' in the configuration. Level 0 means no tracing, 1 means connections only, 2 includes all commands.
Diffstat (limited to 'sysdep/unix')
-rw-r--r--sysdep/unix/main.c14
1 files changed, 9 insertions, 5 deletions
diff --git a/sysdep/unix/main.c b/sysdep/unix/main.c
index 971c79d..fed833b 100644
--- a/sysdep/unix/main.c
+++ b/sysdep/unix/main.c
@@ -233,10 +233,13 @@ cli_tx(sock *s)
static void
cli_err(sock *s, int err)
{
- if (err)
- log(L_INFO "CLI connection dropped: %s", strerror(err));
- else
- log(L_INFO "CLI connection closed");
+ if (config->cli_debug)
+ {
+ if (err)
+ log(L_INFO "CLI connection dropped: %s", strerror(err));
+ else
+ log(L_INFO "CLI connection closed");
+ }
cli_free(s->data);
sk_close(s);
}
@@ -246,7 +249,8 @@ cli_connect(sock *s, int size)
{
cli *c;
- log(L_INFO "CLI connect");
+ if (config->cli_debug)
+ log(L_INFO "CLI connect");
s->rx_hook = cli_rx;
s->tx_hook = cli_tx;
s->err_hook = cli_err;