Skip to content

Commit 7d40583

Browse files
committed
VERBOSE -> LOG in mythgame
1 parent 896276c commit 7d40583

File tree

7 files changed

+55
-39
lines changed

7 files changed

+55
-39
lines changed

mythplugins/mythgame/mythgame/dbcheck.cpp

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -17,8 +17,9 @@ static bool UpdateDBVersionNumber(const QString &newnumber)
1717

1818
if (!gCoreContext->SaveSettingOnHost("GameDBSchemaVer",newnumber,NULL))
1919
{
20-
VERBOSE(VB_IMPORTANT, QString("DB Error (Setting new DB version number): %1\n")
21-
.arg(newnumber));
20+
LOG(VB_GENERAL, LOG_ERR,
21+
QString("DB Error (Setting new DB version number): %1\n")
22+
.arg(newnumber));
2223

2324
return false;
2425
}
@@ -31,8 +32,8 @@ static bool performActualUpdate(const QString updates[], QString version,
3132
{
3233
MSqlQuery query(MSqlQuery::InitCon());
3334

34-
VERBOSE(VB_IMPORTANT, QString("Upgrading to MythGame schema version ") +
35-
version);
35+
LOG(VB_GENERAL, LOG_NOTICE,
36+
QString("Upgrading to MythGame schema version ") + version);
3637

3738
int counter = 0;
3839
QString thequery = updates[counter];
@@ -47,7 +48,7 @@ static bool performActualUpdate(const QString updates[], QString version,
4748
.arg(thequery)
4849
.arg(MythDB::DBErrorMessage(query.lastError()))
4950
.arg(version);
50-
VERBOSE(VB_IMPORTANT, msg);
51+
LOG(VB_GENERAL, LOG_ERR, msg);
5152
return false;
5253
}
5354

@@ -64,7 +65,8 @@ static bool performActualUpdate(const QString updates[], QString version,
6465

6566
static bool InitializeDatabase(void)
6667
{
67-
VERBOSE(VB_IMPORTANT, "Inserting MythGame initial database information.");
68+
LOG(VB_GENERAL, LOG_NOTICE,
69+
"Inserting MythGame initial database information.");
6870

6971
const QString updates[] = {
7072
"CREATE TABLE gamemetadata ("

mythplugins/mythgame/mythgame/gamehandler.cpp

Lines changed: 29 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -130,12 +130,11 @@ void GameHandler::InitMetaDataMap(QString GameType)
130130
}
131131

132132
if (romDB.count() == 0)
133-
VERBOSE(VB_GENERAL, LOC_ERR + QString("No romDB data read from "
134-
"database for gametype %1 . Not imported?").arg(GameType));
133+
LOG(VB_GENERAL, LOG_ERR, LOC + QString("No romDB data read from "
134+
"database for gametype %1 . Not imported?").arg(GameType));
135135
else
136-
VERBOSE(VB_GENERAL, LOC + QString("Loaded %1 items from romDB Database")
137-
.arg(romDB.count()));
138-
136+
LOG(VB_GENERAL, LOG_INFO, LOC +
137+
QString("Loaded %1 items from romDB Database") .arg(romDB.count()));
139138
}
140139

141140
void GameHandler::GetMetadata(GameHandler *handler, QString rom, QString* Genre, QString* Year,
@@ -148,7 +147,9 @@ void GameHandler::GetMetadata(GameHandler *handler, QString rom, QString* Genre,
148147

149148
*CRC32 = crcinfo(rom, handler->GameType(), &key, &romDB);
150149

151-
//VERBOSE(VB_IMPORTANT, "Key = " + key);
150+
#if 0
151+
LOG(VB_GENERAL, LOG_DEBUG, "Key = " + key);
152+
#endif
152153

153154
// Set our default values
154155
*Year = QObject::tr("19xx");
@@ -165,7 +166,7 @@ void GameHandler::GetMetadata(GameHandler *handler, QString rom, QString* Genre,
165166
{
166167
if (romDB.contains(key))
167168
{
168-
VERBOSE(VB_GENERAL, LOC + QString("ROMDB FOUND for %1 - %2")
169+
LOG(VB_GENERAL, LOG_INFO, LOC + QString("ROMDB FOUND for %1 - %2")
169170
.arg(romDB[key].GameName()).arg(key));
170171
*Year = romDB[key].Year();
171172
*Country = romDB[key].Country();
@@ -176,7 +177,7 @@ void GameHandler::GetMetadata(GameHandler *handler, QString rom, QString* Genre,
176177
}
177178
else
178179
{
179-
VERBOSE(VB_GENERAL, LOC + QString("NO ROMDB FOUND for %1 (%2)")
180+
LOG(VB_GENERAL, LOG_ERR, LOC + QString("NO ROMDB FOUND for %1 (%2)")
180181
.arg(rom).arg(*CRC32));
181182
}
182183

@@ -189,7 +190,7 @@ void GameHandler::GetMetadata(GameHandler *handler, QString rom, QString* Genre,
189190

190191
static void purgeGameDB(QString filename, QString RomPath)
191192
{
192-
VERBOSE(VB_GENERAL, LOC + QString("Purging %1 - %2").arg(RomPath)
193+
LOG(VB_GENERAL, LOG_INFO, LOC + QString("Purging %1 - %2").arg(RomPath)
193194
.arg(filename));
194195

195196
MSqlQuery query(MSqlQuery::InitCon());
@@ -299,7 +300,8 @@ static void UpdateGameCounts(QStringList updatelist)
299300
{
300301
diskcount = 0;
301302
QString GameType = *it;
302-
VERBOSE(VB_GENERAL, LOC + QString("Update gametype %1").arg(GameType));
303+
LOG(VB_GENERAL, LOG_NOTICE,
304+
LOC + QString("Update gametype %1").arg(GameType));
303305

304306
query.prepare("SELECT romname,system,spandisks,gamename FROM "
305307
"gamemetadata,gameplayers WHERE "
@@ -440,8 +442,11 @@ void GameHandler::UpdateGameDB(GameHandler *handler)
440442
else
441443
ScreenShot.clear();
442444

443-
//VERBOSE(VB_GENERAL, QString("file %1 - genre %2 ").arg(iter.data().Rom()).arg(Genre));
444-
//VERBOSE(VB_GENERAL, QString("screenshot %1").arg(ScreenShot));
445+
#if 0
446+
LOG(VB_GENERAL, LOG_INFO, QString("file %1 - genre %2 ")
447+
.arg(iter.data().Rom()).arg(Genre));
448+
LOG(VB_GENERAL, LOG_INFO, QString("screenshot %1").arg(ScreenShot));
449+
#endif
445450

446451
query.prepare("INSERT INTO gamemetadata "
447452
"(system, romname, gamename, genre, year, gametype, "
@@ -672,7 +677,7 @@ void GameHandler::buildFileList(QString directory, GameHandler *handler,
672677
m_GameMap[RomName] = GameScan(RomName,Info.filePath(),inFileSystem,
673678
GameName, Info.absoluteDir().path());
674679

675-
VERBOSE(VB_GENERAL, LOC + QString("Found Rom : (%1) - %2")
680+
LOG(VB_GENERAL, LOG_INFO, LOC + QString("Found Rom : (%1) - %2")
676681
.arg(handler->SystemName()).arg(RomName));
677682

678683
*filecount = *filecount + 1;
@@ -696,8 +701,9 @@ void GameHandler::processGames(GameHandler *handler)
696701
maxcount = buildFileCount(handler->SystemRomPath(),handler);
697702
else
698703
{
699-
VERBOSE(VB_GENERAL, LOC_ERR + QString("Rom Path does not exist: %1")
700-
.arg(handler->SystemRomPath()));
704+
LOG(VB_GENERAL, LOG_ERR, LOC +
705+
QString("Rom Path does not exist: %1")
706+
.arg(handler->SystemRomPath()));
701707
return;
702708
}
703709
}
@@ -728,7 +734,8 @@ void GameHandler::processGames(GameHandler *handler)
728734
if (busyDialog)
729735
busyDialog->Close();
730736

731-
VERBOSE(VB_GENERAL, LOC + QString("PC Game %1").arg(handler->SystemName()));
737+
LOG(VB_GENERAL, LOG_INFO, LOC +
738+
QString("PC Game %1").arg(handler->SystemName()));
732739
}
733740
else
734741
{
@@ -899,11 +906,12 @@ void GameHandler::Launchgame(RomInfo *romdata, QString systemname)
899906
{
900907
if (!d.cd(handler->SystemWorkingPath()))
901908
{
902-
VERBOSE(VB_GENERAL, LOC_ERR + QString("Failed to change to specified Working Directory: %1")
909+
LOG(VB_GENERAL, LOG_ERR, LOC +
910+
QString("Failed to change to specified Working Directory: %1")
903911
.arg(handler->SystemWorkingPath()));
904912
}
905913
}
906-
VERBOSE(VB_GENERAL, LOC + QString("Launching Game : %1 : %2")
914+
LOG(VB_GENERAL, LOG_INFO, LOC + QString("Launching Game : %1 : %2")
907915
.arg(handler->SystemName())
908916
.arg(exec));
909917

@@ -915,13 +923,14 @@ void GameHandler::Launchgame(RomInfo *romdata, QString systemname)
915923
for (QStringList::Iterator cmd = cmdlist.begin(); cmd != cmdlist.end();
916924
++cmd )
917925
{
918-
VERBOSE(VB_GENERAL, LOC + QString("Executing : %1").arg(*cmd));
926+
LOG(VB_GENERAL, LOG_INFO, LOC +
927+
QString("Executing : %1").arg(*cmd));
919928
myth_system(*cmd, kMSProcessEvents);
920929
}
921930
}
922931
else
923932
{
924-
VERBOSE(VB_GENERAL, LOC + QString("Executing : %1").arg(exec));
933+
LOG(VB_GENERAL, LOG_INFO, LOC + QString("Executing : %1").arg(exec));
925934
myth_system(exec, kMSProcessEvents);
926935
}
927936

mythplugins/mythgame/mythgame/gameui.cpp

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -72,7 +72,7 @@ bool GameUI::Create()
7272

7373
if (err)
7474
{
75-
VERBOSE(VB_IMPORTANT, "Cannot load screen 'gameui'");
75+
LOG(VB_GENERAL, LOG_ERR, "Cannot load screen 'gameui'");
7676
return false;
7777
}
7878

@@ -104,7 +104,7 @@ bool GameUI::Create()
104104
if (systemFilter.isEmpty())
105105
{
106106
systemFilter = "1=0";
107-
VERBOSE(VB_GENERAL, QString("Couldn't find any game handlers!"));
107+
LOG(VB_GENERAL, LOG_ERR, QString("Couldn't find any game handlers!"));
108108
}
109109
else
110110
systemFilter += ")";
@@ -597,7 +597,7 @@ void GameUI::customEvent(QEvent *event)
597597
{
598598
}
599599
}
600-
VERBOSE(VB_GENERAL,
600+
LOG(VB_GENERAL, LOG_ERR,
601601
QString("No results found for %1").arg(lookup->GetTitle()));
602602
}
603603
}

mythplugins/mythgame/mythgame/main.cpp

Lines changed: 9 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -79,7 +79,7 @@ static int runMenu(QString which_menu)
7979
}
8080
else
8181
{
82-
VERBOSE(VB_IMPORTANT, QString("Couldn't find menu %1 or theme %2")
82+
LOG(VB_GENERAL, LOG_ERR, QString("Couldn't find menu %1 or theme %2")
8383
.arg(which_menu).arg(themedir));
8484
delete menu;
8585
return -1;
@@ -128,23 +128,25 @@ int mythplugin_init(const char *libversion)
128128
if (!gContext->TestPopupVersion("mythgame", libversion,
129129
MYTH_BINARY_VERSION))
130130
{
131-
VERBOSE(VB_IMPORTANT,
132-
QString("libmythgame.so/main.o: binary version mismatch"));
131+
LOG(VB_GENERAL, LOG_ERR,
132+
QString("libmythgame.so/main.o: binary version mismatch"));
133133
return -1;
134134
}
135135

136136
gCoreContext->ActivateSettingsCache(false);
137137
if (!UpgradeGameDatabaseSchema())
138138
{
139-
VERBOSE(VB_IMPORTANT,
140-
"Couldn't upgrade database to new schema, exiting.");
139+
LOG(VB_GENERAL, LOG_ERR,
140+
"Couldn't upgrade database to new schema, exiting.");
141141
return -1;
142142
}
143143
gCoreContext->ActivateSettingsCache(true);
144144

145145
MythGamePlayerSettings settings;
146-
// settings.Load();
147-
// settings.Save();
146+
#if 0
147+
settings.Load();
148+
settings.Save();
149+
#endif
148150

149151
setupKeys();
150152

mythplugins/mythgame/mythgame/rom_metadata.cpp

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,10 @@ QString crcinfo(QString romname, QString GameType, QString *key, RomDBMap *romDB
5757
int blocksize;
5858

5959
blocksize = 8192;
60-
// VERBOSE(VB_GENERAL, QString("crcinfo : %1 : %2 :").arg(romname).arg(GameType));
60+
#if 0
61+
LOG(VB_GENERAL, LOG_DEBUG,
62+
QString("crcinfo : %1 : %2 :").arg(romname).arg(GameType));
63+
#endif
6164

6265
if ((zf = unzOpen(qPrintable(romname))))
6366
{

mythplugins/mythgame/mythgame/romedit.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,7 @@ bool EditRomInfoDialog::Create()
5757

5858
if (err)
5959
{
60-
VERBOSE(VB_IMPORTANT, "Cannot load screen 'edit_metadata'");
60+
LOG(VB_GENERAL, LOG_ERR, "Cannot load screen 'edit_metadata'");
6161
return false;
6262
}
6363

mythplugins/mythgame/mythgame/rominfo.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -189,7 +189,7 @@ void RomInfo::setField(QString field, QString data)
189189
else if (field == "romcount")
190190
romcount = data.toInt();
191191
else
192-
VERBOSE(VB_GENERAL, LOC_ERR + QString("Invalid field %1").arg(field));
192+
LOG(VB_GENERAL, LOG_ERR, LOC + QString("Invalid field %1").arg(field));
193193

194194
}
195195

0 commit comments

Comments
 (0)