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); cJSON_Delete(root);
} }
else
{
SDL_LogMessage(SDL_LOG_CATEGORY_APPLICATION, SDL_LOG_PRIORITY_WARN, "Failed to load '%s'", filename);
}
free(text); free(text);
} }

View File

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

View File

@ -41,7 +41,7 @@ void initScript(cJSON *scriptNode)
while (function) 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; function = function->next;
} }

View File

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

View File

@ -27,9 +27,10 @@ int main(int argc, char *argv[])
float td; float td;
long then, lastFrameTime, frames; long then, lastFrameTime, frames;
long expireTextTimer; long expireTextTimer;
SDL_Event event; SDL_Event event;
SDL_LogSetPriority(SDL_LOG_CATEGORY_APPLICATION, SDL_LOG_PRIORITY_WARN);
memset(&app, 0, sizeof(App)); memset(&app, 0, sizeof(App));
memset(&dev, 0, sizeof(Dev)); memset(&dev, 0, sizeof(Dev));
@ -169,6 +170,8 @@ static void handleArguments(int argc, char *argv[])
dev.debug = 1; dev.debug = 1;
createScreenshotFolder(); 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); 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); sprintf(c, "%s/%s/LC_MESSAGES/%s.mo", LOCALE_DIR, language, applicationName);

View File

@ -339,9 +339,9 @@ void cleanup(void)
destroyResources(); destroyResources();
SDL_LogMessage(SDL_LOG_CATEGORY_APPLICATION, SDL_LOG_PRIORITY_INFO, "Done");
TTF_Quit(); TTF_Quit();
SDL_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); cJSON_Delete(root);
} }
else
{
SDL_LogMessage(SDL_LOG_CATEGORY_APPLICATION, SDL_LOG_PRIORITY_WARN, "Failed to load '%s'", filename);
}
free(text); free(text);
} }