This is the mail archive of the
gdb-patches@sourceware.org
mailing list for the GDB project.
Re: [patch] set logging {redirect|overwrite} warning
- From: Pedro Alves <pedro at codesourcery dot com>
- To: gdb-patches at sourceware dot org
- Cc: Jan Kratochvil <jan dot kratochvil at redhat dot com>
- Date: Thu, 12 Aug 2010 17:07:46 +0100
- Subject: Re: [patch] set logging {redirect|overwrite} warning
- References: <20100806182919.GA3654@host1.dyn.jankratochvil.net>
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