newbie questions

40 views
Skip to first unread message

Will Lee

unread,
Jan 9, 2012, 6:21:38 PM1/9/12
to gwt-log
Hello,
I just started learning GWT and gwt-log, and have some questions.
I used Log4j before, and it's great that gwt-log has similar feel to
it.

I was wondering how to configure which class to show logging
selectively.
Say that I put logging statements to both class A and B.
Is there a way to make the logging visible for only class A?
Is this something that I can configure in gwt.xml?
or do I need to add .properties file (similar to log4j.properties)?

Thanks for your time!

Fred Sauer

unread,
Jan 9, 2012, 9:41:40 PM1/9/12
to gwt...@googlegroups.com
http://code.google.com/p/gwt-log/wiki/GettingStarted#Use_logging_categories


--
You received this message because you are subscribed to the Google Groups "gwt-log" group.
To post to this group, send email to gwt...@googlegroups.com.
To unsubscribe from this group, send email to gwt-log+u...@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/gwt-log?hl=en.




--
Fred Sauer
fr...@allen-sauer.com

Will Lee

unread,
Jan 10, 2012, 1:11:28 PM1/10/12
to gwt-log
Thanks for quick reply, but I'm not quite sure about the usage of the
category.

What I am trying to achieve is, for example,
if ClassA has logging statements
Log.debug("construct A")
Log.debug("hello A")

and classB has
Log.debug("construct B")
Log.debug("hello B")

I get logging output like this:
construct A
construct B
hello A
hello B

now, I want to see only logging outputs of classA like this:
construct A
hello A

If I were using Log4j, I would set log4j.properties
log4j.logger.ClassA=debug
log4j.logger.ClassB=error

How can I achieve the similar results with gwt-log?


On Jan 9, 9:41 pm, Fred Sauer <f...@allen-sauer.com> wrote:
> http://code.google.com/p/gwt-log/wiki/GettingStarted#Use_logging_cate...
>
>
>
>
>
>
>
>
>
> On Mon, Jan 9, 2012 at 3:21 PM, Will Lee <neobi...@gmail.com> wrote:
> > Hello,
> > I just started learning GWT and gwt-log, and have some questions.
> > I used Log4j before, and it's great that gwt-log has similar feel to
> > it.
>
> > I was wondering how to configure which class to show logging
> > selectively.
> > Say that I put logging statements to both class A and B.
> > Is there a way to make the logging visible for only class A?
> > Is this something that I can configure in gwt.xml?
> > or do I need to add .properties file (similar to log4j.properties)?
>
> > Thanks for your time!
>
> > --
> > You received this message because you are subscribed to the Google Groups
> > "gwt-log" group.
> > To post to this group, send email to gwt...@googlegroups.com.
> > To unsubscribe from this group, send email to
> > gwt-log+u...@googlegroups.com.
> > For more options, visit this group at
> >http://groups.google.com/group/gwt-log?hl=en.
>
> --
> Fred Sauer
> f...@allen-sauer.com

Fred Sauer

unread,
Jan 10, 2012, 11:12:48 PM1/10/12
to gwt...@googlegroups.com
You would log more like this:
    Log.debug("com.foo.myproject.mycategory", "2 + 2 = 5, for large values of two", exception);

Reply all
Reply to author
Forward
0 new messages