protected override void Append(LoggingEvent loggingEvent) { UnityObjectPair unityObjectPair = loggingEvent.MessageObject as UnityObjectPair; Object unityObject = (null == unityObjectPair) ? null : unityObjectPair.UnityObject; string renderLoggingEvent = loggingEvent.RenderedMessage; if (Layout != null) { renderLoggingEvent = RenderLoggingEvent(loggingEvent); } Level level = loggingEvent.Level; if (level < Level.Warn) { Debug.Log(renderLoggingEvent, unityObject); } else if (level < Level.Error) { Debug.LogWarning(renderLoggingEvent, unityObject); } else if (level < Level.Off) { Debug.LogError(renderLoggingEvent, unityObject); } if (null != loggingEvent.ExceptionObject) { Debug.LogException(loggingEvent.ExceptionObject, unityObject); } }
public void RenderObject(RendererMap rendererMap, object obj, TextWriter writer) { if (obj == null) { writer.Write(SystemInfo.NullText); return; } UnityObjectPair unityObjectPair = obj as UnityObjectPair; if (unityObjectPair == null) { rendererMap.FindAndRender(obj, writer); return; } writer.Write(unityObjectPair.m_message ?? SystemInfo.NullText); }