public inbox for frysk@sourceware.org
 help / color / mirror / Atom feed
* Re: [SCM]  master: Fix minor logging errors.
       [not found] <20080313154756.26703.qmail@sourceware.org>
@ 2008-03-14 11:42 ` Mark Wielaard
  0 siblings, 0 replies; only message in thread
From: Mark Wielaard @ 2008-03-14 11:42 UTC (permalink / raw)
  To: frysk; +Cc: rmoseley

[-- 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();

^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2008-03-14 11:42 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
     [not found] <20080313154756.26703.qmail@sourceware.org>
2008-03-14 11:42 ` [SCM] master: Fix minor logging errors Mark Wielaard

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).