Debug Messages are not working

Currently I am adding debug messages on the OnConstruction() function in the actor component as below
GEngine->AddOnScreenDebugMessage(-1, 5.f, FColor::Red, TEXT(“Spline Created”));

But these messages are not printed in the viewport though the project was build.
What can I do to print the message on the screen.

Hello! Can you try to move it to BeginPlay() function? OnConstruction() is called when spawn occurs or new object is added to level with editor.