Search Unity

  1. Welcome to the Unity Forums! Please take the time to read our Code of Conduct to familiarize yourself with the forum rules and how to post constructively.

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:
    434
    Hey, there is no way to change those button states via the API. It would be quite simple to add - I will add it to the todo list. FYI there is a built-in system for assigning keyboard shortcuts to certain actions available in the settings menu.

    For everyone waiting on the next update that I said was targeting mid-November - my apologies, but it will be a bit longer before I can get it ready to release. I'll post an updated ETA here when I can.
     
    Trost_ likes this.
  2. igorper

    igorper

    Joined:
    Oct 29, 2018
    Posts:
    1
    Hi, I want to add copy data to clipboard when user click in System Information tab in custom category. How I can do this?
     
  3. jimmying

    jimmying

    Joined:
    Sep 20, 2017
    Posts:
    59
    Are there any demos regarding the type of clean up required when using the Dynamic Options?

    I'm getting the following error when I move away from the scene after dynamically adding options:
    I use the following to add the options:

    SRDebug.Instance.AddOptionContainer(container);


    Where container is an instance of DynamicOptionContainer.

    And then on my OnDestroy I use:

    SRDebug.Instance.RemoveOptionContainer(container);


    I've also tried removing the individual options in container before RemoveOptionContainer, and that didn't work either.
     
  4. jimmying

    jimmying

    Joined:
    Sep 20, 2017
    Posts:
    59
    I've been doing something like this when I want some quick debug overlay:

    Code (CSharp):
    1.        
    2. SRDebug.Instance.AddOption(OptionDefinition.Create("Time", () => Time.time));
    3. SRDebug.Instance.PinOption("Time");
    4.  
    But how do I get the value to update? The documentation isn't clear regarding dynamically created options and how they can be updated.

    Also still would like answer to my above post.
     
  5. Simie

    Simie

    Joined:
    Oct 26, 2012
    Posts:
    434
    Hey, sorry for the late reply. I wasn't receiving notifications from this thread for some reason.

    This is pretty strange, the SRDebugger game objects shouldn't be affected by scene changes as they are all grouped under a game object that has "DontDestroyOnLoad()" enabled. I will look into this and try and repro it locally.

    Options only update when there is an value change event or when the options panel is opened. With non-dynamic options this is done by the class containing the property implementing INotifyPropertyChanged. There's no way to trigger an update manually for dynamically created options at the moment. I'll add something for this in the next release.

    There's nothing built-in for this. If you wanted to implement it yourself you could modify InfoBlock to copy to the clipboard based on a press:
    StompyRobot/SRDebugger/Scripts/UI/Controls/InfoBlock.cs
     
  6. ManjitSBedi

    ManjitSBedi

    Joined:
    Mar 8, 2014
    Posts:
    56
    Hi,

    UPDATE - I goofed with some conditionally compiled code. It is working now. D'oh

    I am in the process of setting up some debug options using SR debugger. I am having a problem with namespaces and accessing methods. The code will work when I run the game project in the Unity editor but when I try to export the build for iOS. I am getting multiple errors of the form:

    Assets/Scripts/SROptions.cs(113,25): error CS1061: 'GameManager' does not contain a definition for 'SomeDebugMethod' and no accessible extension method 'SomeDebugMethod' accepting a first argument of type 'GameManager' could be found (are you missing a using directive or an assembly reference?)


    Code (CSharp):
    1. private string managerName = "Game Manager Multiplayer";
    2.  
    3.     [Category("Game Section")]
    4.     public void DebugOption1()
    5.     {
    6.         var gameManager = GameObject.Find(managerName).GetComponent<GameManager>();
    7.         if (gameManager != null)
    8.         {
    9.             gameManager.SomeDebugMethod();
    10.         }
    11.     }

    Thanks in advance.
     
    Last edited: Feb 3, 2022
  7. duartedd

    duartedd

    Joined:
    Aug 1, 2017
    Posts:
    148
    Hello there is an error that comes up in webgl seems related rsrf debugger and stsarting up - - moight be related to the keyboard shortcuts or something - i disabled them and the null ref is gone now - running 2020.3.25f1 with new input system


    NullReferenceException: Object reference not set to an instance of an object.
    at SRDebugger.Services.Implementation.KeyboardShortcutListenerService.Awake () [0x00000] in <00000000000000000000000000000000>:0
    at UnityEngine.GameObject.Internal_AddComponentWithType (System.Type componentType) [0x00000] in <00000000000000000000000000000000>:0
    at UnityEngine.GameObject.AddComponent (System.Type componentType) [0x00000] in <00000000000000000000000000000000>:0
    at SRF.Service.SRServiceManager.DefaultServiceConstructor (System.Type serviceIntType, System.Type implType) [0x00000] in <00000000000000000000000000000000>:0
    at SRF.Service.SRServiceManager.AutoCreateService (System.Type t) [0x00000] in <00000000000000000000000000000000>:0
    at SRF.Service.SRServiceManager.GetServiceInternal (System.Type t) [0x00000] in <00000000000000000000000000000000>:0
    at SRF.Service.SRServiceManager.GetService[T] () [0x00000] in <00000000000000000000000000000000>:0
    at SRDebugger.Services.Implementation.SRDebugService..ctor () [0x00000] in <00000000000000000000000000000000>:0
    at System.Reflection.MonoCMethod.InternalInvoke (System.Object obj, System.Object[] parameters, System.Exception& exc) [0x00000] in <00000000000000000000000000000000>:0
    at System.Reflection.MonoCMethod.InternalInvoke (System.Object obj, System.Object[] parameters) [0x00000] in <00000000000000000000000000000000>:0
    at System.RuntimeType.CreateInstanceMono (System.Boolean nonPublic) [0x00000] in <00000000000000000000000000000000>:0
    at System.RuntimeType.CreateInstanceSlow (System.Boolean publicOnly, System.Boolean skipCheckThis, System.Boolean fillCache, System.Threading.StackCrawlMark& stackMark) [0x00000] in <00000000000000000000000000000000>:0
    at System.RuntimeType.CreateInstanceDefaultCtor (System.Boolean publicOnly, System.Boolean skipCheckThis, System.Boolean fillCache, System.Threading.StackCrawlMark& stackMark) [0x00000] in <00000000000000000000000000000000>:0
    at System.Activator.CreateInstance (System.Type type, System.Boolean nonPublic) [0x00000] in <00000000000000000000000000000000>:0
    at System.Activator.CreateInstance (System.Type type) [0x00000] in <00000000000000000000000000000000>:0
    at SRF.Service.SRServiceManager.DefaultServiceConstructor (System.Type serviceIntType, System.Type implType) [0x00000] in <00000000000000000000000000000000>:0
    at SRF.Service.SRServiceManager.AutoCreateService (System.Type t) [0x00000] in <00000000000000000000000000000000>:0
    at SRF.Service.SRServiceManager.GetServiceInternal (System.Type t) [0x00000] in <00000000000000000000000000000000>:0
    at SRF.Service.SRServiceManager.GetService[T] () [0x00000] in <00000000000000000000000000000000>:0
    at SRDebug.Init () [0x00000] in <00000000000000000000000000000000>:0
    at SRDebugger.AutoInitialize.OnLoad () [0x00000] in <00000000000000000000000000000000>:0
    UnityEngine.GameObject:Internal_AddComponentWithType(Type)
    UnityEngine.GameObject:AddComponent(Type)
    SRF.Service.SRServiceManager:DefaultServiceConstructor(Type, Type)
    SRF.Service.SRServiceManager:AutoCreateService(Type)
    SRF.Service.SRServiceManager:GetServiceInternal(Type)
    SRF.Service.SRServiceManager:GetService()
    SRDebugger.Services.Implementation.SRDebugService:.ctor()
    System.Reflection.MonoCMethod:InternalInvoke(Object, Object[], Exception&)
    System.Reflection.MonoCMethod:InternalInvoke(Object, Object[])
    System.RuntimeType:CreateInstanceMono(Boolean)
    System.RuntimeType:CreateInstanceSlow(Boolean, Boolean, Boolean, StackCrawlMark&)
    System.RuntimeType:CreateInstanceDefaultCtor(Boolean, Boolean, Boolean, StackCrawlMark&)
    System.Activator:CreateInstance(Type, Boolean)
    System.Activator:CreateInstance(Type)
    SRF.Service.SRServiceManager:DefaultServiceConstructor(Type, Type)
    SRF.Service.SRServiceManager:AutoCreateService(Type)
    SRF.Service.SRServiceManager:GetServiceInternal(Type)
    SRF.Service.SRServiceManager:GetService()
    SRDebug:Init()
    SRDebugger.AutoInitialize:OnLoad()
     
  8. forthex

    forthex

    Joined:
    Jun 23, 2017
    Posts:
    2
    Hello,

    My team and I are trying to use the included Bug Reporter feature, but we haven't received any verification emails. We've waited multiple days, checked our spam folders, reached out to support, and even used multiple licenses.

    Any help would be appreciated.
     
  9. Simie

    Simie

    Joined:
    Oct 26, 2012
    Posts:
    434
    Hey, I have just replied to your email. Sorry for the delay, I was travelling the past few days and was unable to access my dev tool. The verification email should now be in your inbox.

    I will look into this, thanks for the heads up.
     
  10. Meatloaf4

    Meatloaf4

    Joined:
    Jul 30, 2013
    Posts:
    133
    Is there any way to sort categories by chance? Not to be confused with sorting options :).

    Currently, it looks like categories are sorted arbitrarily.

    Thanks in advance!
     
  11. Revolter

    Revolter

    Joined:
    Mar 15, 2014
    Posts:
    188
    @Simie any solutions for OnPropertyChanged with Dynamic Options? Doesn't seem to work from my tests
     
  12. Simie

    Simie

    Joined:
    Oct 26, 2012
    Posts:
    434
    Hi, I'm still working on the this for the next update. Apologies for the delay.

    Are you interesting in just sorting the categories alphabetically, or introducing a custom order?
     
    Revolter likes this.
  13. Meatloaf4

    Meatloaf4

    Joined:
    Jul 30, 2013
    Posts:
    133
    Ultimately, a custom order would be best for my use case.
     
  14. Simie

    Simie

    Joined:
    Oct 26, 2012
    Posts:
    434
    Hey, I went to implement this tonight and found there is already a way to do this.

    When you add a dynamic option via the API, you will get an OptionDefinition returned from the method.

    Code (CSharp):
    1. var myOption = OptionDefinition.Create("MyOption", () =>  /* get value*/, newValue =>  /*set value*/);
    2. SRDebug.Instance.AddOption(myOption);
    You can call a method that will notify the SRDebugger options panel that the value has changed.

    Code (CSharp):
    1. myOption.Property.NotifyValueChanged();
    If you call this whenever the value changes, it will always show the up-to-date value in the options panel.

    Does this suit your needs?

    I can do an alphabetical order easily enough - a fully custom order might be a bit trickier as there is no central list of categories that could define the order, it's just based on whatever order the properties are read using reflection. One workaround could be to add the order to the category name, e.g.

    Code (CSharp):
    1. [Category("1. Option Category 1")]
    2. public float Foo { get; set; }
    3.  
    4. [Category("2. Option Category 2")]
    5. public float Bar { get; set; }
    6.  
     
    Meatloaf4 and Revolter like this.
  15. Revolter

    Revolter

    Joined:
    Mar 15, 2014
    Posts:
    188
    @Simie yes, that should work, thanks. I'll try it out!

    Edit: It works as intended!
     
    Last edited: Mar 10, 2022
  16. james_cg

    james_cg

    Joined:
    Nov 13, 2019
    Posts:
    12
    Hi, sorry to disturb.

    I used unity 2021.2.0f1, with the latest version of srdebugger,.

    It works great on pc. But on my iphone 11 promax, the console items cannot be clicked.
    I added some log, and found that in VirtualVerticalLayoutGroup.cs, the eventData variable in function OnPointerClick is not right: eventData.pointerPressRaycast.gameObject is null on my iOS devices. I think it would happen on android system, too.

    Is this an unity engine version related bug?
    Thx for attention.
     
  17. Meatloaf4

    Meatloaf4

    Joined:
    Jul 30, 2013
    Posts:
    133
    Hey @Simie just wanted to check back / double check if the ability to layout options via numbering them has been implemented.

    Thanks so much in advance!
     
  18. Simie

    Simie

    Joined:
    Oct 26, 2012
    Posts:
    434
    Hey, I've implemented alphabetical sorting for the next version so you'll be able to number your categories and have them show up in the right order. Sorry for the delay in releasing that, I've been struggling to find time to work on the update. Things are shaping up now though so I anticipate being able to get something out by early May.

    This is weird. Are you using Unity's new input system or the old (legacy) one? I'll try and look into this and see why it's happening.
     
    Meatloaf4 likes this.
  19. Revolter

    Revolter

    Joined:
    Mar 15, 2014
    Posts:
    188
    @Simie, I was debugging a low end device and noticed that half the CPU time is devoted to SRDebugger Canvas updates (mostly RectMask2D stuff) and then in editor I noticed that the canvas is still enabled if I open / close the console. Do you think you could optimize this? It would help in performance testing.
     
  20. PeachyPixels

    PeachyPixels

    Joined:
    Feb 17, 2018
    Posts:
    572
    I encountered that. What I found helped is to enable the "Unload on Close" setting on the Advanced Settings tab.

    Whilst it helps with performance, there are some trade-offs. For example, if you've filtered console output then this is lost when closing\opening SRDebugger.
     
    Revolter likes this.
  21. Simie

    Simie

    Joined:
    Oct 26, 2012
    Posts:
    434
    You can also hold down the "close" button to completely unload the debug panel.

    Without that setting enabled, a normal tap disables the canvas, which should be removing all the rendering cost associated with the panel without completly unloading it. I'll see if something has changed with regards to that as it is definitely not intended to continue rendering at all when hidden.

    The info/warning/error filter settings will persist after the upcoming update, and will also sync between the main console window and the pinned console.
     
    Last edited: Apr 30, 2022
    PeachyPixels and Revolter like this.
  22. Simie

    Simie

    Joined:
    Oct 26, 2012
    Posts:
    434
    Hey folks, I have submitted version 1.12.1 to the asset store.

    Here are the release notes:

    1.12.1
    ----------

    ** Minimum supported version is now 2019.3 **

    Features:
    - Background opacity can now be configured in settings (Settings/Advanced/Background Opacity)
    - Application ID will now be displayed in emails from the bug reporter (the ID set in Project Preferences)
    - New option to disable the welcome popup (Settings/Advanced/Disable Welcome Popup)

    API changes:
    - New API for changing the bug report handler. This allows you to implement a custom bug report endpoint without modifying SRDebugger source code. (SRDebug.Instance.SetBugReportHandler)
    - New API for changing console filter state (info/warning/error visibility)
    - New API for enabling or disabling error notification (SRDebug.Instance.IsTriggerErrorNotificationEnabled)
    - New API for checking if SRDebugger is initialized (SRDebug.IsInitialized)

    Changes:
    - Info/Warning/Error filter state now syncs between console tab and pinned console, and persists if debug panel is unloaded.
    - Option categories are now sorted alphabetically.
    - MonoBehaviors can now be added as an Option Container. Any properties or methods derived from MonoBehavior will be ignored.
    - Properties and Methods with [Browsable(false)] attribute will not be displayed in the options tab (applies to SROptions and Option Containers)

    Fixes:
    - (Options) Enum and Number property names are no longer truncated.
    - (Options) Improved error message when an unsupported property type is encountered.
    - Debug panel no longer consumes CPU resources rendering canvases when hidden.
    - Misc optimisations and bug fixes.
     
    Last edited: Apr 30, 2022
    PeachyPixels and Revolter like this.
  23. Gigacee

    Gigacee

    Joined:
    Mar 4, 2015
    Posts:
    48
    Hi, this is a small report, I found a missing in BugReportPopover.
    This doesn't seem to be any problem but I was just curious.
    upload_2022-5-1_13-28-59.png
     
  24. Simie

    Simie

    Joined:
    Oct 26, 2012
    Posts:
    434
    Thanks for the heads up, I'll remove that. It's a leftover from when not all versions of Unity that SRDebugger supported had access to Rect Mask 2D (for clipping scroll views).
     
    Revolter and Gigacee like this.
  25. PeachyPixels

    PeachyPixels

    Joined:
    Feb 17, 2018
    Posts:
    572
    Hi @Simie

    Thanks for the update. Installed and it seems to be running well after some quick checks :)

    Regarding the above change... I can see the info\warning\error filters persisting between sessions (when Unload on Close is enabled) but the console keyword filter doesn't appear to persist. Not sure if that's a bug or counted as a feature request, but it sure would be good if it did.

    Also, did you ever get a chance to look at different colours for the Render & Other bars on the performance profiler please? The colours are quite close (hence difficult to distinguish) for people affected with certain colour blind combinations.
     
  26. james_cg

    james_cg

    Joined:
    Nov 13, 2019
    Posts:
    12
    I used TouchScript Plugin, which implemented an input system. I guess this may be the problem. So has anyone else encountered this TouchScript(maybe) problem?
     
  27. Simie

    Simie

    Joined:
    Oct 26, 2012
    Posts:
    434
    The sync of the info/warning/error filter options actually came about as a side-effect of adding an API to set them. I can add something else to persist the search filter as well, stay tuned.

    Oh, no, this had not occurred to me. I will look to address this in the next update, as an option in the settings window + a toggle in the SRDebugger panel itself.

    That would certainly be my best guess as to why you are seeing this issue, as I haven't seen anything like this happen with the built-in Unity input system. Perhaps the TouchScript developers might be able to give some idea as to why gameObjects aren't being provided with the input events?
     
    PeachyPixels likes this.
  28. PeachyPixels

    PeachyPixels

    Joined:
    Feb 17, 2018
    Posts:
    572
    It's only a minor issue, but just updated to VS2022 and am now seeing this warning...

    StompyRobot\SRDebugger\Scripts\Settings.cs(577,39): warning CS0414: The field 'Settings._disableWelcomePopup' is assigned but its value is never used

    I think the compiler in 2022 is a little more fussy than 2019 as I don't recall seeing this before. The default assign of false is not required.
     
  29. james_cg

    james_cg

    Joined:
    Nov 13, 2019
    Posts:
    12
    Thx a lot. I removed touch script, which used their own input system. And now SRDebugger is back to normal! Thx again!
     
    Simie likes this.
  30. Simie

    Simie

    Joined:
    Oct 26, 2012
    Posts:
    434
    Thanks for the heads up, will address this in the next update.
     
    PeachyPixels likes this.
  31. Revolter

    Revolter

    Joined:
    Mar 15, 2014
    Posts:
    188
    @Simie, how about adding support for more types to the options tab. For example: DateTime, Vector2, Vector3
     
    Simie, pontifex9355 and Elapotp like this.
  32. mthawley

    mthawley

    Joined:
    Sep 7, 2018
    Posts:
    100
    Hi. Is SRDebugger compatible with the Oculus Quest?
     
  33. ottt

    ottt

    Joined:
    Jul 26, 2020
    Posts:
    2
    Im using this on android screen resolution 1440x3060.
    The problem is the trigger that is located at top-left corner is too small to touch it. It looks almost a dot.
    I think it's obvious to make this trigger scaled to the screen proportionally. And I can't find how to fix this in option.
    What should I do?
     
  34. Simie

    Simie

    Joined:
    Oct 26, 2012
    Posts:
    434
    Hi, SRDebugger does have a world-space UI mode but it is up to you to setup scripting to position the UI. See the API docs for a bit more info: https://www.stompyrobot.uk/tools/srdebugger/documentation/#api

    // ADVANCED. Will transform the debug panel canvas into a world space object and return the RectTransform.
    // This can break things so only use it if you know what you're doing. It can be useful for VR, for example, attaching the panel above the user controller.
    RectTransform EnableWorldSpaceMode();


    The trigger button is supposed to scale with the physical size of the screen. upload_2022-8-6_18-34-8.png

    Is it possible your device is misreporting the DPI of the display? The DPI is visible on the System Info tab in SRDebugger.
     
unityunity