The javadoc on isInfo() says "Gets whether the current level is INFO or up."
 So, since the info level is above the error level, isInfo() returns true
for error messages.

So, since info is a less granular level than error, a feedback message using
error("foo") is at the error level and the info level (and warning and
debug, too).  I would expect if you check a feedback message using
info("foo") you would find that it is at the info level, but not at the
error level.
The message levels are debug -> info -> warning -> error -> fatal.

If you want a filter for only and explicitly info messages, then you
probably want something more like:

boolean accept(FeedbackMessage  message)
{
return message.getLevel() == FeedbackMessage.INFO;
}

Regards,
Matthew.

On Tue, Feb 17, 2009 at 08:24, walnutmon <[email protected]> wrote:

>
> I created a filter that does this:
>
> boolean accept(message)
> {
> return message.isInfo();
> }
>
> This returns true for messages created using "error("asdf")"
>
> To make sure I wasn't mistaken I added this:
>
> if(message.isError() && message.isInfo()){throw new
> RuntimeException("something");}
>
> That was triggered when I user "error(message)" too.  Is this expected
> behavior? and why?
>
> Thanks!
> Justin
> --
> View this message in context:
> http://www.nabble.com/FeedbackMessage-of-Level-%22Error%22%2C-isInfo%28%29-returns-True-tp22058333p22058333.html
> Sent from the Wicket - User mailing list archive at Nabble.com.
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: [email protected]
> For additional commands, e-mail: [email protected]
>
>


-- 
Matthew Rollins Hanlon
http://squareoftwo.org
_____________________
Hanlon's Razor:
"Never attribute to malice that which can be adequately explained by
stupidity."
http://wikipedia.org/wiki/Hanlon's_razor

Reply via email to