- Home /
Disable hashing of function names in unity build
I almost finished my first game in unity. For testing i implemented a bugreport system. It basically just prints the whole debug.log to a file. I know that this is a bad idea on how to handle bugs, but I don't have a lot of time to put into this game no more. When there is a stacktrace the function names which represent the location of where the error occured are hashed though. Is there any way to turn this off ?
Here is the code of how I save the report:
private void OnEnable()
{
Application.logMessageReceived += Log;
}
public void Log(string logString, string stackTrace, LogType type)
{
if (type == LogType.Warning)
return;
log += "[" + System.DateTime.Now + "] " + logString + "\n";
if (type == LogType.Error || type == LogType.Exception)
{
log += stackTrace + "\n";
}
}
private void SaveReport()
{
//...unimportant stuff here
filename = Application.dataPath + "/BugReport" + numberOfError + "-"+ GetHashString(System.DateTime.Now.ToString())+ ".txt";
//... more unimportant stuff here
tw.WriteLine(log);
//...more unimportant stuff here
tw.Close();
Back();
}
Here is an example of a stacktrace which hashes the function names:
[16.12.2021 16:31:21] NullReferenceException
Combat.Knockback (UnityEngine.Vector2 _angle, System.Single _strength, UnityEngine.Vector2 _hitPoint) (at <44bc4ec92a024525b366363c6bd7d0c4>:0)
Combat.Damage (System.Single _amount, UnityEngine.Vector2 _angle, System.Single _strength, UnityEngine.Vector2 _hitOrigin) (at <44bc4ec92a024525b366363c6bd7d0c4>:0)
Weapon.CheckAttack () (at <44bc4ec92a024525b366363c6bd7d0c4>:0)
Weapon.AnimationActionTrigger () (at <44bc4ec92a024525b366363c6bd7d0c4>:0)
WeaponAnimationToWeapon.AnimationActionTrigger () (at <44bc4ec92a024525b366363c6bd7d0c4>:0)
Answer by bl4ckfoot · Dec 18, 2021 at 03:38 PM
Creating a development build seems to do the trick. I'm not completely convinced though. I was only able to test it on my pc.
Your answer
Follow this Question
Related Questions
How to get the linenumber from a stackframe? 1 Answer
Multiple Cars not working 1 Answer
Distribute terrain in zones 3 Answers
How to make an interactive App to play on 4 different monitor? 0 Answers