Skip to content

Commit

Permalink
Improve logging prints
Browse files Browse the repository at this point in the history
  • Loading branch information
TechnologicNick committed Jul 13, 2021
1 parent e573164 commit 44d4cb7
Showing 1 changed file with 10 additions and 8 deletions.
18 changes: 10 additions & 8 deletions SteamChangePreview/SteamChangePreview.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -168,9 +168,10 @@ AppId_t getAppid(PublishedFileId_t publishedfileid) {
}

int changePreview(AppId_t appid, PublishedFileId_t publishedfileid, const char* file, bool hidemessagebox) {
printf("appid=%lu\n", appid);
printf("publishedfileid=%llu\n", publishedfileid);
printf("file=%s\n", file);
printf("Changing preview with data:\n");
printf(" appid = %lu\n", appid);
printf(" publishedfileid = %llu\n", publishedfileid);
printf(" file = %s\n", file);

CPreviewChanger pc(appid, hidemessagebox);

Expand Down Expand Up @@ -213,6 +214,7 @@ bool CPreviewChanger::Init() {
if (!SteamAPI_Init())
{
printf("SteamAPI_Init() failed\n");
printf("Make sure Steam is running, you're logged in and used the correct appid\n");
return false;
}

Expand Down Expand Up @@ -260,10 +262,10 @@ void CPreviewChanger::LoopRunCallbacks() {
}

void CPreviewChanger::OnSubmitItemUpdate(SubmitItemUpdateResult_t *pCallback, bool bUserNeedsToAcceptWorkshopLegalAgreement) {
printf("OnSubmitItemUpdateResult\n");
printf("m_bUserNeedsToAcceptWorkshopLegalAgreement = %s\n", pCallback->m_bUserNeedsToAcceptWorkshopLegalAgreement ? "true" : "false");
printf("m_eResult = %d\n", pCallback->m_eResult);
printf("m_nPublishedFileId = %llu\n", pCallback->m_nPublishedFileId);
printf("OnSubmitItemUpdate callback triggered:\n");
printf(" m_bUserNeedsToAcceptWorkshopLegalAgreement = %s\n", pCallback->m_bUserNeedsToAcceptWorkshopLegalAgreement ? "true" : "false");
printf(" m_eResult = %d\n", pCallback->m_eResult);
printf(" m_nPublishedFileId = %llu\n", pCallback->m_nPublishedFileId);

const char* caption = pCallback->m_eResult == k_EResultOK ? "Successfully updated preview image" : "Failed to update preview image";

Expand Down Expand Up @@ -300,7 +302,7 @@ void CPreviewChanger::OnSubmitItemUpdate(SubmitItemUpdateResult_t *pCallback, bo
conclusion += " Description: " + std::string(GetEResultDescription(pCallback->m_eResult)) + std::string("\n");


printf("\n%s\n\n%s", caption, conclusion.c_str());
printf("\n\n%s\n\n%s", caption, conclusion.c_str());

if (!this->m_hidemessagebox) {
MessageBoxA(
Expand Down

0 comments on commit 44d4cb7

Please sign in to comment.