Debugging in HealthShare
Hi, if you develop production with HealthShare, you may have noticed there is a nice tracing feature available - HS.Util.Trace.Operations. This feature allows visually tracing debug information, in structured way. It complements good old logging macros like $$$LOGINFO, $$$TRACE and alike.
I use this feature a lot. However, it has limited functionality, it works nice with classes that extend XML Adapter, streams or data types, but it doesn't work well with arbitrary objects that do no extend from XML Adapter.
I decided to implement a subclass of the trace helper class HS.Util.Trace.Helper and add the missing functionality.
here is the code I added:
I have used a nice feature of redirecting output to variable, - added following class method to my trace helper class.
you can see the sample output in the following picture.
All you need in you business component, is to add your trace helper subclass to the list of base classes and call do ..HSTrace() method or its macro equivalent $$$HSTRACE with your desired parameters.
Hope you find this little improvement useful.