diff options
author | Martin Mares <mj@ucw.cz> | 2000-05-29 22:10:18 +0000 |
---|---|---|
committer | Martin Mares <mj@ucw.cz> | 2000-05-29 22:10:18 +0000 |
commit | 4761efdb43aa128fa0326963d88debe8fb942c84 (patch) | |
tree | 483e33ce446335643fc4f83148a386df87b47e4d /sysdep/unix | |
parent | 26eee1c33ac90ccbc5753afac06d34980fade2b8 (diff) |
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.c | 14 |
1 files changed, 9 insertions, 5 deletions
diff --git a/sysdep/unix/main.c b/sysdep/unix/main.c index 971c79dd..fed833bb 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; |