Skip to content

fix compilation errors/warnings + expose RecordLog in BP - #1

Open
jacopomaroli wants to merge 2 commits into
Frozen-Projects:mainfrom
jacopomaroli:main
Open

fix compilation errors/warnings + expose RecordLog in BP#1
jacopomaroli wants to merge 2 commits into
Frozen-Projects:mainfrom
jacopomaroli:main

Conversation

@jacopomaroli

Copy link
Copy Markdown

this PR achieves the following:
1 - exposes RecordLog in Blueprint. The use case is allowing manual log entries in shipping builds. Compilation would otherwise strip those.
This could also be achieved by modifying LogMessage/LogJson to call RecordLog directly instead of UE_LOG, but that approach is more invasive to existing code.

2 - when I tried to compile this in UE 5.8.0 I got the following errors and warnings

Error: An explicit Category specifier is required for any property exposed to the editor or Blueprints in an Engine module.
Error: Compile [x64] RL_UUIDv7.cpp
C:\Program Files\Microsoft Visual Studio\2022\Community\VC\Tools\MSVC\14.44.35207\INCLUDE\sal.h(2361,1): error C2144: syntax error: 'int' should be preceded by ';'
extern "C" {
^
D:\UE\RuntimeLogger_Build\HostProject\Plugins\RuntimeLogger\Source\RuntimeLogger\Public\RL_UUIDv7.h(3,1): error C4430: missing type specifier - int assumed. Note: C++ does not support default-int
THIRD_PARTY_INCLUDES_START
^
D:\development\UE\UE_5.8\Engine\Source\Runtime\Core\Public\GenericPlatform\GenericPlatform.h(9,1): error C2143: syntax error: missing ';' before '<L_GRAMMAR_template_head_l>'
template<typename T32BITS, typename T64BITS, int PointerSize>
^
D:\UE\RuntimeLogger_Build\HostProject\Plugins\RuntimeLogger\Source\RuntimeLogger\Public\RL_UUIDv7.h(12,1): error C4430: missing type specifier - int assumed. Note: C++ does not support default-int
THIRD_PARTY_INCLUDES_END
^
Warning: Monolithic headers should not be used by this module. Please change it to explicitly include the headers it needs.

This PR tackles them all and achieves a clean compilation.
I Added Category specifiers to all UPROPERTY macros, included CoreMinimal.h before THIRD_PARTY_INCLUDES macros in RL_UUIDv7.h, replaced monolithic JsonUtilities.h and UMG.h includes with targeted headers

3 - The Message pointer was captured directly in an AsyncTask lambda, but the log system reuses that buffer. Subsequent calls overwrite it before the lambda executes, resulting in empty strings. Fixed by copying to an FString before capture.

…replace monolithic headers, fix dangling Message pointer in AsyncTask
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant