From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 13784 invoked by alias); 12 Aug 2010 16:07:55 -0000 Received: (qmail 13559 invoked by uid 22791); 12 Aug 2010 16:07:54 -0000 X-SWARE-Spam-Status: No, hits=-2.0 required=5.0 tests=AWL,BAYES_00,T_RP_MATCHES_RCVD X-Spam-Check-By: sourceware.org Received: from mail.codesourcery.com (HELO mail.codesourcery.com) (38.113.113.100) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Thu, 12 Aug 2010 16:07:50 +0000 Received: (qmail 16653 invoked from network); 12 Aug 2010 16:07:48 -0000 Received: from unknown (HELO orlando.localnet) (pedro@127.0.0.2) by mail.codesourcery.com with ESMTPA; 12 Aug 2010 16:07:48 -0000 From: Pedro Alves To: gdb-patches@sourceware.org Subject: Re: [patch] set logging {redirect|overwrite} warning Date: Thu, 12 Aug 2010 16:07:00 -0000 User-Agent: KMail/1.13.2 (Linux/2.6.31-11-rt; KDE/4.4.2; x86_64; ; ) Cc: Jan Kratochvil References: <20100806182919.GA3654@host1.dyn.jankratochvil.net> In-Reply-To: <20100806182919.GA3654@host1.dyn.jankratochvil.net> MIME-Version: 1.0 Content-Type: Text/Plain; charset="iso-8859-1" Content-Transfer-Encoding: 7bit Message-Id: <201008121707.46348.pedro@codesourcery.com> X-IsSubscribed: yes Mailing-List: contact gdb-patches-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: gdb-patches-owner@sourceware.org X-SW-Source: 2010-08/txt/msg00177.txt.bz2 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