Search Unity

SRDebugger - On-Device Console, Options Panel, and Bug Reporter.

Discussion in 'Assets and Asset Store' started by Simie, Feb 7, 2015.

  1. Simie

    Simie

    Joined:
    Oct 26, 2012
    Posts:
    456
    Just to confirm - the value is updating correctly when tapping and entering a new number via text, or hitting the arrows, but not when dragging?

    I have attached an updated OptionDefinition.cs that has an additional parameter to pass in custom attributes, e.g.

    _options.Add(OptionDefinition.Create("some_control",
    () => something(),
    (newValue) => something.else = newValue,
    Category, attributes: new Attribute[] { new NumberRangeAttribute(0, 100) }
    ));
     

    Attached Files:

  2. Meatloaf4

    Meatloaf4

    Joined:
    Jul 30, 2013
    Posts:
    183

    Sorry for the super late reply to this, but it looks to be occurring on both device and in editor.
     
  3. BlueSpirit

    BlueSpirit

    Joined:
    Jun 10, 2013
    Posts:
    33
    Hello, I'm getting this error on Android when the target API is set to 33. Is this a SR Debugger issue?

    Code (CSharp):
    1. Error: JNI:GetDeviceName:java.lang.SecurityException: Settings key: <bluetooth_name> is only readable to apps with targetSdkVersion lower than or equal to: 31
    2.  
    3. SRDebugger.Services.Implementation.StandardSystemInformationService:CreateDefaultSet()
    4. System.Reflection.RuntimeConstructorInfo:InternalInvoke(Object, Object[], Boolean)
    5. SRF.Service.SRServiceManager:AutoCreateService(Type)
    6. SRF.Service.SRServiceManager:GetService()
    7. SRDebugger.Services.Implementation.SRDebugService:.ctor()
    8. System.Reflection.RuntimeConstructorInfo:InternalInvoke(Object, Object[], Boolean)
    9. SRF.Service.SRServiceManager:AutoCreateService(Type)
    10. SRF.Service.SRServiceManager:GetService()
     
    Revolter likes this.
  4. Simie

    Simie

    Joined:
    Oct 26, 2012
    Posts:
    456
    This looks like a Unity bug to me. The system info panel is accessing device information via Unity APIs, e.g.:

    InfoEntry.Create("Device Type", UnityEngine.SystemInfo.deviceType),

    So if calling those causes an exception, it's almost certainly a Unity issue.

    You could try commenting out line 90:
    InfoEntry.Create("Device Name", UnityEngine.SystemInfo.deviceName, true),

    As that seems to be the one it's complaining about.
     
  5. oliver_unity892

    oliver_unity892

    Joined:
    Oct 28, 2019
    Posts:
    91
    Hi. Loving the asset. Installed it in to my (nearly) complete ragtag game and it worked straight away. However the demo doesn't appear to work, the tap button never responds. This is using the demo scene in 2022.2.5f1.

    Thought you'd want to know.
     
    Simie likes this.
  6. oliver_unity892

    oliver_unity892

    Joined:
    Oct 28, 2019
    Posts:
    91
    Hi
    Can someone help me with a bit of code for the Options script. I want to have tick boxes for my inventory items, so that I can easily enable them within the game.

    My inventory is a Dictionary so I can easily query that to find out which objects are present in the dictionary, and their values.

    However because the Options file declares the tick boxes as public bools, I'm stumped as to how to create new tick boxes based on something like a FOR loop.

    I want to do something like

    Code (CSharp):
    1. FOR (STUFF HERE)
    2. {
    3.     Instantiate(tickbox("Item #" + i);
    4. }
    You get my drift. Is there a way to do that that is compatible with the Options script requirements?

    Edit:
    I could do something like the following to set each bool, but it require me to create the Bools to match the inventory items, and I'm keen to have them dynamically created.

    Code (CSharp):
    1. public bool myInventoryItem{
    2.  get { return getInventory(); }
    3.  set { setInventoryItem(value); }
    4. }
    5. bool getInventory()
    6. {
    7.      for loop here
    8.     {
    9.         return myDictionary.isValueTrue()
    10.     }
    11. }
    I'm on my phone so can't get the perfect syntax but might give you an idea
     
    Last edited: Mar 12, 2023
  7. Simie

    Simie

    Joined:
    Oct 26, 2012
    Posts:
    456
    Thanks for the heads up!

    You can create options dynamically via the API:
    https://www.stompyrobot.uk/tools/srdebugger/documentation/#available-methods

    // Add a dynamic option to the options panel.
    void AddOption(OptionDefinition option);
     
    oliver_unity892 likes this.
  8. oliver_unity892

    oliver_unity892

    Joined:
    Oct 28, 2019
    Posts:
    91
    Perfect. Thanks again. Great asset, which I had it at the start.

    Post here if you ever set up a Discord. Would be a great collaboration place for co-support.
     
  9. oliver_unity892

    oliver_unity892

    Joined:
    Oct 28, 2019
    Posts:
    91
    Is there a way to specify what type of option is created? At the moment it only creates buttons but I'm after tick boxes ideally as it would both allow the user to set a value and also show the value.

    I'm currently using this but it shows as a button. I'd like to set it to be a bool (tick box). I also can't find a way to change the value of an option from within the game when an external function changes the value of the underlying item (in my case whether an inventory item is present in the inventory or not).

    Code (CSharp):
    1.  
    2.                 OptionDefinition newOption= OptionDefinition.FromMethod(item.Key.ToString(), () =>
    3.                 {
    4.                         My code goes here
    5.                 });
    6.                 SRDebug.Instance.AddOption(newOption);
    7.  
    8.  
     
    Last edited: Mar 18, 2023
  10. Simie

    Simie

    Joined:
    Oct 26, 2012
    Posts:
    456
    Yup sure, you can create an OptionDefinition with a getter and setter.
    Code (CSharp):
    1.  
    2. bool myBool = false;
    3. var option = OptionDefinition.Create("MyBool", () => myBool, b => myBool = b);
    4. SRDebug.Instance.AddOption(option);
    5.  
    6. // If myBool changes in some other way, call this to notify SRDebugger that the property has changed
    7. option.Property.NotifyValueChanged();
    8.  
     
  11. Davon_Allen_AofL

    Davon_Allen_AofL

    Joined:
    Jul 17, 2019
    Posts:
    9
    is there an established way to add the debug camera option to work on a URP camera stack?
     
  12. Romeno

    Romeno

    Joined:
    Jun 24, 2013
    Posts:
    35
    Hello, I'm figuring out how to change the size (width) of the SR_Sidebar. It is too big on the device and free space can be used by the Options tab contents.

    Any help? Thanks
     
  13. kjorrt

    kjorrt

    Joined:
    Nov 26, 2014
    Posts:
    34
    Hi, when I enable SR Debugger I cannot use my UI elements anymore. None of my buttons work. Is there a setting that I have to alter to get my UI and the SR Debugger working at the same time?
     
  14. Meatloaf4

    Meatloaf4

    Joined:
    Jul 30, 2013
    Posts:
    183
    Hello, just wanted to say great work on the asset once again!

    So I was trying to remove SRDebugger from my release builds using
    SRDebugEditor.SetEnabled(false);
    but I was struggling with finding the right place to put it to work with Unity Cloud Build.

    My initial thought was to put in in OnPreprocessBuild but that doesn't seem to work effectively. Currently, this is because The editor is marked as compiling during this phase and
    SetEnabled(false)
    ensures that this can't be true. I'm assuming because likely there would be issues if Unity was compiling and SRDebugger removed its files at the same time.

    So in short I was just curious if there were some best practices here, or a common approach for doing what I'm after.

    Thanks for any help in advance!
     
  15. Revolter

    Revolter

    Joined:
    Mar 15, 2014
    Posts:
    216
    Hey @Simie,

    I have two issues, one minor, and one more or less critical:
    • Minor: Editor categories not sorted by name like the ugui ones
    • Critical: It's getting progressively slower to add/remove containers (dynamically) the more options you have, now it can take up to 10 seconds on device, and it only happens with the ugui one, not the inspector. (maybe waiting one frame before updating all changes could solve this)
     
    Last edited: Apr 21, 2023
  16. Simie

    Simie

    Joined:
    Oct 26, 2012
    Posts:
    456
    The new I(Pre|Post)processBuildWithReport interfaces seems to work for me:

    public class BuildPipelineIntegration : IPreprocessBuildWithReport, IPostprocessBuildWithReport
    {
    public int callbackOrder => 0;

    public void OnPreprocessBuild(BuildReport report)
    {
    if ((report.summary.options & BuildOptions.Development) == 0) // Disable SRDebugger in non-development builds
    {
    SRDebugEditor.SetEnabled(false);
    }
    }

    public void OnPostprocessBuild(BuildReport report)
    {
    SRDebugEditor.SetEnabled(true);
    }
    }


    Let me know if that helps!
     
  17. Simie

    Simie

    Joined:
    Oct 26, 2012
    Posts:
    456
    SRDebugger creates its own event system if it doesn't detect one. You can disable this in the settings: upload_2023-4-23_12-54-1.png

    Can you give that a try and see if it helps?
     
  18. Simie

    Simie

    Joined:
    Oct 26, 2012
    Posts:
    456
    What device is this happening on? It's only supposed to appear on devices with large enough landscape orientation for the sidebar to fit.
     
  19. Simie

    Simie

    Joined:
    Oct 26, 2012
    Posts:
    456
    I'll have these fixed in the next update - I'll PM you the updated files in the mean time.
     
    Revolter likes this.
  20. Meatloaf4

    Meatloaf4

    Joined:
    Jul 30, 2013
    Posts:
    183
    Unfortunately, this doesn't seem to work for me because EditorApplication.isCompiling is equal to true for me when the SRDebug.Editor.SetEnabled(false) is called in OnPreprocessBuild.
     
  21. Simie

    Simie

    Joined:
    Oct 26, 2012
    Posts:
    456
    That is odd, it seems to work fine when performing a local build.

    Perhaps you could run a pre-build script that opens the Unity editor and invokes a custom method that calls SRDebugEditor.SetEnabled(false); ?

    https://docs.unity3d.com/2022.1/Documentation/Manual/UnityCloudBuildAdvancedOptions.html
    > Script hooks-Pre-Export Method Manipulate project files before the project is built. Examples include copying variables from an external file into the project, processing Assets, or working with plug-ins
    that require special treatment
     
  22. nosajtevol

    nosajtevol

    Joined:
    Jun 28, 2012
    Posts:
    219
    Hey guys, any reason why my options would show in the editor but not in the build? Thanks
     
  23. Simie

    Simie

    Joined:
    Oct 26, 2012
    Posts:
    456
    Hey,

    Which platform are you building for? Is IL2CPP enabled? Could you check what the "Managed Stripping Level" setting in the player options is set to?
     
  24. mbevin

    mbevin

    Joined:
    Mar 20, 2023
    Posts:
    2
    Hi, I'm reading this close to a year later, having hit the same issue.... I still don't see any such feature? It would be really useful.
     
  25. Simie

    Simie

    Joined:
    Oct 26, 2012
    Posts:
    456
    I posted again about this a later on the same page: https://forum.unity.com/threads/srd...-and-bug-reporter.296403/page-14#post-7947547

    The requested functionality is already available:

     
  26. Revolter

    Revolter

    Joined:
    Mar 15, 2014
    Posts:
    216
    @Simie, could you please add support for long to NumberControl.ValueRanges?
    I did it manually, but would be nice to also have that in next version if I update.
    Thanks!
     
    Simie likes this.
  27. sangsangjoon

    sangsangjoon

    Joined:
    Dec 2, 2022
    Posts:
    1
    Hello,

    I am currently using SRDebugger 1.12.1. When running SRDebugger on my device and viewing the console logs, I noticed that only one line is displayed and the complete log is not shown.

    For example, in the Unity editor, the log message appears as follows:

    "BoxColliders does not support negative scale or size. The effective box size has been forced positive and is likely to give unexpected collision geometry."

    However, when using SRDebugger on the device, only the following portion is displayed:

    "BoxColliders does not support negative scale or"

    I have tried tapping on the log or adjusting different options, but only one line is shown. Is there a way to view the complete log on the device?

    Thank you for your assistance.
     

    Attached Files:

  28. kankane

    kankane

    Joined:
    Feb 22, 2013
    Posts:
    23
    Hello,

    I would like to enable and disable the SRDebugger at runtime.
    So, I disabled the automatic loading and I do a check at app startup and run
    SRDebug.Init()
    if necessary. However, the screen-corner Trigger still works and opens the debugger even though I never called
    SRDebug.Init()
    . Should it?

    What's the proper way of disabling the SRDebugger trigger at runtime?

    Thanks!
     
  29. Simie

    Simie

    Joined:
    Oct 26, 2012
    Posts:
    456
    Hi @kankane,

    SRDebugger will only auto-initialize if the automatic loading setting is enabled in the settings menu. However, any calls to the SRDebugger API will also trigger initialisation. (SRDebug.Init() is just a shortcut to trigger init without having to make any other API calls).

    Could you double check if you're using the API from your scripts in a way that might be triggering init?

    (sorry for the delay replying, I didn't see the notification for this thread)
     
  30. Simie

    Simie

    Joined:
    Oct 26, 2012
    Posts:
    456
    This is unusual, you should be seeing the full log message at the bottom of the screen after tapping on the short message.

    Could you let me know which device you are seeing this on, and which version of Unity? Thanks
     
  31. kankane

    kankane

    Joined:
    Feb 22, 2013
    Posts:
    23
    Ah, ok, understood. I didn't know any API call will effectively call Init. I definitely have SRDebugger calls all over. For now I just find the Trigger in the hierarchy and destroy it.
     
  32. Simie

    Simie

    Joined:
    Oct 26, 2012
    Posts:
    456
    You can use the API to disable the trigger:
    SRDebug.Instance.IsTriggerEnabled = false;
     
    kankane likes this.
  33. tapped_rupert

    tapped_rupert

    Joined:
    Oct 27, 2020
    Posts:
    4
    Hello. We are using SR Debugger in our project and recently it has stopped working.

    SRDebug.Instance.ShowDebugPanel(); returns a null ref. It seems the instance is not being registered for some reason?

    Are there any steps we can take to narrow the issue?

    Unity version 2022.3.5.
     
  34. Simie

    Simie

    Joined:
    Oct 26, 2012
    Posts:
    456
    Hi, can you tell me what platform this is on? Most likely this is an issue with reflection, which may be impacted by IL2CPP and your stripping settings. Was there any change in your project configuration or Unity version prior to this issue occurring?

    https://docs.unity3d.com/Manual/ManagedCodeStripping.html
     
  35. mbevin

    mbevin

    Joined:
    Mar 20, 2023
    Posts:
    2
    Hi, I'm using SRDebugger and have a couple of questions:
    - when a user sends a bug report, I only get the last couple of hundred log lines, even though I've set the Maximum Console Entries to 4000... this has prevented me from getting to the bottom of a number of bug reports. Even looking through the code, I can't work out where the stricter limit is being applied. Is it server-side? Like is there some maximum size in bytes being applied or something? And is there no way around this limit?
    - often the error notification exclamation mark (at the place where I triple-tap to bring-up the menu) flashes when there are no error log lines (in fact nothing in the logs to indicate any error), and I can't work out why it flashed. What else can cause it to flash?
    - I really would like a way to tell SRDebugger when a value (for values that I setup using DynamicOptionContainer) has changed (so that the values in the menu update without having to leave it and go back into it). I understand there currently isn't any way to do this, but could this please be added?
     
  36. jimmying

    jimmying

    Joined:
    Sep 20, 2017
    Posts:
    107
    In the console, it looks like when color tags are used and the preview line goes past a certain amount it can stop the colors from displaying properly. (guess because it's cutting off the closing tag)

    upload_2024-1-17_10-49-26.png

    Also what's the state of this asset? I think there was supposed to be an update, did that ever happen? Store shows last update in mid 2022.
     
  37. Simie

    Simie

    Joined:
    Oct 26, 2012
    Posts:
    456
    There is no limiting code on the server-side for this. There is a max request body size but exceeding that would result in the report not being delivered at all, which doesn't sound like what you're seeing here.

    It sounds like the max log messages setting could be getting ignored for some reason.
    Can you try hard-coding a value in
    SRDebugger\Scripts\Services\Implementation\StandardConsoleService.cs
    _allConsoleEntries = new CircularBuffer<ConsoleEntry>(Settings.Instance.MaximumConsoleEntries);

    and see if that helps?

    It should only be appearing if there is an error message. I've never seen this before so am unlikely to be able to repro on my machine.
    Can you try sticking a log in
    C:\Programming\SRDebugger\SRDebugger\Staging\CurrentVersion\Assets\StompyRobot\SRDebugger\Scripts\UI\Other\ErrorNotifier.cs
    public void ShowErrorWarning()
    {
    _queueWarning = true;
    }

    and checking the callstack when it happens? The only usage is the event handler for an error occuring so it's quite confusing how this could happen on its own. One possibility is that the prefabs have become corrupted but if that was the case it should be showing constantly.

    You can do this via your OptionDefinition

    OptionDefinition yourDefinition = ...;
    yourDefinition.Property.NotifyValueChanged();
     
  38. Simie

    Simie

    Joined:
    Oct 26, 2012
    Posts:
    456
    Thanks for the report, trimming needs to take into account the color tags if rich text is enabled. I've added this to my bug list.

    The asset has been stable for quite some time, with only minimal fixes required for new Unity releases (no Unity update breakages in the past year, for example). I do plan to release further updates with accumulated bug fixes (some mentioned in this thread) and some minor features, and of course maintain compatibility with new versions of Unity, but for the time being no major new features are planned.
     
  39. johnfelts

    johnfelts

    Joined:
    Mar 7, 2023
    Posts:
    4
    Any updates on this? Was looking to do this myself today and it doesnt exist.
     
  40. FarmerInATechStack

    FarmerInATechStack

    Joined:
    Dec 28, 2020
    Posts:
    57
    Is anyone aware of an XR-ready implementation of the SRDebugger? For example, I'd like to use the debug panel in world space while developing on Quest 3 or Apple Vision Pro.

    I see that we can toggle EnableWorldSpaceMode() to create a world canvas, but there's still work to be done if we want to be able to interact with that world canvas (scrolling through logs, pressing the UI, etc). I can envision creating that, but I wonder if anyone has done that already.
     
  41. rastleks

    rastleks

    Joined:
    Jul 17, 2014
    Posts:
    49
    We have a problem on android with landscape orientation. The pin enter UI is too big so "0" symbol on some devices is not visible (out of screen). Tried to change settings of prefab, but they are overriden by code in runtime. Please, fix it.
     
  42. Soqman

    Soqman

    Joined:
    Nov 20, 2016
    Posts:
    3
  43. Arkade

    Arkade

    Joined:
    Oct 11, 2012
    Posts:
    655
    @Simie First-up thanks for this super awesome asset. Soooo useful!

    Sorry to bother but is the bug reporter working OK?

    I just watched someone on a stream submit a bug to us (which usually works fine) but I don't see anything in my e-mail. Is there a way I should self-diagnose? (the last one I received was "3/20/2024 12:33:47 PM" and says "Quota usage: 15/1600 (quota resets 2024-04-01 00:00:00Z UTC)"

    Thanks.