summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorbrian <brian@FreeBSD.org>2000-10-30 00:15:35 +0000
committerbrian <brian@FreeBSD.org>2000-10-30 00:15:35 +0000
commit9814de693ae250a914edff48855963f2abf38142 (patch)
tree2127ab691b2f01b3e05eab7d22b91956e0df68ca
parent3d1630ef600659c926573d423add45b5994a969a (diff)
downloadFreeBSD-src-9814de693ae250a914edff48855963f2abf38142.zip
FreeBSD-src-9814de693ae250a914edff48855963f2abf38142.tar.gz
Add ``all'' logging.
Submitted by: eivind
-rw-r--r--usr.sbin/ppp/command.c2
-rw-r--r--usr.sbin/ppp/log.c18
-rw-r--r--usr.sbin/ppp/ppp.85
-rw-r--r--usr.sbin/ppp/ppp.8.m45
4 files changed, 29 insertions, 1 deletions
diff --git a/usr.sbin/ppp/command.c b/usr.sbin/ppp/command.c
index 76f55a6..9a62b31 100644
--- a/usr.sbin/ppp/command.c
+++ b/usr.sbin/ppp/command.c
@@ -2020,7 +2020,7 @@ static struct cmdtab const SetCommands[] = {
{"lcpretry", "lcpretries", SetVariable, LOCAL_AUTH | LOCAL_CX, "LCP retries",
"set lcpretry value [attempts]", (const void *)VAR_LCPRETRY},
{"log", NULL, log_SetLevel, LOCAL_AUTH, "log level",
- "set log [local] [+|-]async|cbcp|ccp|chat|command|connect|debug|dns|hdlc|"
+ "set log [local] [+|-]all|async|cbcp|ccp|chat|command|connect|debug|dns|hdlc|"
"id0|ipcp|lcp|lqm|phase|physical|sync|tcp/ip|timer|tun..."},
{"login", NULL, SetVariable, LOCAL_AUTH | LOCAL_CX,
"login script", "set login chat-script", (const void *) VAR_LOGIN},
diff --git a/usr.sbin/ppp/log.c b/usr.sbin/ppp/log.c
index df3b131..d31d9c9 100644
--- a/usr.sbin/ppp/log.c
+++ b/usr.sbin/ppp/log.c
@@ -453,6 +453,24 @@ log_SetLevel(struct cmdargs const *arg)
while (argc--) {
argp = **argv == '+' || **argv == '-' ? *argv + 1 : *argv;
+ /* Special case 'all' */
+ if (strcasecmp(argp, "all") == 0) {
+ if (**argv == '-') {
+ if (local)
+ for (i = LogMIN; i <= LogMAX; i++)
+ log_DiscardLocal(i, &arg->prompt->logmask);
+ else
+ for (i = LogMIN; i <= LogMAX; i++)
+ log_Discard(i);
+ } else if (local)
+ for (i = LogMIN; i <= LogMAX; i++)
+ log_KeepLocal(i, &arg->prompt->logmask);
+ else
+ for (i = LogMIN; i <= LogMAX; i++)
+ log_Keep(i);
+ argv++;
+ continue;
+ }
for (i = LogMIN; i <= LogMAX; i++)
if (strcasecmp(argp, log_Name(i)) == 0) {
if (**argv == '-') {
diff --git a/usr.sbin/ppp/ppp.8 b/usr.sbin/ppp/ppp.8
index 90d99f8..0ac7a6d 100644
--- a/usr.sbin/ppp/ppp.8
+++ b/usr.sbin/ppp/ppp.8
@@ -2151,6 +2151,11 @@ is able to generate the following log info either via
or directly to the screen:
.Pp
.Bl -tag -width XXXXXXXXX -offset XXX -compact
+.It Li All
+Enable all logging facilities.
+This generates a lot of log.
+The most common use of 'all' is as a basis, where you remove some facilities
+after enabling 'all' ('debug' and 'timer' are usually best disabled.)
.It Li Async
Dump async level packet in hex.
.It Li CBCP
diff --git a/usr.sbin/ppp/ppp.8.m4 b/usr.sbin/ppp/ppp.8.m4
index 90d99f8..0ac7a6d 100644
--- a/usr.sbin/ppp/ppp.8.m4
+++ b/usr.sbin/ppp/ppp.8.m4
@@ -2151,6 +2151,11 @@ is able to generate the following log info either via
or directly to the screen:
.Pp
.Bl -tag -width XXXXXXXXX -offset XXX -compact
+.It Li All
+Enable all logging facilities.
+This generates a lot of log.
+The most common use of 'all' is as a basis, where you remove some facilities
+after enabling 'all' ('debug' and 'timer' are usually best disabled.)
.It Li Async
Dump async level packet in hex.
.It Li CBCP
OpenPOWER on IntegriCloud