Skip to content

Commit

Permalink
VERBOSE -> LOG in mythtv-setup and mythwelcome
Browse files Browse the repository at this point in the history
  • Loading branch information
Beirdo committed Jul 9, 2011
1 parent 8aacc2e commit ea958bb
Show file tree
Hide file tree
Showing 8 changed files with 89 additions and 68 deletions.
4 changes: 2 additions & 2 deletions mythtv/programs/mythtv-setup/channeleditor.cpp
Expand Up @@ -487,8 +487,8 @@ void ChannelEditor::scan(void)

fillList();
#else
VERBOSE(VB_IMPORTANT, "You must compile the backend "
"to be able to scan for channels");
LOG(VB_GENERAL, LOG_ERR,
"You must compile the backend to be able to scan for channels");
#endif
}

Expand Down
6 changes: 3 additions & 3 deletions mythtv/programs/mythtv-setup/checksetup.cpp
Expand Up @@ -65,7 +65,7 @@ bool checkStoragePaths(QStringList &probs)
"Storage Group where new recordings will be "
"stored.");
probs.push_back(trMesg);
VERBOSE(VB_IMPORTANT, trMesg);
LOG(VB_GENERAL, LOG_ERR, trMesg);
return true;
}

Expand All @@ -90,7 +90,7 @@ bool checkStoragePaths(QStringList &probs)
"Default Storage Group where new recordings "
"will be stored.");
probs.push_back(trMesg);
VERBOSE(VB_IMPORTANT, trMesg);
LOG(VB_GENERAL, LOG_ERR, trMesg);
return true;
}
else
Expand Down Expand Up @@ -165,7 +165,7 @@ bool checkImageStoragePaths(QStringList &probs)
"your Videos Storage Group. Do you want "
"to store them in their own groups?");
probs.push_back(trMesg);
VERBOSE(VB_IMPORTANT, trMesg);
LOG(VB_IMPORTANT, LOG_ERR, trMesg);
problemFound = true;
}
}
Expand Down
6 changes: 3 additions & 3 deletions mythtv/programs/mythtv-setup/exitprompt.cpp
Expand Up @@ -46,7 +46,7 @@ void ExitPrompter::masterPromptExit()
false);
if (!dia->Create())
{
VERBOSE(VB_IMPORTANT, "Can't create fill DB prompt?");
LOG(VB_GENERAL, LOG_ERR, "Can't create fill DB prompt?");
delete dia;
quit();
}
Expand Down Expand Up @@ -75,7 +75,7 @@ void ExitPrompter::handleExit()
m_d->stk, "exit prompt");
if (!dia->Create())
{
VERBOSE(VB_IMPORTANT, "Can't create Exit Prompt dialog?");
LOG(VB_GENERAL, LOG_ERR, "Can't create Exit Prompt dialog?");
delete dia;
quit();
}
Expand Down Expand Up @@ -127,7 +127,7 @@ void ExitPrompter::quit()
QString commandString = gCoreContext->GetSetting("BackendStartCommand");
if (!commandString.isEmpty())
{
VERBOSE(VB_IMPORTANT, "backendrestart"+commandString);
LOG(VB_GENERAL, LOG_ERR, "backendrestart"+commandString);
myth_system(commandString);
}
}
Expand Down
72 changes: 41 additions & 31 deletions mythtv/programs/mythtv-setup/importicons.cpp
Expand Up @@ -31,7 +31,8 @@ ImportIconsWizard::ImportIconsWizard(MythScreenStack *parent, bool fRefresh,
m_skipButton(NULL), m_statusText(NULL)
{
m_strChannelname.detach();
VERBOSE(VB_IMPORTANT, QString("Fetch Icons for channel %1").arg(m_strChannelname));
LOG(VB_GENERAL, LOG_INFO,
QString("Fetch Icons for channel %1").arg(m_strChannelname));

m_popupStack = GetMythMainWindow()->GetStack("popup stack");

Expand Down Expand Up @@ -80,8 +81,8 @@ bool ImportIconsWizard::Create()
if (!m_iconsList || !m_manualEdit || !m_nameText || !m_manualButton ||
!m_skipButton || !m_statusText)
{
VERBOSE(VB_IMPORTANT, "Unable to load window 'iconimport', missing"
" required element(s)");
LOG(VB_GENERAL, LOG_ERR,
"Unable to load window 'iconimport', missing required element(s)");
return false;
}

Expand Down Expand Up @@ -186,10 +187,8 @@ void ImportIconsWizard::menuSelection(MythUIButtonListItem *item)

SearchEntry entry = qVariantValue<SearchEntry>(item->GetData());

VERBOSE(VB_IMPORTANT, QString("Menu Selection: %1 %2 %3")
.arg(entry.strID)
.arg(entry.strName)
.arg(entry.strLogo));
LOG(VB_GENERAL, LOG_INFO, QString("Menu Selection: %1 %2 %3")
.arg(entry.strID) .arg(entry.strName) .arg(entry.strLogo));

enableControls(STATE_SEARCHING);

Expand Down Expand Up @@ -269,15 +268,16 @@ bool ImportIconsWizard::initialLoad(QString name)
QDir configDir(dirpath);
if (!configDir.exists() && !configDir.mkdir(dirpath))
{
VERBOSE(VB_IMPORTANT, QString("Could not create %1").arg(dirpath));
LOG(VB_GENERAL, LOG_ERR, QString("Could not create %1").arg(dirpath));
}

m_strChannelDir = QString("%1/%2").arg(configDir.absolutePath())
.arg("/channels");
QDir strChannelDir(m_strChannelDir);
if (!strChannelDir.exists() && !strChannelDir.mkdir(m_strChannelDir))
{
VERBOSE(VB_IMPORTANT, QString("Could not create %1").arg(m_strChannelDir));
LOG(VB_GENERAL, LOG_ERR,
QString("Could not create %1").arg(m_strChannelDir));
}
m_strChannelDir += "/";

Expand Down Expand Up @@ -352,7 +352,8 @@ bool ImportIconsWizard::initialLoad(QString name)
arg(escape_csv(entry.strNetworkId)).
arg(escape_csv(entry.strServiceId));
entry.strNameCSV=escape_csv(entry.strName);
VERBOSE(VB_CHANNEL,QString("chanid %1").arg(entry.strIconCSV));
LOG(VB_CHANNEL, LOG_INFO,
QString("chanid %1").arg(entry.strIconCSV));

m_listEntries.append(entry);
m_nMaxCount++;
Expand Down Expand Up @@ -422,7 +423,7 @@ bool ImportIconsWizard::initialLoad(QString name)

bool ImportIconsWizard::doLoad()
{
VERBOSE(VB_CHANNEL, QString("Icons: Found %1 / Missing %2")
LOG(VB_CHANNEL, LOG_INFO, QString("Icons: Found %1 / Missing %2")
.arg(m_missingCount).arg(m_missingMaxCount));

// skip over empty entries
Expand All @@ -435,7 +436,7 @@ bool ImportIconsWizard::doLoad()

if (m_missingIter == m_missingEntries.end())
{
VERBOSE(VB_CHANNEL, "doLoad Icon search complete");
LOG(VB_CHANNEL, LOG_INFO, "doLoad Icon search complete");
enableControls(STATE_DISABLED);
return false;
}
Expand Down Expand Up @@ -581,12 +582,14 @@ bool ImportIconsWizard::lookup(const QString& strParam)
QString str = wget(url,strParam1);
if (str.isEmpty() || str.startsWith("Error", Qt::CaseInsensitive))
{
VERBOSE(VB_IMPORTANT, QString("Error from icon lookup : %1").arg(str));
LOG(VB_GENERAL, LOG_ERR,
QString("Error from icon lookup : %1").arg(str));
return true;
}
else
{
VERBOSE(VB_CHANNEL, QString("Icon Import: Working lookup : %1").arg(str));
LOG(VB_CHANNEL, LOG_INFO,
QString("Icon Import: Working lookup : %1").arg(str));
return false;
}
}
Expand Down Expand Up @@ -619,22 +622,23 @@ bool ImportIconsWizard::search(const QString& strParam)
if (str.isEmpty() || str.startsWith("#") ||
str.startsWith("Error", Qt::CaseInsensitive))
{
VERBOSE(VB_IMPORTANT, QString("Error from search : %1").arg(str));
LOG(VB_GENERAL, LOG_ERR, QString("Error from search : %1").arg(str));
retVal = false;
}
else
{
VERBOSE(VB_CHANNEL, QString("Icon Import: Working search : %1").arg(str));
LOG(VB_CHANNEL, LOG_INFO,
QString("Icon Import: Working search : %1").arg(str));
QStringList strSplit = str.split("\n");

// HACK HACK HACK -- begin
// This is needed since the user can't escape out of the progress dialog
// and the result set may contain thousands of channels.
if (strSplit.size() > 36*3)
{
VERBOSE(VB_IMPORTANT,
QString("Warning: Result set contains %1 items, "
"truncating to the first %2 results")
LOG(VB_GENERAL, LOG_WARNING,
QString("Warning: Result set contains %1 items, "
"truncating to the first %2 results")
.arg(strSplit.size()).arg(18*3));
while (strSplit.size() > 18*3) strSplit.removeLast();
}
Expand Down Expand Up @@ -670,8 +674,9 @@ bool ImportIconsWizard::search(const QString& strParam)
if (row != "#" )
{
QStringList ret = extract_csv(row);
VERBOSE(VB_CHANNEL, QString("Icon Import: search : %1 %2 %3")
.arg(ret[0]).arg(ret[1]).arg(ret[2]));
LOG(VB_CHANNEL, LOG_INFO,
QString("Icon Import: search : %1 %2 %3")
.arg(ret[0]).arg(ret[1]).arg(ret[2]));
SearchEntry entry;
entry.strID = ret[0];
entry.strName = ret[1];
Expand Down Expand Up @@ -731,29 +736,32 @@ bool ImportIconsWizard::findmissing(const QString& strParam)
QUrl url(m_url+"/findmissing");

QString str = wget(url,"csv="+strParam1);
VERBOSE(VB_CHANNEL, QString("Icon Import: findmissing : strParam1 = %1. str = %2").arg(strParam1).arg(str));
LOG(VB_CHANNEL, LOG_INFO,
QString("Icon Import: findmissing : strParam1 = %1. str = %2")
.arg(strParam1).arg(str));
if (str.isEmpty() || str.startsWith("#"))
{
return false;
}
else if (str.startsWith("Error", Qt::CaseInsensitive))
{
VERBOSE(VB_IMPORTANT, QString("Error from findmissing : %1").arg(str));
LOG(VB_GENERAL, LOG_ERR,
QString("Error from findmissing : %1").arg(str));
return false;
}
else
{
VERBOSE(VB_CHANNEL, QString("Icon Import: Working findmissing : %1")
.arg(str));
LOG(VB_CHANNEL, LOG_INFO,
QString("Icon Import: Working findmissing : %1") .arg(str));
QStringList strSplit = str.split("\n", QString::SkipEmptyParts);
for (QStringList::const_iterator it = strSplit.begin();
it != strSplit.end(); ++it)
{
if (*it != "#")
{
const QStringList ret = extract_csv(*it);
VERBOSE(VB_CHANNEL, QString(
"Icon Import: findmissing : %1 %2 %3 %4 %5")
LOG(VB_CHANNEL, LOG_INFO,
QString("Icon Import: findmissing : %1 %2 %3 %4 %5")
.arg(ret[0]).arg(ret[1]).arg(ret[2])
.arg(ret[3]).arg(ret[4]));
checkAndDownload(ret[4], (*m_iter).strChanId);
Expand Down Expand Up @@ -788,14 +796,14 @@ bool ImportIconsWizard::submit()
if (str.isEmpty() || str.startsWith("#") ||
str.startsWith("Error", Qt::CaseInsensitive))
{
VERBOSE(VB_IMPORTANT, QString("Error from submit : %1").arg(str));
LOG(VB_GENERAL, LOG_ERR, QString("Error from submit : %1").arg(str));
if (m_statusText)
m_statusText->SetText(tr("Failed to submit icon choices."));
return false;
}
else
{
VERBOSE(VB_CHANNEL, QString("Icon Import: Working submit : %1")
LOG(VB_CHANNEL, LOG_INFO, QString("Icon Import: Working submit : %1")
.arg(str));
QStringList strSplit = str.split("\n", QString::SkipEmptyParts);
unsigned atsc = 0, dvb = 0, callsign = 0, tv = 0, xmltvid = 0;
Expand All @@ -821,8 +829,10 @@ bool ImportIconsWizard::submit()
else if (s == "x")
xmltvid = strSplit2[1].toUInt();
}
VERBOSE(VB_CHANNEL, QString("Icon Import: working submit : atsc=%1 callsign=%2 dvb=%3 tv=%4 xmltvid=%5")
.arg(atsc).arg(callsign).arg(dvb).arg(tv).arg(xmltvid));
LOG(VB_CHANNEL, LOG_INFO,
QString("Icon Import: working submit : atsc=%1 callsign=%2 "
"dvb=%3 tv=%4 xmltvid=%5")
.arg(atsc).arg(callsign).arg(dvb).arg(tv).arg(xmltvid));
if (m_statusText)
m_statusText->SetText(tr("Icon choices submitted successfully."));
return true;
Expand Down
20 changes: 10 additions & 10 deletions mythtv/programs/mythtv-setup/main.cpp
Expand Up @@ -108,7 +108,7 @@ static void SetupMenuCallback(void* data, QString& selection)
exitPrompt->handleExit();
}
else
VERBOSE(VB_IMPORTANT, "Unknown menu action: " + selection);
LOG(VB_GENERAL, LOG_ERR, "Unknown menu action: " + selection);
}

static bool RunMenu(QString themedir, QString themename)
Expand All @@ -125,7 +125,7 @@ static bool RunMenu(QString themedir, QString themename)
return true;
}

VERBOSE(VB_IMPORTANT, QString("Couldn't use theme '%1'").arg(themename));
LOG(VB_GENERAL, LOG_ERR, QString("Couldn't use theme '%1'").arg(themename));
delete menu;
menu = NULL;

Expand All @@ -141,8 +141,8 @@ static bool resetTheme(QString themedir, const QString badtheme)
if (badtheme == DEFAULT_UI_THEME)
themename = FALLBACK_UI_THEME;

VERBOSE(VB_IMPORTANT,
QString("Overriding broken theme '%1' with '%2'")
LOG(VB_GENERAL, LOG_ERR,
QString("Overriding broken theme '%1' with '%2'")
.arg(badtheme).arg(themename));

gCoreContext->OverrideSettingForSession("Theme", themename);
Expand All @@ -163,7 +163,7 @@ static int reloadTheme(void)
QString themedir = GetMythUI()->FindThemeDir(themename);
if (themedir.isEmpty())
{
VERBOSE(VB_IMPORTANT, QString("Couldn't find theme '%1'")
LOG(VB_GENERAL, LOG_ERR, QString("Couldn't find theme '%1'")
.arg(themename));
return GENERIC_EXIT_NO_THEME;
}
Expand Down Expand Up @@ -303,7 +303,7 @@ int main(int argc, char *argv[])

if (!gContext->Init(use_display)) // No Upnp, Prompt for db
{
VERBOSE(VB_IMPORTANT, "Failed to init MythContext, exiting.");
LOG(VB_GENERAL, LOG_ERR, "Failed to init MythContext, exiting.");
return GENERIC_EXIT_NO_MYTHCONTEXT;
}

Expand Down Expand Up @@ -456,7 +456,7 @@ int main(int argc, char *argv[])
QString themedir = GetMythUI()->FindThemeDir(themename);
if (themedir.isEmpty())
{
VERBOSE(VB_IMPORTANT, QString("Couldn't find theme '%1'")
LOG(VB_GENERAL, LOG_ERR, QString("Couldn't find theme '%1'")
.arg(themename));
return GENERIC_EXIT_NO_THEME;
}
Expand All @@ -476,7 +476,7 @@ int main(int argc, char *argv[])

if (!UpgradeTVDatabaseSchema(true))
{
VERBOSE(VB_IMPORTANT, "Couldn't upgrade database to new schema.");
LOG(VB_GENERAL, LOG_ERR, "Couldn't upgrade database to new schema.");
return GENERIC_EXIT_DB_OUTOFDATE;
}

Expand Down Expand Up @@ -504,8 +504,8 @@ int main(int argc, char *argv[])
{
delete expertEditor;
expertEditor = NULL;
VERBOSE(VB_IMPORTANT, "Unable to create expert settings editor "
"window");
LOG(VB_GENERAL, LOG_ERR,
"Unable to create expert settings editor window");
return GENERIC_EXIT_OK;
}
}
Expand Down
6 changes: 3 additions & 3 deletions mythtv/programs/mythtv-setup/startprompt.cpp
Expand Up @@ -43,13 +43,13 @@ void StartPrompter::handleStart()

void StartPrompter::leaveBackendRunning()
{
VERBOSE(VB_GENERAL, "Continuing with backend running");
LOG(VB_GENERAL, LOG_INFO, "Continuing with backend running");
gCoreContext->SetSetting("AutoRestartBackend", "0");
}

void StartPrompter::stopBackend()
{
VERBOSE(VB_GENERAL, "Trying to stop backend");
LOG(VB_GENERAL, LOG_INFO, "Trying to stop backend");

QString commandString = gCoreContext->GetSetting("BackendStopCommand");
if (!commandString.isEmpty())
Expand Down Expand Up @@ -86,7 +86,7 @@ void StartPrompter::backendRunningPrompt(void)

if (!dia->Create())
{
VERBOSE(VB_IMPORTANT, "Can't create Prompt dialog?");
LOG(VB_GENERAL, LOG_ERR, "Can't create Prompt dialog?");
delete dia;
quit();
}
Expand Down
8 changes: 4 additions & 4 deletions mythtv/programs/mythwelcome/main.cpp
Expand Up @@ -79,15 +79,15 @@ int main(int argc, char **argv)
gContext = new MythContext(MYTH_BINARY_VERSION);
if (!gContext->Init())
{
VERBOSE(VB_IMPORTANT, "mythwelcome: Could not initialize MythContext. "
"Exiting.");
LOG(VB_GENERAL, LOG_ERR,
"mythwelcome: Could not initialize MythContext. Exiting.");
return GENERIC_EXIT_NO_MYTHCONTEXT;
}

if (!MSqlQuery::testDBConnection())
{
VERBOSE(VB_IMPORTANT, "mythwelcome: Could not open the database. "
"Exiting.");
LOG(VB_GENERAL, LOG_ERR,
"mythwelcome: Could not open the database. Exiting.");
return -1;
}

Expand Down

0 comments on commit ea958bb

Please sign in to comment.