public inbox for frysk@sourceware.org
 help / color / mirror / Atom feed
From: Mark Wielaard <mark@klomp.org>
To: frysk@sourceware.org
Cc: rmoseley@sourceware.org
Subject: Re: [SCM]  master: Fix minor logging errors.
Date: Fri, 14 Mar 2008 11:42:00 -0000	[thread overview]
Message-ID: <1205494906.27548.39.camel@dijkstra.wildebeest.org> (raw)
In-Reply-To: <20080313154756.26703.qmail@sourceware.org>

[-- Attachment #1: Type: text/plain, Size: 1138 bytes --]

Hi Rick,

On Thu, 2008-03-13 at 15:47 +0000, rmoseley@sourceware.org wrote:
> commit f7bc2b759574fce3842b3b60fe473a9bb8b10431
> Author: Rick Moseley <rmoseley@localhost.localdomain>
> Date:   Thu Mar 13 10:47:17 2008 -0500
> 
>     Fix minor logging errors.
>     
>     * CLI.java: Synchronize message adding when type specified.
>     * LoadCommand.java: Use message logger instead of direct print.

Nice cleanup of message handling, but... As mentioned in bugzilla #5938
it causes one testsuite failure in frysk.bindir.TestFhpd. The fix was
pretty easy though, just make sure that all messages logged by any of
the startup Commands are published to the user before showing the first
prompt:

frysk-core/frysk/bindir/ChangeLog
2008-03-14  Mark Wielaard  <mwielaard@redhat.com>

    * fhpd.java (CommandLine.run): Make sure all messages are flushed
    before first prompt.

frysk-core/frysk/hpd/ChangeLog
2008-03-14  Mark Wielaard  <mwielaard@redhat.com>

    * CLI.java (flushMessages): Make public and document for usage
    in fhpd.

Committed and pushed. All frysk.bindir.TestFhpd test PASS again and no
regressions.

Cheers,

Mark

[-- Attachment #2: cli-flush.patch --]
[-- Type: text/x-patch, Size: 1162 bytes --]

diff --git a/frysk-core/frysk/bindir/fhpd.java b/frysk-core/frysk/bindir/fhpd.java
index af1a5bc..aa8dca7 100644
--- a/frysk-core/frysk/bindir/fhpd.java
+++ b/frysk-core/frysk/bindir/fhpd.java
@@ -139,6 +139,10 @@ public class fhpd {
 		LoadCommand.load(command, cli);
 	    }
 
+	    // Make sure any messages logged by the Attach or Load commands
+	    // are displayed to the user before the first prompt.
+	    cli.flushMessages();
+
 	    try {
 		do {
 		    line = reader.readLine(cli.getPrompt());
diff --git a/frysk-core/frysk/hpd/CLI.java b/frysk-core/frysk/hpd/CLI.java
index a95bcdf..1d47869 100644
--- a/frysk-core/frysk/hpd/CLI.java
+++ b/frysk-core/frysk/hpd/CLI.java
@@ -337,7 +337,10 @@ public class CLI {
 	}
     }
 
-    private void flushMessages() {
+    // Makes sure that all messages for the user by commands through
+    // addMessage() are displayed. Normally called after an update event
+    // or when a command has been executed before displaying a prompt.
+    public void flushMessages() {
 	synchronized (messages) {
 	    for (Iterator iter = messages.iterator(); iter.hasNext();) {
 		Message tempmsg = (Message) iter.next();

           reply	other threads:[~2008-03-14 11:42 UTC|newest]

Thread overview: expand[flat|nested]  mbox.gz  Atom feed
 [parent not found: <20080313154756.26703.qmail@sourceware.org>]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1205494906.27548.39.camel@dijkstra.wildebeest.org \
    --to=mark@klomp.org \
    --cc=frysk@sourceware.org \
    --cc=rmoseley@sourceware.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).