Announcement

Collapse
No announcement yet.

No Logging will work! Please help!

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

    No Logging will work! Please help!

    I have been trying for 4 hours now (unsuccessfully) to log any kind of data to the screen or the output log using C++. I'm fairly proficient with C++ but I'm new to Unreal Engine. I am using version 1.16 (maybe that's the problem?)

    Has anyone managed to successfully get text to appear in the output log or on the screen of Unreal Editor version 1.16 using C++? It seems like it should not be this mind boggling difficult. I've tried both UE_LOG and "GEngine->AddOnScreenDebugMessage" (yes, with appropriate parameters) a million different ways, following over 12 different tutorials and instructional videos. Often it will compile just fine, but there will be no text appearing whether in the log or on the screen. Ever. No matter what I do. I've put these functions/macros in the OnFire function of the FPS example project, I've put them in the begin play function, in the constructor (for the first person character), I've made no actors and tried putting them in their own constructors, begin play, even in the tick function. Absolutely nothing. I also tried it by adding "-Log" to the editor's target. That also did not work. It made an extra log but nothing showed up on it from my attempted messages.

    The copy of Unreal is only a day old, again version is 1.16, my computer is top of the line, and I'm using Microsoft Visual Studio 2015. And I really just print things whether to screen or to the output log. I tried making my own log categories, I tried using LogTemp... Is there some magical switch I need to flip to get it to work in the editor? I have not done much in this project so I doubt I accidentally fubar'd something... I should mention I tried all manner of header files and even making my own macro to print on the screen. Nothing works.

    Please let me know if you have logged text to screen or the output log if you have 1.16 and exactly how you did it. Thanks!!!

    #2
    UE_LOG(LogTemp, Error, TEXT("Begin Play"));
    GEngine->AddOnScreenDebugMessage(-1, 5.f, FColor::Red, TEXT("This is an on screen message!"));
    works in 4.16.2. So try to rebuild?

    Comment


      #3
      Are you sure that the code that outputs the log message is actually being executed? Have you tried setting a breakpoint on that code to make sure it is actually being run?

      Comment


        #4
        I'm using custom and engine native log functions and on screen messages. 4.16, 4.16.2. Works fine, problem must be in your code or project configuration, maybe try removing Intermediate, Saved, .vs ,Binaries folders. And then use 'Generate Visual Studio project files'. But preserve Saved/Config, that one is important.

        Comment


          #5
          Try adding this to DefaultEngine.ini

          Code:
          [/Script/Engine.Engine]
          bEnableOnScreenDebugMessages=true

          Comment


            #6
            Originally posted by Phoenix100 View Post
            UE_LOG(LogTemp, Error, TEXT("Begin Play"));
            GEngine->AddOnScreenDebugMessage(-1, 5.f, FColor::Red, TEXT("This is an on screen message!"));
            works in 4.16.2. So try to rebuild?
            I tried all of that verbatim. It just throws errors. It's a fresh DL of UE4 v16 so I'm not sure what's going on... I switched to my other computer and it worked just fine with no errors.

            Comment


              #7
              Originally posted by GBX_botman View Post
              Are you sure that the code that outputs the log message is actually being executed? Have you tried setting a breakpoint on that code to make sure it is actually being run?
              It's definitely being run, I checked with breakpoints. Just nothing appears in any logs.

              Comment


                #8
                Originally posted by MrGreek View Post
                I'm using custom and engine native log functions and on screen messages. 4.16, 4.16.2. Works fine, problem must be in your code or project configuration, maybe try removing Intermediate, Saved, .vs ,Binaries folders. And then use 'Generate Visual Studio project files'. But preserve Saved/Config, that one is important.
                I will try that. Thanks!

                Comment

                Working...
                X