Hi,
im working on a small editor-script and want to know, how can i clear the console/output window of debug-messages?
Ive created an editor-script which gives me output to the console while im working in edit-mode. I know about the "clear & clear on play"-button, but i want to add clearing the console-output with an shortcut, without clicking the clear button manually.
Is that possible?
After George's answer, I found the need to write it in JavaScript. Here's the equivalent snippet:
import System;
import System.Reflection;
public static function ClearLog()
{
var assembly : Assembly = Assembly.GetAssembly(typeof(SceneView));
var type : Type = assembly.GetType("UnityEditor.LogEntries");
var method : MethodInfo = type.GetMethod("Clear");
var object = new Object();
method.Invoke(object, null);
}
for 4.3.4, it’s “UnityEditorInternal.LogEntries” in assembly which contains “UnityEditor.ActiveEditorTracker”.
public static void ClearLog()
{
var assembly = Assembly.GetAssembly(typeof(UnityEditor.ActiveEditorTracker));
var type = assembly.GetType("UnityEditorInternal.LogEntries");
var method = type.GetMethod("Clear");
method.Invoke(new object(), null);
}