Join 34,000+ subscribers and receive articles from our
blog about software quality, testing, QA and security.

How a log entries grouped?


#1

I’m using the PostSharp together with SmartInspect to log enter exit methods.
Besides that, we log general information in code.

I’m using EnterMethod/LeaveMethod to make sure log entries are indented.

I’m seeing that calls are not indented in the order that I expected.

How does SmartInspect determined if log entries are related?

Hope it’s clear what I mean.

Regards,
Michael


#2

Hello Michael,

Thanks for your posting. EnterMethod/LeaveMethod are not grouped by their title/log message or a similar property. The log is simply indented for each EnterMethod (and unindented for each LeaveMethod). If you are seeing an unexpected EnterMethod/LeaveMethod behavior this is most lilely related to multiple threads being displayed in the same view in the SmartInspect Console. As multiple threads can write log statements in an interleaved way, the EnterMethod/LeaveMethod statements may also be interleaved and may not necessarily match each other. To solve this, you would usually create a view for each thread to see the threads independently from each other (e.g. via Edit | Apply Builtin AutoView Rule or a custom AutoView rule).

I hope this helps and please let me know in case you have any further questions.

Regards,
Tobias