[SOLVED] How to display messages in the error console, but continue code execution

I’m trying to intentionally display certain debug logs in the error console window just so they stand out more during debugging.

I have:

public void Start()
{
     Debug.Log("Here 1");
     SpecialLog("The player opened the door");
     Debug.Log ("Here 2");
}

  public void SpecialLog(string msg)
   {
        System.Exception e = new System.Exception(msg);
        throw e;
   }

The message is displayed in the error console.
But, code execution stops because the exception occurred. So “Here 2” is never reached.

I can use Debug.LogWarning(“…”) to make certain logs stand out. It appears in the warning console. I want to take it a step further and put it in the error console.

Is there another way of doing this?

Continuing code after an exception is a bad idea.

A message tells the user “This thing happened”
A warning tells the user “This bad thing happened, but its cool, I got this”
An exception tells the user “This really bad thing happened. And its got me freaked out and I can’t deal with it. HELP.”

If your code can recover gracefully from a problem, then its not an exception, and should not be treated as one.

If you still want to do this Have you tried using Debug.LogError instead of explicitly throwing an exception?

I didn’t even realize that Debug.LogError existed. I was always using LogWarning.
Thanks.