Wayback Machinekoobas.hobune.stream
May JUN Jul
Previous capture 13 Next capture
2021 2022 2023
1 capture
13 Jun 22 - 13 Jun 22
sparklines
Close Help
  • Products
  • Solutions
  • Made with Unity
  • Learning
  • Support & Services
  • Community
  • Asset Store
  • Get Unity

UNITY ACCOUNT

You need a Unity Account to shop in the Online and Asset Stores, participate in the Unity Community and manage your license portfolio. Login Create account
  • Blog
  • Forums
  • Answers
  • Evangelists
  • User Groups
  • Beta Program
  • Advisory Panel

Navigation

  • Home
  • Products
  • Solutions
  • Made with Unity
  • Learning
  • Support & Services
  • Community
    • Blog
    • Forums
    • Answers
    • Evangelists
    • User Groups
    • Beta Program
    • Advisory Panel

Unity account

You need a Unity Account to shop in the Online and Asset Stores, participate in the Unity Community and manage your license portfolio. Login Create account

Language

  • Chinese
  • Spanish
  • Japanese
  • Korean
  • Portuguese
  • Ask a question
  • Spaces
    • Default
    • Help Room
    • META
    • Moderators
    • Topics
    • Questions
    • Users
    • Badges
  • Home /
avatar image
0
Question by XienDev · Nov 18, 2012 at 03:26 PM · editorbuglogstack

Stack Trace returns null ?? wtf with my unity today?

Here is my code:

 using UnityEngine;
 using System.Collections;
 
 public class handler : MonoBehaviour {
     
     private string stack;
     private string message;
     
     
     void Start()
     {
         Application.RegisterLogCallbackThreaded(LogHandler);
     }
     
     
     void OnGUI ()
     {
         GUILayout.BeginVertical("Box");
         if (GUILayout.Button("Log something"))
         {
             Debug.LogError("Blablabla: "+Random.value.GetHashCode().ToString() + "\r\n");
         }
         
         GUILayout.TextArea(message + stack);
         GUILayout.EndVertical();
     }
     
     
     
     void LogHandler(string Message, string Stack, LogType type)
     {
         stack     = Stack;
         message = Message;
     }
 }

The question is: Why in editor it works fine, but compiled version -> not. I mean that when i click play button in unityeditor, stack returned is not null:

alt text

But compiled:

alt text

123.png (182.3 kB)
222.png (18.7 kB)
Comment
Add comment · Show 1
10 |3000 characters needed characters left characters exceeded
▼
  • Viewable by all users
  • Viewable by moderators
  • Viewable by moderators and the original poster
  • Advanced visibility
Viewable by all users
avatar image XienDev · Nov 18, 2012 at 04:06 PM 0
Share

hmmm... anybody ?

3 Replies

· Add your reply
  • Sort: 
avatar image
1
Best Answer

Answer by Loius · Nov 20, 2012 at 05:36 PM

There's no reason for Debug statements to work in a release build. It's a release build. There's no situation in which an end-user should see your debug information.

If you want to circumvent this sanity check, you'll need to implement your own stack tracing - not difficult, just time-consuming. You'd have to tell it every time you enter a function (or write some kind of invasive sniffer to watch your code as it executes).

Comment
Add comment · Show 1 · Share
10 |3000 characters needed characters left characters exceeded
▼
  • Viewable by all users
  • Viewable by moderators
  • Viewable by moderators and the original poster
  • Advanced visibility
Viewable by all users
avatar image XienDev · Nov 20, 2012 at 05:56 PM 0
Share

thanx for reply, I disabled unityplayer log, and try to make my log, which on error or bug on release will post Error and stack to log file, an user can make a bug report to forum, and in future releases from game, i need it cose the project at pre alfa stage, but i thing debug release will be not correct to post. hmm... will look at system diagnostick debug function =) thanx for reply

avatar image
1

Answer by dpk · Nov 18, 2012 at 10:36 PM

Check the "development build" box in your Build Settings. Just be sure to clear that box before you build your shippable binary!

Comment
Add comment · Share
10 |3000 characters needed characters left characters exceeded
▼
  • Viewable by all users
  • Viewable by moderators
  • Viewable by moderators and the original poster
  • Advanced visibility
Viewable by all users
avatar image
0

Answer by XienDev · Nov 19, 2012 at 07:18 AM

thanx for reply, but it's already cleaned, i made a simple project represents this bug (thing) from main project, any ideas ?:

alt text


безымянный.png (37.9 kB)
Comment
Add comment · Show 1 · Share
10 |3000 characters needed characters left characters exceeded
▼
  • Viewable by all users
  • Viewable by moderators
  • Viewable by moderators and the original poster
  • Advanced visibility
Viewable by all users
avatar image XienDev · Nov 19, 2012 at 07:53 AM 0
Share

Hmm.. but if development build is checked, than stack trace works fine =) ??? next question is: How to make release build shows stack trace?.

Your answer

Hint: You can notify a user about this post by typing @username

Up to 2 attachments (including images) can be used with a maximum of 524.3 kB each and 1.0 MB total.

Follow this Question

Answers Answers and Comments

11 People are following this question.

avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image

Related Questions

How can I fix the Unity Bug 1 Answer

Unity Editor lag 0 Answers

A node in a childnode? 1 Answer

Weird Point Lighting 1 Answer

DirectoryInfo().GetFiles works incorrectly in Standalone 2 Answers


Enterprise
Social Q&A

Social
Subscribe on YouTube social-youtube Follow on LinkedIn social-linkedin Follow on Twitter social-twitter Follow on Facebook social-facebook Follow on Instagram social-instagram

Footer

  • Purchase
    • Products
    • Subscription
    • Asset Store
    • Unity Gear
    • Resellers
  • Education
    • Students
    • Educators
    • Certification
    • Learn
    • Center of Excellence
  • Download
    • Unity
    • Beta Program
  • Unity Labs
    • Labs
    • Publications
  • Resources
    • Learn platform
    • Community
    • Documentation
    • Unity QA
    • FAQ
    • Services Status
    • Connect
  • About Unity
    • About Us
    • Blog
    • Events
    • Careers
    • Contact
    • Press
    • Partners
    • Affiliates
    • Security
Copyright © 2020 Unity Technologies
  • Legal
  • Privacy Policy
  • Cookies
  • Do Not Sell My Personal Information
  • Cookies Settings
"Unity", Unity logos, and other Unity trademarks are trademarks or registered trademarks of Unity Technologies or its affiliates in the U.S. and elsewhere (more info here). Other names or brands are trademarks of their respective owners.
  • Anonymous
  • Sign in
  • Create
  • Ask a question
  • Spaces
  • Default
  • Help Room
  • META
  • Moderators
  • Explore
  • Topics
  • Questions
  • Users
  • Badges