[patch] set logging {redirect|overwrite} warning

Pedro Alves pedro@codesourcery.com
Thu Aug 12 16:07:00 GMT 2010


On Friday 06 August 2010 19:29:19, Jan Kratochvil wrote:

> (gdb) set logging on
> Copying output to gdb.txt.
> (gdb) set logging redirect 
> Already logging to gdb.txt.  You should turn the logging off and on to make the new setting effective.

This is fine with me.  "set logging redirect" could take affect on
the fly; "set logging overwrite", not so clear.

> +static void
> +set_logging_overwrite (char *args, int from_tty, struct cmd_list_element *c)
> +{
> +  if (saved_filename)
> +    fprintf_unfiltered (gdb_stdout, _("Already logging to %s.  You should "
> +				      "turn the logging off and on to make "
> +				      "the new setting effective.\n"),
> +			saved_filename);

Any reason to not use "warning" instead of "fprintf_unfiltered"?
(if you switch, remember to drop \n).

I'd suggest s/Already/Currently/ and s/You should//.

Since there's more than one place with the same string, it'd be nice
to abstract that out to a "warn_reenable_logging_to_take_effect"
function, or some such.

-- 
Pedro Alves



More information about the Gdb-patches mailing list