Add ``all'' logging.

Submitted by: eivind
This commit is contained in:
Brian Somers 2000-10-30 00:15:35 +00:00
parent 2388e045c4
commit 7f03ca53aa
Notes: svn2git 2020-12-20 02:59:44 +00:00
svn path=/head/; revision=67916
4 changed files with 29 additions and 1 deletions

View File

@ -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},

View File

@ -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 == '-') {

View File

@ -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

View File

@ -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