Is there a way to force Debug.Log(string, object) to ALWAYS draw the context?

I’m outputting many lines using calls to Debug.Log(string, object), and in unity, I’m relying on the feature of drawing a highlighting outline around the context GameObject in the hierarchy tab when I click on a log item in the console tab.

However, the way unity currently highlights the context GameObject is that it draws a rounded rectangle around it in the Hierarchy tab, which later fades out. The strange behaviour I’m seeing is that the highlight doesn’t get redrawn if the context of the newly-clicked-on log item is the same as the context of the previously-clicked-on log item.

This is causing me problems because some of the context GameObjects for log items are invalid (ie not in the scene anymore) and thus, really SHOULDN’T be getting a highlight drawn in the hierarchy tab, so it’s becoming a real pain to figure out whether the log item I clicked on has an invalid context GameObject, or if it’s just the SAME context GameObject as the previously clicked on log item.

The only workaround I’ve found is to have a “dummy” log item with a known context GameObject (that will never be the context for any other log item), and I have to click on that log item in between clicking any other log items in the console tab, to force unity to redraw the highlighting outline in the hierarchy tab. This is a real nuisance, especially when I have hundreds of log items I need to be looking thru and comparing context GameObjects for.

So is there a setting somewhere that I can change, or some code-accessible internal variable/method that will allow me to “reset” the most recent context Unity drew a highlight for, or something?

I used the code from here link text to highlight a context.

I added it manually when I selected a Context.