OpenLog - Feature Request: Indent view rows to indicate how many calls deepCreated on |
Mar 19, 2009 |
Created by |
John Smart |
Status |
Submitted |
Changing the "Message" column in the view to prefix with a period and space character for each call deep has been one of the best hacks to OpenLog I've tried! For long agents I can roughly see the agent go in and out of calls, and it shows me an outline of what's been going on.
To see what I'm talking about, try changing the Message column in OpenLog.nsf's views from
@If(LogEventType = "Error"; LogErrorMessage; LogMessage)
to
@Repeat(". "; @Max(0; @Elements(@Trim(LogStackTrace)) - 1)) + @If(LogEventType = "Error"; LogErrorMessage; LogMessage)
Two performance thoughts if you were to take this idea and implement it.
1) LogStackTrace sometimes has an empty element on the end, hence the need for @Trim(). If you fixed that, then the @Trim() could be removed. OR....
2) It may be much better to optimize it by changing the code that generates the OpenLog documents. For example, including a LogStackDepth numeric field (zero for the agent's Initialize), turning the column formula to:
@Repeat(". "; @If(@IsAvailable(LogStackDepth); LogStackDepth; @Max(0; @Elements(@Trim(LogStackTrace)) - 1))) + @If(LogEventType = "Error"; LogErrorMessage; LogMessage)
or maybe it would be better to actually generate the prefix string on write, so that the column formula could be:
@If(@IsAvailable(LogStackDepthPrefix); LogStackDepthPrefix; @Repeat(". "; @Max(0; @Elements(@Trim(LogStackTrace)) - 1))) + @If(LogEventType = "Error"; LogErrorMessage; LogMessage)
This way, as long as the prefix exists, we're just adding two strings and skipping the whole @Repeat business. Not sure if that's worth the extra milliseconds spent by the class that generates the code, though.
Taken Actions by OwnersNo actions have been taken yet.