* RFC: Syntax for logging
@ 2003-06-21 17:24 Daniel Jacobowitz
2003-06-21 18:01 ` Doug Evans
2003-06-22 18:04 ` Andrew Cagney
0 siblings, 2 replies; 7+ messages in thread
From: Daniel Jacobowitz @ 2003-06-21 17:24 UTC (permalink / raw)
To: gdb-patches
Folks may remember the thread from a year ago:
RFA: >, >>, and "tee" operators
http://sources.redhat.com/ml/gdb-patches/2002-07/msg00458.html
I eventually decided that my prefered syntax was:
redirect [-a] [FILE [COMMAND]]
log [-a] [FILE [COMMAND]]
But people didn't care for the use of "-a". I still like this syntax; it's
symmetric, and it allows clearly "transcript [-a]". But it's pretty clear
to me that we won't reach a consensus on that. I believe Fernando liked it
and Andrew didn't.
I believe the best alternative at this point is:
set logging [redirect|log] [append|overwrite] FILE
show logging
The defaults would be log,overwrite; they could be explicitly specified in
order to overwrite a log file named append, if one wanted to do that.
Comments, anyone? Shall I repost the patch with that change? I'd really
like to see this feature added.
--
Daniel Jacobowitz
MontaVista Software Debian GNU/Linux Developer
^ permalink raw reply [flat|nested] 7+ messages in thread
* RFC: Syntax for logging
2003-06-21 17:24 RFC: Syntax for logging Daniel Jacobowitz
@ 2003-06-21 18:01 ` Doug Evans
2003-06-22 18:04 ` Andrew Cagney
1 sibling, 0 replies; 7+ messages in thread
From: Doug Evans @ 2003-06-21 18:01 UTC (permalink / raw)
To: Daniel Jacobowitz; +Cc: gdb-patches
Daniel Jacobowitz writes:
> Folks may remember the thread from a year ago:
> RFA: >, >>, and "tee" operators
> http://sources.redhat.com/ml/gdb-patches/2002-07/msg00458.html
>
> I eventually decided that my prefered syntax was:
> redirect [-a] [FILE [COMMAND]]
> log [-a] [FILE [COMMAND]]
> But people didn't care for the use of "-a". I still like this syntax; it's
> symmetric, and it allows clearly "transcript [-a]". But it's pretty clear
> to me that we won't reach a consensus on that. I believe Fernando liked it
> and Andrew didn't.
>
> I believe the best alternative at this point is:
> set logging [redirect|log] [append|overwrite] FILE
> show logging
> The defaults would be log,overwrite; they could be explicitly specified in
> order to overwrite a log file named append, if one wanted to do that.
>
> Comments, anyone? Shall I repost the patch with that change? I'd really
> like to see this feature added.
There's one useful piece of functionality that isn't in "set logging".
Suppose I want to do a one-off command without disturbing the current setting?
This is an inherent problem in all set/show commands.
If one could have a version of show commands that outputted a value
that is an acceptable argument to the set command, and if one
has a facility to capture the output of commands and record them
in variables, then one would have a general solution, but that's
a bit of work (but not that much work ;-).
In pseudo-gdb code:
set $foo $`show -for-set logging`
set logging new-value
mumble
set logging $foo
fwiw, I don't think you should add a logging facility until
you know how you're going to solve the one-off request.
One don't have to solve it right away, but one should at least
have thought about it.
It needn't be solved by something so grandiose of course.
This is where redirect/log have an advantage though
I'm guessing one could come up with something simple that
allowed one-off's with "set logging".
^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: RFC: Syntax for logging
2003-06-21 17:24 RFC: Syntax for logging Daniel Jacobowitz
2003-06-21 18:01 ` Doug Evans
@ 2003-06-22 18:04 ` Andrew Cagney
2003-06-22 18:07 ` Daniel Jacobowitz
1 sibling, 1 reply; 7+ messages in thread
From: Andrew Cagney @ 2003-06-22 18:04 UTC (permalink / raw)
To: Daniel Jacobowitz; +Cc: gdb-patches
> Folks may remember the thread from a year ago:
> RFA: >, >>, and "tee" operators
> http://sources.redhat.com/ml/gdb-patches/2002-07/msg00458.html
>
> I eventually decided that my prefered syntax was:
> redirect [-a] [FILE [COMMAND]]
> log [-a] [FILE [COMMAND]]
> But people didn't care for the use of "-a". I still like this syntax; it's
> symmetric, and it allows clearly "transcript [-a]". But it's pretty clear
> to me that we won't reach a consensus on that. I believe Fernando liked it
> and Andrew didn't.
>
> I believe the best alternative at this point is:
> set logging [redirect|log] [append|overwrite] FILE
> show logging
> The defaults would be log,overwrite; they could be explicitly specified in
> order to overwrite a log file named append, if one wanted to do that.
>
> Comments, anyone? Shall I repost the patch with that change? I'd really
> like to see this feature added.
Set show are consistent with the command line syntax. How does one turn
it off?
Andrew
^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: RFC: Syntax for logging
2003-06-22 18:04 ` Andrew Cagney
@ 2003-06-22 18:07 ` Daniel Jacobowitz
2003-06-22 18:32 ` Andrew Cagney
0 siblings, 1 reply; 7+ messages in thread
From: Daniel Jacobowitz @ 2003-06-22 18:07 UTC (permalink / raw)
To: Andrew Cagney; +Cc: gdb-patches
On Sun, Jun 22, 2003 at 02:04:29PM -0400, Andrew Cagney wrote:
> >Folks may remember the thread from a year ago:
> > RFA: >, >>, and "tee" operators
> > http://sources.redhat.com/ml/gdb-patches/2002-07/msg00458.html
> >
> >I eventually decided that my prefered syntax was:
> > redirect [-a] [FILE [COMMAND]]
> > log [-a] [FILE [COMMAND]]
> >But people didn't care for the use of "-a". I still like this syntax; it's
> >symmetric, and it allows clearly "transcript [-a]". But it's pretty clear
> >to me that we won't reach a consensus on that. I believe Fernando liked it
> >and Andrew didn't.
> >
> >I believe the best alternative at this point is:
> > set logging [redirect|log] [append|overwrite] FILE
>
> > show logging
> >The defaults would be log,overwrite; they could be explicitly specified in
> >order to overwrite a log file named append, if one wanted to do that.
> >
> >Comments, anyone? Shall I repost the patch with that change? I'd really
> >like to see this feature added.
>
> Set show are consistent with the command line syntax. How does one turn
> it off?
Hmm, two options:
set logging
unset logging
I like "unset logging"; how about you? The only thing we use unset for
at the moment is "unset environment" but I think it extends naturally.
--
Daniel Jacobowitz
MontaVista Software Debian GNU/Linux Developer
^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: RFC: Syntax for logging
2003-06-22 18:07 ` Daniel Jacobowitz
@ 2003-06-22 18:32 ` Andrew Cagney
2003-06-22 18:41 ` Daniel Jacobowitz
0 siblings, 1 reply; 7+ messages in thread
From: Andrew Cagney @ 2003-06-22 18:32 UTC (permalink / raw)
To: Daniel Jacobowitz; +Cc: gdb-patches
>
> Hmm, two options:
> set logging
Not this. It should behave like:
(gdb) set architecture
"set architecture" must be followed by "auto" or an architecture name.
> unset logging
>
> I like "unset logging"; how about you? The only thing we use unset for
> at the moment is "unset environment" but I think it extends naturally.
so (slightly wierd) yes this. Be sure to mention it in the help
message. Perhaphs, also accept ``set logging off'', and ``set logging
on'' as those are the first things I'd try :-)
Hmm, just noticed, the options are optional, I was thinking that they
were required.
set logging [redirect|log] [append|overwrite] FILE
The syntax will lead to confusion with things like:
set logging l
or
set logging redirect a
suggest instead:
set logging on [FILE]
default gdb.log, log, append?
set logging off
set logging file FILE
set logging append {true,false}
set logging redirect {true,false}
so that the [FILE] isn't context dependent. Realisticly, I think people
will only use:
set logging on
set logging off
Andrew
^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: RFC: Syntax for logging
2003-06-22 18:32 ` Andrew Cagney
@ 2003-06-22 18:41 ` Daniel Jacobowitz
2003-06-22 19:19 ` Daniel Jacobowitz
0 siblings, 1 reply; 7+ messages in thread
From: Daniel Jacobowitz @ 2003-06-22 18:41 UTC (permalink / raw)
To: Andrew Cagney; +Cc: gdb-patches
On Sun, Jun 22, 2003 at 02:32:41PM -0400, Andrew Cagney wrote:
> >
> >Hmm, two options:
> > set logging
>
> Not this. It should behave like:
>
> (gdb) set architecture
> "set architecture" must be followed by "auto" or an architecture name.
OK.
>
> > unset logging
> >
> >I like "unset logging"; how about you? The only thing we use unset for
> >at the moment is "unset environment" but I think it extends naturally.
>
> so (slightly wierd) yes this. Be sure to mention it in the help
> message. Perhaphs, also accept ``set logging off'', and ``set logging
> on'' as those are the first things I'd try :-)
>
> Hmm, just noticed, the options are optional, I was thinking that they
> were required.
>
> set logging [redirect|log] [append|overwrite] FILE
>
> The syntax will lead to confusion with things like:
>
> set logging l
> or
> set logging redirect a
Ugh, I'd forgotten about the abbreviations.
> suggest instead:
>
> set logging on [FILE]
> default gdb.log, log, append?
> set logging off
> set logging file FILE
> set logging append {true,false}
> set logging redirect {true,false}
>
> so that the [FILE] isn't context dependent. Realisticly, I think people
> will only use:
>
> set logging on
> set logging off
That looks good. I'll just ditch the unset idea.
--
Daniel Jacobowitz
MontaVista Software Debian GNU/Linux Developer
^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: RFC: Syntax for logging
2003-06-22 18:41 ` Daniel Jacobowitz
@ 2003-06-22 19:19 ` Daniel Jacobowitz
0 siblings, 0 replies; 7+ messages in thread
From: Daniel Jacobowitz @ 2003-06-22 19:19 UTC (permalink / raw)
To: Andrew Cagney, gdb-patches
On Sun, Jun 22, 2003 at 02:41:41PM -0400, Daniel Jacobowitz wrote:
> On Sun, Jun 22, 2003 at 02:32:41PM -0400, Andrew Cagney wrote:
> > >
> > >Hmm, two options:
> > > set logging
> >
> > Not this. It should behave like:
> >
> > (gdb) set architecture
> > "set architecture" must be followed by "auto" or an architecture name.
>
> OK.
>
> >
> > > unset logging
> > >
> > >I like "unset logging"; how about you? The only thing we use unset for
> > >at the moment is "unset environment" but I think it extends naturally.
> >
> > so (slightly wierd) yes this. Be sure to mention it in the help
> > message. Perhaphs, also accept ``set logging off'', and ``set logging
> > on'' as those are the first things I'd try :-)
> >
> > Hmm, just noticed, the options are optional, I was thinking that they
> > were required.
> >
> > set logging [redirect|log] [append|overwrite] FILE
> >
> > The syntax will lead to confusion with things like:
> >
> > set logging l
> > or
> > set logging redirect a
>
> Ugh, I'd forgotten about the abbreviations.
>
> > suggest instead:
> >
> > set logging on [FILE]
> > default gdb.log, log, append?
> > set logging off
> > set logging file FILE
> > set logging append {true,false}
> > set logging redirect {true,false}
> >
> > so that the [FILE] isn't context dependent. Realisticly, I think people
> > will only use:
> >
> > set logging on
> > set logging off
>
> That looks good. I'll just ditch the unset idea.
Hmm, what do you think of this idea?
The above set commands, and also:
log file CMD
"log" will obey "set logging append" and "set logging redirect".
An alternative, even simpler:
log CMD
"log" will obey append, redirect, and file, but works even when logging
is off.
--
Daniel Jacobowitz
MontaVista Software Debian GNU/Linux Developer
^ permalink raw reply [flat|nested] 7+ messages in thread
end of thread, other threads:[~2003-06-22 19:19 UTC | newest]
Thread overview: 7+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2003-06-21 17:24 RFC: Syntax for logging Daniel Jacobowitz
2003-06-21 18:01 ` Doug Evans
2003-06-22 18:04 ` Andrew Cagney
2003-06-22 18:07 ` Daniel Jacobowitz
2003-06-22 18:32 ` Andrew Cagney
2003-06-22 18:41 ` Daniel Jacobowitz
2003-06-22 19:19 ` Daniel Jacobowitz
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox