mirror of
https://github.com/libsdl-org/SDL.git
synced 2025-09-06 03:18:13 +00:00
Log app ID as SYSTEM/INFO during initialization
This is not shown by default, but will be shown when using SDL_LOGGING=system=info or higher, where it will hopefully nudge app authors towards initializing this information. Signed-off-by: Simon McVittie <smcv@collabora.com>
This commit is contained in:

committed by
Ryan C. Gordon

parent
e7ee92e822
commit
c24f7d2453
15
src/SDL.c
15
src/SDL.c
@@ -254,10 +254,25 @@ void SDL_SetMainReady(void)
|
|||||||
// Initialize all the subsystems that require initialization before threads start
|
// Initialize all the subsystems that require initialization before threads start
|
||||||
void SDL_InitMainThread(void)
|
void SDL_InitMainThread(void)
|
||||||
{
|
{
|
||||||
|
static bool done_info = false;
|
||||||
|
|
||||||
SDL_InitTLSData();
|
SDL_InitTLSData();
|
||||||
SDL_InitEnvironment();
|
SDL_InitEnvironment();
|
||||||
SDL_InitTicks();
|
SDL_InitTicks();
|
||||||
SDL_InitFilesystem();
|
SDL_InitFilesystem();
|
||||||
|
|
||||||
|
if (!done_info) {
|
||||||
|
const char *value;
|
||||||
|
|
||||||
|
value = SDL_GetAppMetadataProperty(SDL_PROP_APP_METADATA_NAME_STRING);
|
||||||
|
SDL_LogInfo(SDL_LOG_CATEGORY_SYSTEM, "App name: %s", value);
|
||||||
|
value = SDL_GetAppMetadataProperty(SDL_PROP_APP_METADATA_VERSION_STRING);
|
||||||
|
SDL_LogInfo(SDL_LOG_CATEGORY_SYSTEM, "App version: %s", value ? value : "<unspecified>");
|
||||||
|
value = SDL_GetAppMetadataProperty(SDL_PROP_APP_METADATA_IDENTIFIER_STRING);
|
||||||
|
SDL_LogInfo(SDL_LOG_CATEGORY_SYSTEM, "App ID: %s", value ? value : "<unspecified>");
|
||||||
|
|
||||||
|
done_info = true;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
static void SDL_QuitMainThread(void)
|
static void SDL_QuitMainThread(void)
|
||||||
|
Reference in New Issue
Block a user