fair enough, LOG_NOTICE or LOG_INFO? On 1/6/2016 8:57 AM, Donald Sharp wrote: > Ok, different use case. Why the LOG_EMERG? I think this should be > protected by a knob of some sort. Does every cli need to be saved no > matter what? > > donald > > On Wed, Jan 6, 2016 at 8:42 AM, Lou Berger <[email protected] > <mailto:[email protected]>> wrote: > > > > On 1/6/2016 8:13 AM, Donald Sharp wrote: > > Why is this approach better than touching ~/.history_quagga or > > modifying the logging code in vtysh_main.c to log this information > > where you want? > > > Different use case, i.e., it applies to all daemons and to when vtysh > isn't used. > > Lou > > > donald > > > > On Thu, Dec 24, 2015 at 1:10 PM, Lou Berger <[email protected] > <mailto:[email protected]> > > <mailto:[email protected] <mailto:[email protected]>>> wrote: > > > > To facilitate debugging and operation. > > > > Signed-off-by: Lou Berger <[email protected] > <mailto:[email protected]> <mailto:[email protected] > <mailto:[email protected]>>> > > Signed-off-by: David Lamparter > <[email protected] <mailto:[email protected]> > > <mailto:[email protected] > <mailto:[email protected]>>> > > --- > > lib/vty.c | 39 +++++++++++++++++++++++++++++++++++++-- > > 1 file changed, 37 insertions(+), 2 deletions(-) > > > > diff --git a/lib/vty.c b/lib/vty.c > > index 480d34f..a9b9720 100644 > > --- a/lib/vty.c > > +++ b/lib/vty.c > > @@ -111,7 +111,7 @@ vty_out (struct vty *vty, const char > *format, ...) > > { > > /* Try to write to initial buffer. */ > > va_start (args, format); > > - len = vsnprintf (buf, sizeof buf, format, args); > > + len = vsnprintf (buf, sizeof(buf), format, args); > > va_end (args); > > > > /* Initial buffer is not enough. */ > > @@ -401,6 +401,41 @@ vty_command (struct vty *vty, char *buf) > > int ret; > > vector vline; > > const char *protocolname; > > + char *cp; > > + > > + /* > > + * Log non empty command lines > > + */ > > + cp = buf; > > + if (cp != NULL) > > + { > > + /* Skip white spaces. */ > > + while (isspace ((int) *cp) && *cp != '\0') > > + cp++; > > + } > > + if (cp != NULL && *cp != '\0') > > + { > > + unsigned i; > > + char vty_str[VTY_BUFSIZ]; > > + char prompt_str[VTY_BUFSIZ]; > > + > > + /* format the base vty info */ > > + snprintf(vty_str, sizeof(vty_str), "vty[??]@%s", > vty->address); > > + if (vty) > > + for (i = 0; i < vector_active (vtyvec); i++) > > + if ((vty == vector_slot (vtyvec, i))) > > + { > > + snprintf(vty_str, sizeof(vty_str), "vty[%d]@%s", > > + i, > vty->address); > > + break; > > + } > > + > > + /* format the prompt */ > > + snprintf(prompt_str, sizeof(prompt_str), cmd_prompt > > (vty->node), vty_str); > > + > > + /* now log the command */ > > + zlog(NULL, LOG_EMERG, "%s%s", prompt_str, buf); > > + } > > > > /* Split readline string up into the vector */ > > vline = cmd_make_strvec (buf); > > @@ -1571,7 +1606,7 @@ vty_flush (struct thread *thread) > > erase = ((vty->status == VTY_MORE || vty->status == > VTY_MORELINE)); > > > > /* N.B. if width is 0, that means we don't know the > window size. */ > > - if ((vty->lines == 0) || (vty->width == 0)) > > + if ((vty->lines == 0) || (vty->width == 0) || > (vty->height == 0)) > > flushrc = buffer_flush_available(vty->obuf, vty_sock); > > else if (vty->status == VTY_MORELINE) > > flushrc = buffer_flush_window(vty->obuf, vty_sock, > vty->width, > > -- > > 2.1.3 > > > > > > _______________________________________________ > > Quagga-dev mailing list > > [email protected] > <mailto:[email protected]> > <mailto:[email protected] > <mailto:[email protected]>> > > https://lists.quagga.net/mailman/listinfo/quagga-dev > > > > > > >
_______________________________________________ Quagga-dev mailing list [email protected] https://lists.quagga.net/mailman/listinfo/quagga-dev
