This is the mail archive of the
frysk@sourceware.org
mailing list for the frysk project.
Re: [SCM] master: Fix minor logging errors.
- From: Mark Wielaard <mark at klomp dot org>
- To: frysk at sourceware dot org
- Cc: rmoseley at sourceware dot org
- Date: Fri, 14 Mar 2008 12:41:46 +0100
- Subject: Re: [SCM] master: Fix minor logging errors.
- References: <20080313154756.26703.qmail@sourceware.org>
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
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();