cancel
Showing results for 
Search instead for 
Did you mean: 

Logging API does not behave as expected

Former Member
0 Kudos

I try to get me going with logging and tracing in

Sneak Preview II.

I face some difficulties with using <i>entering(...)</i> and <i>exiting(...):

public static void main(String[] args)

{

String _method = "main";

LogRecord lr = loc.entering(_method);

loc.assertion(lr.getGroup() != null, "Group == null");

loc.groupT("displayed ???????????");

loc.exiting();

}</i>

It seems that <i>entering()</i> does not create a group:

- The assertion fails, the group is null.

- There is now output for <i>groupT()</i>

- exiting does not use the subloc in its output

According to the API doc and the tutorial, I would

expect this to work in that manner.

Regards

Andreas

Accepted Solutions (0)

Answers (1)

Answers (1)

0 Kudos

Hi, Andreas,

probably you are not interested anymore but: this is because grouping is turned off by default (is caused memory leaks if not used correctly, for example, you should put loc.exiting() into a finally-clause). You can turn it on by calling loc.setAutoGroupingOn(true).

Cheers

Heiko