//自定义Error static public void LogError(object message, string customType) { if (EnableLog) { //TTLoger.LogError(string.Format("message:{0} customType:{1}", message, customType)); } LogConsole.LogError(message, customType); }
private void OnGUI() { string tb = "ToolbarButton"; //s = EditorGUIUtility.GetBuiltinSkin(EditorSkin.Inspector).FindStyle("SearchTextField"); //s1 = EditorGUIUtility.GetBuiltinSkin(EditorSkin.Inspector).FindStyle("CN EntryInfo"); if (GUI.Button(new Rect(10, 10, 400, 200), "Print Log")) { Debug.Log("Test Unity Log"); Assert.IsTrue(false); LogConsole.Log("Test Log"); LogConsole.Log("MyTag", "Test Log With Tag"); LogConsole.Log("Test Log With Context", this); LogConsole.Log("MyTag", "Test Log With Tag And Context", this); LogConsole.LogFormat("Test Log {0} {1}({2},{3})", "With", "Format", 1, 2.9f); LogConsole.LogFormat(this, "Test Log {0} {1}({2},{3})", "With", "Format And Context", 1, 2.9f); LogConsole.LogWarning("Test Warning"); LogConsole.LogError("Test Error"); try { throw new System.Exception("Test Exception"); } catch (System.Exception ex) { LogConsole.LogException(ex); } try { throw new System.Exception("Test Exception With Context"); } catch (System.Exception ex) { LogConsole.LogException(ex, this); } Debug.LogAssertion("Unity assertion"); LogConsole.Assert(false, "Test if this assert can be printed in console"); } }
public void LogError_NullMessage_ThrowArgumentNullException() { log.LogError(null); }