Announcement

Collapse
No announcement yet.

For better debugging.

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

    [FEATURE REQUEST] For better debugging.

    It would be great if I could have the object name and the function name that called a "Print" funciton in blueprint or "GEngine->AddOnScreenDebugMessage" in Cpp.
    That way I could know where this message came from.
    For now I have to do something like this in cpp:

    Code:
    GEngine->AddOnScreenDebugMessage(-1, 1.0f, FColor::Red, "ObjectName::FuncitonName: Message");
    And the same in blueprint.

    So it would be great if there would be a funciton like:
    GetExecutaionPath()
    That can be called from anywhere.
    Check out my game OldSchool Nightmare : http://www.indiedb.com/games/oldschool-nightmare

    #2
    There C++ feature for something like that, there __FILE__ __FUNC__ and even __LINE__ macros, in compilation time they will be replaced with file , function name and line that they are correctly in. It's very static solution but i guess there nothing better. Keep in mind that C++ code is compiled to native machine code that does not have functions or variables, just memory addresses and it's really hard to do something like this dynamically, debuggers use so called symbols that translates memory addresses to places in code.

    There docs aboput them here, remeber that only ANSI-Compliant will work on most compilers:

    https://msdn.microsoft.com/en-us/library/b0084kay.aspx
    Last edited by Shadowriver; 10-17-2015, 02:13 PM.
    =========
    My Tutorials:
    Basic knowledge about Classes and UObject environment and stuff like that

    Comment


      #3
      Sometimes you don't want the object name of the object you're in. For instance if you're extending UStaticMeshComponent then the object name in game is StaticMeshComponent0 and the ACTUAL name of the object from the content browser is the root object. I guess it could output a path? I tend to do this for all my game objects anyway, just for verbosity.

      I'd be keen on a filter in the output window, like how the message log works. Or even just a text filter. It'd be nice to have both the colouration of the output log in UE with the searching of the output log in the VS debugger.
      Last edited by Antidamage; 10-18-2015, 06:58 PM.

      Comment


        #4
        Already Implemented

        I already created a set of debug messages to give you class function and also exact line number here:

        How to get a UE4 FString of Calling Class Function and Line Number
        https://forums.unrealengine.com/show...ne-Number-Rama



        Rama
        100+ UE4 C++ Tutorials on the UE4 Code Wiki, including UE4 Multi-Threading!

        UE4 Marketplace: Melee Weapon Plugin & Compressed Binary Save System Plugin | Rama's C++ AI Jumping Videos | Vertex Snap Editor Plugin

        Visit www.ue4code.com to see lots of videos about my C++ Creations! ♥ Rama

        Comment

        Working...
        X