Avoid Unity3D internal log source from Player.log
Hi everyone, I was searching through internet a way to properly output the log of my application, I understand the ways of using things like [Conditional()] and #define but it's not my logs that I'm trying to filter out. How can I filter Unity internal logs, what I mean are lines like:
The referenced script on this Behaviour (Game Object 'Text') is missing!
(Filename: Line: 1789)
Unsupported texture format - Texture2D::EncodeTo functions do not support compressed texture formats.
requesting resize 1920 x 1080
Using native desktop resolution 1920 x 1080
requesting fullscreen 1920 x 1080 at 0 Hz
Desktop is 1920 x 1080 @ 60 Hz
Unloading 84 unused Assets to reduce memory usage. Loaded Objects now: 3203.
Total: 32.192000 ms (FindLiveObjects: 0.626000 ms CreateObjectMapping: 0.147000 ms MarkObjects: 31.035000 ms DeleteObjects: 0.384000 ms)
These are specifically made by Unity and saved into my player.log. Is there a way to avoid printing those or should I just output my actual logs in another file? Thanks in advance!
Answer by AzeExMachina · Jan 24, 2019 at 01:37 PM
In the end I got around this issue by rerouting all the logs to a custom file and creating my custom logger
private void Awake()
{
Application.logMessageReceivedThreaded += Handler;
[...]
}
private void Handler(string condition, string stackTrace, LogType type)
{
switch (type)
{
case LogType.Log:
Info(null, condition);
break;
case LogType.Warning:
Warn(null, condition);
break;
case LogType.Error:
Err(null, condition);
break;
case LogType.Exception:
Err(null, condition);
break;
case LogType.Assert:
Debug(null, condition);
break;
default:
Info(null, condition);
break;
}
}
Answer by xxmariofer · Jan 22, 2019 at 11:23 AM
I know there is a page inisde the playersettings > othersettings > logging in which you can enable and disable some logs but not sure if the ones you are looking for sorry.
Answer by AzeExMachina · Jan 22, 2019 at 02:30 PM
@xxmariofer I've tried disabling those but even when everything is turned off I'm receiving those messages from Unity
Your answer
![](https://koobas.hobune.stream/wayback/20220612190231im_/https://answers.unity.com/themes/thub/images/avi.jpg)
Follow this Question
Related Questions
Unity windows standalone build crashes on opening output_log.txt if built on a different machine 0 Answers
How can I show a prompt for the user when my standalone application crashes? 0 Answers
undefined symbol error related to WebRTC while building in Xcode 0 Answers
Reset PlayerPrefs on Build? 2 Answers
Standalone player default window size? 2 Answers