I am using NLog in other parts of my code to log items.
I then used an NLog custom target to direct my logs to Unity Debug as to use the Unity Console when useful, etc.
When I use the MobileConsoleKit my logs do not show up, even if they do show up in the Unity Console (and another software using )
I looked at the code
LogReceiver.cs line 23
If I change this to
Application.logMessageReceivedThreaded += LogMessageReceived;
Then my logs start to show up, but then eventually stop.
When I open the MobileConsole I get
UnityException: get_anchoredPosition can only be called from the main thread.
Constructors and field initializers will be executed from the loading thread when loading a scene.
Don't use this function in the constructor or field initializers, instead move initialization code to the Awake or Start function.
UnityEngine.RectTransform.get_anchoredPosition () (at <54724222b7684530a2810ae1eac94ec7>:0)
UnityEngine.RectTransform.get_offsetMin () (at <54724222b7684530a2810ae1eac94ec7>:0)
MobileConsole.UI.RecycleScrollView.IsViewAtBottom () (at Assets/Tools/Mobile Console/Internal/RecycleScrollView/RecycleScrollView.cs:555)
MobileConsole.UI.LogView.OnLogReceived (MobileConsole.LogInfo logInfo) (at Assets/Tools/Mobile Console/Internal/Scripts/Views/LogView.cs:96)
MobileConsole.LogReceiver.LogMessageReceived (System.String message, System.String stackTrace, UnityEngine.LogType type) (at Assets/Tools/Mobile Console/Internal/Scripts/Core/LogReceiver.cs:45)
UnityEngine.Application.CallLogCallback (System.String logString, System.String stackTrace, UnityEngine.LogType type, System.Boolean invokedOnMainThread) (at <54724222b7684530a2810ae1eac94ec7>:0)
UnityEngine.Debug:LogWarning(Object)
UnityDebugLogTarget:Write(LogEventInfo) (at Assets/Scripts/Valeo/UnityDebugLogTarget.cs:18)
NLog.Targets.Target:Write(AsyncLogEventInfo)
NLog.Targets.Target:Write(IList1) NLog.Targets.Target:WriteAsyncThreadSafe(IList1)
NLog.Targets.Target:WriteAsyncLogEvents(IList`1)
NLog.Targets.Wrappers.AsyncTargetWrapper:WriteEventsInQueue(Int32, String)
NLog.Targets.Wrappers.AsyncTargetWrapper:ProcessPendingEvents(Object)
System.Threading._ThreadPoolWaitCallback:PerformWaitCallback()
Any Ideas?
I am using NLog in other parts of my code to log items.
I then used an NLog custom target to direct my logs to Unity Debug as to use the Unity Console when useful, etc.
When I use the MobileConsoleKit my logs do not show up, even if they do show up in the Unity Console (and another software using )
I looked at the code
LogReceiver.cs line 23
If I change this to
Application.logMessageReceivedThreaded += LogMessageReceived;
Then my logs start to show up, but then eventually stop.
When I open the MobileConsole I get
UnityException: get_anchoredPosition can only be called from the main thread.
Constructors and field initializers will be executed from the loading thread when loading a scene.
Don't use this function in the constructor or field initializers, instead move initialization code to the Awake or Start function.
UnityEngine.RectTransform.get_anchoredPosition () (at <54724222b7684530a2810ae1eac94ec7>:0)
UnityEngine.RectTransform.get_offsetMin () (at <54724222b7684530a2810ae1eac94ec7>:0)
MobileConsole.UI.RecycleScrollView.IsViewAtBottom () (at Assets/Tools/Mobile Console/Internal/RecycleScrollView/RecycleScrollView.cs:555)
MobileConsole.UI.LogView.OnLogReceived (MobileConsole.LogInfo logInfo) (at Assets/Tools/Mobile Console/Internal/Scripts/Views/LogView.cs:96)
MobileConsole.LogReceiver.LogMessageReceived (System.String message, System.String stackTrace, UnityEngine.LogType type) (at Assets/Tools/Mobile Console/Internal/Scripts/Core/LogReceiver.cs:45)
UnityEngine.Application.CallLogCallback (System.String logString, System.String stackTrace, UnityEngine.LogType type, System.Boolean invokedOnMainThread) (at <54724222b7684530a2810ae1eac94ec7>:0)
UnityEngine.Debug:LogWarning(Object)
UnityDebugLogTarget:Write(LogEventInfo) (at Assets/Scripts/Valeo/UnityDebugLogTarget.cs:18)
NLog.Targets.Target:Write(AsyncLogEventInfo)
NLog.Targets.Target:Write(IList
1) NLog.Targets.Target:WriteAsyncThreadSafe(IList1)NLog.Targets.Target:WriteAsyncLogEvents(IList`1)
NLog.Targets.Wrappers.AsyncTargetWrapper:WriteEventsInQueue(Int32, String)
NLog.Targets.Wrappers.AsyncTargetWrapper:ProcessPendingEvents(Object)
System.Threading._ThreadPoolWaitCallback:PerformWaitCallback()
Any Ideas?