Lots of my macros are calling other macros and it's great.
The problem comes when I need to troubleshoot an issue, so I added logging with this action:
• The '\t' ensures the line stands out from the normal KM logs
• It uses %ExecutingThisMacro% instead of %ExecutingMacro% so the macro the log action appears in will be referenced
• 'Start' can really be anything, but here I'm just denoting the start of the macro
After using that in a bunch of places, now my KM Engine Log looks like this:
What I like about this is there is the tab I put in to separate the KM logs from my own logs. It's a good start, but I would like to take it a step further.
Every time I call a macro from another macro, I would like my log to use another '\t' in the prefix. Of course when the macro returns, I want there to be 1 less '\t'.
How can I keep track of this? I thought about modifying the tab count manually at the start and end of every macro, but I'm not excited about the overhead of doing that every time I write a macro.
Essentially what I need is a way to check the current depth of a particular macro. Any ideas?