Playmaker Forum
PlayMaker News => General Discussion => Topic started by: mrminico on January 12, 2023, 04:48:40 AM
-
Does anyone know of an action that can get unity Console logs and save it into a string?
Example: there's an error on Unity's end I'll be able to get the log and plug it into a string to see it in-game.
-
Hi.
I did a quick search and with C# script it seems not to be possible.
If its not possible in C# then it will also not be possible with an action :)
if you overlooked and it is possible in C#, then post a link :)
-
I actually found a way to do it. A combination of both Scripts and Playmaker
public class DebugLog : MonoBehaviour
{
public string log;
private void Start()
{
log = "";
Application.logMessageReceived += HandleLog;
}
private void HandleLog(string logString, string stackTrace, LogType type)
{
log += logString + "\n";
}
}
And then I used Get Property Action set the Target Object to Debug Script and Property to Log. I then stored the string and set the UI to show me the results.
-
Hi.
Oh nice!
Does it work in a build?
-
Yes, it worked on the build and displayed the console information through the string I stored.