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.
  2. Join us on March 30, 2023, between 5 am & 1 pm EST, in the Performance Profiling Dev Blitz Day 2023 - Q&A forum and Discord where you can connect with our teams behind the Memory and CPU Profilers.
    Dismiss Notice

[Feature request] [Editor] Add contextual menu to Console log entries to force highlight context

Discussion in 'Editor & General Support' started by huulong, Dec 1, 2021.

  1. huulong

    huulong

    Joined:
    Jul 1, 2013
    Posts:
    211
    There are some reports of Console log entry context highlight on click being not reliable, such as https://answers.unity.com/questions/420369/is-there-a-way-to-force-debuglogstring-object-to-a.html

    This is due to the context highlight only occurring if previously selected log had a different, or no context. So when there is only one log, or a bunch of logs with the same context, it's impossible to retrigger the context highlight.

    This thread, however, is not to change the current behaviour (although that would also help). It is a feature request to add a contextual menu to the Console log entries with an item "Highlight Context" that will force highlighting of the context (if any), even if it was recently highlighted. This would be used as a fallback in the problematic case mentioned above.

    I also have other ideas to make it easier for the user to find the context even when there is only one log entry, such as forgetting about the previously selected log after 5s, so the next log click will always highlight context. They are however subject to further design discussion, such as tuning the duration before forgetting, and may need a little more work.

    While the Contextual Menu would be an extra feature not replacing current design, yet doing the same thing as normally happens when clicking a log entry and the previously selected log entry didn't have the same context. So it should be feasible with little ambiguity and just binding a menu item to existing functionality (I may be able to implement it as a plugin class, but I'm not sure what function to call).

    Of course, if you have better plans that would remove the need for such a Contextual menu item altogether, this is fine too. I actually had this idea because I *thought* Unity had a log entry contextual menu, but it turns out that right-clicking on a log entry does nothing. Maybe I saw this functionality on a third-party plugin (some recreate the Console window from scratch), but I haven't used a Console plugin for a while, so I'm not sure.

    Current Unity version: 2021.1.14.f1
     
  2. Kurt-Dekker

    Kurt-Dekker

    Joined:
    Mar 16, 2013
    Posts:
    32,305
    Are you aware that you can supply a second argument to Debug.Log() which actually IS the context object?
     
  3. huulong

    huulong

    Joined:
    Jul 1, 2013
    Posts:
    211
    Yes, I'm asking for a contextual menu to target the context argument, precisely, for when the normal click doesn't work.

    Read the linked Unity Answers page (and my 2nd paragraph again), it explains the cases in which the auto-highlight does not work on click.