Logging updates.

This commit is contained in:
Steve 2016-03-12 15:12:52 +00:00
parent 71b0a00689
commit a5509b5bcd
8 changed files with 24 additions and 5 deletions

View File

@ -379,6 +379,10 @@ static void loadCapitalShipDef(char *filename)
cJSON_Delete(root);
}
else
{
SDL_LogMessage(SDL_LOG_CATEGORY_APPLICATION, SDL_LOG_PRIORITY_WARN, "Failed to load '%s'", filename);
}
free(text);
}

View File

@ -764,6 +764,10 @@ static void loadFighterDef(char *filename)
cJSON_Delete(root);
}
else
{
SDL_LogMessage(SDL_LOG_CATEGORY_APPLICATION, SDL_LOG_PRIORITY_WARN, "Failed to load '%s'", filename);
}
free(text);
}

View File

@ -41,7 +41,7 @@ void initScript(cJSON *scriptNode)
while (function)
{
SDL_LogMessage(SDL_LOG_CATEGORY_APPLICATION, SDL_LOG_PRIORITY_INFO, "Script Function: '%s'", cJSON_GetObjectItem(function, "function")->valuestring);
SDL_LogMessage(SDL_LOG_CATEGORY_APPLICATION, SDL_LOG_PRIORITY_INFO, "Found script function: '%s'", cJSON_GetObjectItem(function, "function")->valuestring);
function = function->next;
}

View File

@ -121,6 +121,10 @@ Mission *loadMissionMeta(char *filename)
cJSON_Delete(root);
}
else
{
SDL_LogMessage(SDL_LOG_CATEGORY_APPLICATION, SDL_LOG_PRIORITY_WARN, "Failed to load '%s'", filename);
}
free(text);

View File

@ -27,9 +27,10 @@ int main(int argc, char *argv[])
float td;
long then, lastFrameTime, frames;
long expireTextTimer;
SDL_Event event;
SDL_LogSetPriority(SDL_LOG_CATEGORY_APPLICATION, SDL_LOG_PRIORITY_WARN);
memset(&app, 0, sizeof(App));
memset(&dev, 0, sizeof(Dev));
@ -169,6 +170,8 @@ static void handleArguments(int argc, char *argv[])
dev.debug = 1;
createScreenshotFolder();
SDL_LogSetPriority(SDL_LOG_CATEGORY_APPLICATION, SDL_LOG_PRIORITY_DEBUG);
}
}
}

View File

@ -79,7 +79,7 @@ void setLanguage(char *applicationName, char *languageCode)
STRNCPY(language, lang, MAX_LINE_LENGTH);
}
printf("Locale is %s\n", language);
SDL_LogMessage(SDL_LOG_CATEGORY_APPLICATION, SDL_LOG_PRIORITY_INFO, "Locale is %s", language);
sprintf(c, "%s/%s/LC_MESSAGES/%s.mo", LOCALE_DIR, language, applicationName);

View File

@ -338,10 +338,10 @@ void cleanup(void)
destroyWidgets();
destroyResources();
SDL_LogMessage(SDL_LOG_CATEGORY_APPLICATION, SDL_LOG_PRIORITY_INFO, "Done");
TTF_Quit();
SDL_Quit();
SDL_LogMessage(SDL_LOG_CATEGORY_APPLICATION, SDL_LOG_PRIORITY_INFO, "Done");
}

View File

@ -427,6 +427,10 @@ static void loadWidgetSet(char *filename)
cJSON_Delete(root);
}
else
{
SDL_LogMessage(SDL_LOG_CATEGORY_APPLICATION, SDL_LOG_PRIORITY_WARN, "Failed to load '%s'", filename);
}
free(text);
}