Skip to content

Commit

Permalink
VERBOSE -> LOG in mythfrontend
Browse files Browse the repository at this point in the history
  • Loading branch information
Beirdo committed Jul 8, 2011
1 parent 688ed44 commit 48520d5
Show file tree
Hide file tree
Showing 43 changed files with 544 additions and 428 deletions.
11 changes: 5 additions & 6 deletions mythtv/programs/mythfrontend/actionset.cpp
Expand Up @@ -64,7 +64,7 @@ bool ActionSet::Add(const ActionID &id, const QString &key)

if (!a->AddKey(key))
{
VERBOSE(VB_IMPORTANT, "ActionSet::AddKey() failed");
LOG(VB_GENERAL, LOG_ERR, "ActionSet::AddKey() failed");
return false;
}

Expand Down Expand Up @@ -333,8 +333,8 @@ Action *ActionSet::GetAction(const ActionID &id)
ContextMap::iterator cit = m_contexts.find(id.GetContext());
if (cit == m_contexts.end())
{
VERBOSE(VB_IMPORTANT,
QString("GetAction: Did not find context '%1'")
LOG(VB_GENERAL, LOG_ERR,
QString("GetAction: Did not find context '%1'")
.arg(id.GetContext()));

return NULL;
Expand All @@ -344,9 +344,8 @@ Action *ActionSet::GetAction(const ActionID &id)

if (it == (*cit).end())
{
VERBOSE(VB_IMPORTANT,
QString("GetAction: Did not find action '%1' "
"in context '%1'")
LOG(VB_GENERAL, LOG_ERR,
QString("GetAction: Did not find action '%1' in context '%1'")
.arg(id.GetAction()).arg(id.GetContext()));
return NULL;
}
Expand Down
24 changes: 13 additions & 11 deletions mythtv/programs/mythfrontend/audiogeneralsettings.cpp
Expand Up @@ -130,8 +130,9 @@ AudioConfigSettings::AudioConfigSettings(ConfigurationWizard *parent) :
AudioOutput::GetAudioDeviceConfig(name, name, true);
if (adc->settings.IsInvalid())
{
VERBOSE(VB_IMPORTANT, QString("Audio device %1 isn't usable "
"Check audio configuration").arg(name));
LOG(VB_GENERAL, LOG_ERR,
QString("Audio device %1 isn't usable Check audio configuration")
.arg(name));
}
audiodevs.insert(name, *adc);
devices.append(*adc);
Expand Down Expand Up @@ -224,7 +225,7 @@ void AudioConfigSettings::AudioRescan()
QString msg = name + QObject::tr(" is invalid or not useable.");
MythPopupBox::showOkPopup(
GetMythMainWindow(), QObject::tr("Warning"), msg);
VERBOSE(VB_IMPORTANT, QString("Audio device %1 isn't usable ")
LOG(VB_GENERAL, LOG_ERR, QString("Audio device %1 isn't usable")
.arg(name));
}
audiodevs.insert(name, *adc);
Expand All @@ -239,7 +240,7 @@ void AudioConfigSettings::AudioRescan()
gCoreContext->GetSetting("PassThruOutputDevice");
MythPopupBox::showOkPopup(
GetMythMainWindow(), QObject::tr("Warning"), msg);
VERBOSE(VB_IMPORTANT, QString("Audio device %1 isn't usable ")
LOG(VB_GENERAL, LOG_ERR, QString("Audio device %1 isn't usable")
.arg(name));
}
slotlock.unlock();
Expand Down Expand Up @@ -284,7 +285,7 @@ AudioOutputSettings AudioConfigSettings::UpdateCapabilities(
QString out = m_OutputDevice->getValue();
if (!audiodevs.contains(out))
{
VERBOSE(VB_AUDIO, QString("Update not found (%1)").arg(out));
LOG(VB_AUDIO, LOG_ERR, QString("Update not found (%1)").arg(out));
invalid = true;
}
else
Expand Down Expand Up @@ -330,7 +331,7 @@ AudioOutputSettings AudioConfigSettings::UpdateCapabilities(

if (cur_speakers > max_speakers)
{
VERBOSE(VB_AUDIO, QString("Reset device %1").arg(out));
LOG(VB_AUDIO, LOG_INFO, QString("Reset device %1").arg(out));
cur_speakers = max_speakers;
}

Expand Down Expand Up @@ -494,8 +495,9 @@ bool AudioConfigSettings::CheckPassthrough()
AudioOutput::GetAudioDeviceConfig(name, name, true);
if (adc->settings.IsInvalid())
{
VERBOSE(VB_IMPORTANT, QString("Passthru device %1 isn't usable "
"Check audio configuration").arg(name));
LOG(VB_GENERAL, LOG_ERR,
QString("Passthru device %1 isn't usable "
"Check audio configuration").arg(name));
ok = false;
}
// add it to list of known devices
Expand Down Expand Up @@ -649,7 +651,7 @@ void AudioTestThread::run()
QCoreApplication::postEvent(
m_parent, new ChannelChangedEvent(channel,
m_channel < 0));
VERBOSE(VB_AUDIO, QString("AudioTest: %1 (%2->%3)")
LOG(VB_AUDIO, LOG_INFO, QString("AudioTest: %1 (%2->%3)")
.arg(channel).arg(i).arg(current));
}

Expand All @@ -662,8 +664,8 @@ void AudioTestThread::run()
m_hd ? 32 : 16);
if (!m_audioOutput->AddFrames(frames, 1000 , -1))
{
VERBOSE(VB_AUDIO, "AddData() "
"Audio buffer overflow, audio data lost!");
LOG(VB_AUDIO, LOG_ERR, "AddData() Audio buffer "
"overflow, audio data lost!");
}
// a tad less than 1/48th of a second to avoid underruns
usleep((1000000 / m_samplerate) * 1000);
Expand Down
25 changes: 12 additions & 13 deletions mythtv/programs/mythfrontend/backendconnectionmanager.cpp
Expand Up @@ -79,22 +79,21 @@ void BackendConnectionManager::customEvent(QEvent *event)
{
// Check for different time zones,
// different offsets, different times
VERBOSE(VB_IMPORTANT,
"The time and/or time zone settings on this "
"system do not match those in use on the master "
"backend. Please ensure all frontend and backend "
"systems are configured to use the same time "
"zone and have the current time properly set.");
VERBOSE(VB_IMPORTANT,
"Unable to run with invalid time settings. "
"Exiting.");
LOG(VB_GENERAL, LOG_ERR,
"The time and/or time zone settings on this "
"system do not match those in use on the master "
"backend. Please ensure all frontend and backend "
"systems are configured to use the same time "
"zone and have the current time properly set.");
LOG(VB_GENERAL, LOG_ERR,
"Unable to run with invalid time settings. Exiting.");
MythScreenStack *popupStack = GetMythMainWindow()->
GetStack("popup stack");
QString message = tr("Your frontend and backend are configured "
"in different timezones. You must correct "
"this mismatch to continue.");
MythConfirmationDialog *error = new MythConfirmationDialog(
popupStack, message, false);
"in different timezones. You must "
"correct this mismatch to continue.");
MythConfirmationDialog *error = new MythConfirmationDialog(
popupStack, message, false);
if (error->Create())
{
QObject::connect(error, SIGNAL(haveResult(bool)),
Expand Down
2 changes: 1 addition & 1 deletion mythtv/programs/mythfrontend/channelrecpriority.cpp
Expand Up @@ -95,7 +95,7 @@ bool ChannelRecPriority::Create()

if (!m_channelList)
{
VERBOSE(VB_IMPORTANT, "Theme is missing critical theme elements.");
LOG(VB_GENERAL, LOG_ERR, "Theme is missing critical theme elements.");
return false;
}

Expand Down
2 changes: 1 addition & 1 deletion mythtv/programs/mythfrontend/customedit.cpp
Expand Up @@ -68,7 +68,7 @@ bool CustomEdit::Create()

if (err)
{
VERBOSE(VB_IMPORTANT, "Cannot load screen 'customedit'");
LOG(VB_GENERAL, LOG_ERR, "Cannot load screen 'customedit'");
return false;
}

Expand Down
12 changes: 6 additions & 6 deletions mythtv/programs/mythfrontend/custompriority.cpp
Expand Up @@ -67,8 +67,8 @@ bool CustomPriority::Create()
!m_descriptionEdit || !m_addButton || !m_installButton ||
!m_testButton || !m_deleteButton || !m_cancelButton)
{
VERBOSE(VB_IMPORTANT, "CustomPriority, theme is missing "
"required elements");
LOG(VB_GENERAL, LOG_ERR,
"CustomPriority, theme is missing required elements");
return false;
}

Expand Down Expand Up @@ -402,7 +402,7 @@ void CustomPriority::testSchedule(void)
"Query was: %1 \nError was: %2 \n")
.arg(thequery)
.arg(MythDB::DBErrorMessage(query.lastError()));
VERBOSE(VB_IMPORTANT, msg);
LOG(VB_GENERAL, LOG_ERR, msg);
return;
}

Expand All @@ -415,7 +415,7 @@ void CustomPriority::testSchedule(void)
"Query was: %1 \nError was: %2 \n")
.arg(thequery)
.arg(MythDB::DBErrorMessage(query.lastError()));
VERBOSE(VB_IMPORTANT, msg);
LOG(VB_GENERAL, LOG_ERR, msg);
return;
}

Expand All @@ -429,7 +429,7 @@ void CustomPriority::testSchedule(void)
"Query was: %1 \nError was: %2 \n")
.arg(thequery)
.arg(MythDB::DBErrorMessage(query.lastError()));
VERBOSE(VB_IMPORTANT, msg);
LOG(VB_GENERAL, LOG_ERR, msg);
return;
}

Expand Down Expand Up @@ -473,6 +473,6 @@ void CustomPriority::testSchedule(void)
"Query was: %1 \nError was: %2 \n")
.arg(thequery)
.arg(MythDB::DBErrorMessage(query.lastError()));
VERBOSE(VB_IMPORTANT, msg);
LOG(VB_GENERAL, LOG_ERR, msg);
}
}
4 changes: 2 additions & 2 deletions mythtv/programs/mythfrontend/editvideometadata.cpp
Expand Up @@ -92,7 +92,7 @@ bool EditMetadataDialog::Create()

if (err)
{
VERBOSE(VB_IMPORTANT, "Cannot load screen 'edit_metadata'");
LOG(VB_GENERAL, LOG_ERR, "Cannot load screen 'edit_metadata'");
return false;
}

Expand Down Expand Up @@ -1057,7 +1057,7 @@ void EditMetadataDialog::customEvent(QEvent *levent)
if (lul.size())
{
MetadataLookup *lookup = lul.takeFirst();
VERBOSE(VB_GENERAL,
LOG(VB_GENERAL, LOG_INFO,
QString("No results found for %1 %2 %3").arg(lookup->GetTitle())
.arg(lookup->GetSeason()).arg(lookup->GetEpisode()));
}
Expand Down
21 changes: 14 additions & 7 deletions mythtv/programs/mythfrontend/exitprompt.cpp
Expand Up @@ -13,6 +13,7 @@
#include "mythscreenstack.h"
#include "mythsystem.h"
#include "mythlogging.h"
#include "exitcodes.h"

void ExitPrompter::quit()
{
Expand Down Expand Up @@ -69,11 +70,14 @@ void ExitPrompter::halt()
if (!halt_cmd.isEmpty()) /* Use user specified command if it exists */
{
ret = myth_system(halt_cmd);
if (ret != 0)
VERBOSE(VB_IMPORTANT, "User defined HaltCommand failed, falling back to alternative methods.");
if (ret != GENERIC_EXIT_OK)
LOG(VB_GENERAL, LOG_ERR,
"User defined HaltCommand failed, falling back to "
"alternative methods.");
}

if (ret != 0 && !DBusHalt()) /* If supported, use DBus to shutdown */
/* If supported, use DBus to shutdown */
if (ret != GENERIC_EXIT_OK && !DBusHalt())
myth_system("sudo /sbin/halt -p");
}

Expand Down Expand Up @@ -127,11 +131,14 @@ void ExitPrompter::reboot()
if (!reboot_cmd.isEmpty()) /* Use user specified command if it exists */
{
ret = myth_system(reboot_cmd);
if (ret != 0)
VERBOSE(VB_IMPORTANT, "User defined RebootCommand failed, falling back to alternative methods.");
if (ret != GENERIC_EXIT_OK)
LOG(VB_GENERAL, LOG_ERR,
"User defined RebootCommand failed, falling back to "
"alternative methods.");
}

if (ret != 0 && !DBusReboot()) /* If supported, use DBus to reboot */
/* If supported, use DBus to reboot */
if (ret != GENERIC_EXIT_OK && !DBusReboot())
myth_system("sudo /sbin/reboot");
}

Expand Down Expand Up @@ -190,7 +197,7 @@ void ExitPrompter::handleExit()

if (!dlg->Create())
{
VERBOSE(VB_IMPORTANT, "Can't create Exit Prompt dialog?");
LOG(VB_GENERAL, LOG_ERR, "Can't create Exit Prompt dialog?");
delete dlg;
quit();
}
Expand Down
16 changes: 9 additions & 7 deletions mythtv/programs/mythfrontend/globalsettings.cpp
Expand Up @@ -994,16 +994,16 @@ void PlaybackProfileConfig::Save(void)
bool ok = VideoDisplayProfile::DeleteDB(groupid, del_items);
if (!ok)
{
VERBOSE(VB_IMPORTANT,
"PlaybackProfileConfig::Save() -- failed to delete items");
LOG(VB_GENERAL, LOG_ERR,
"PlaybackProfileConfig::Save() -- failed to delete items");
return;
}

ok = VideoDisplayProfile::SaveDB(groupid, items);
if (!ok)
{
VERBOSE(VB_IMPORTANT,
"PlaybackProfileConfig::Save() -- failed to save items");
LOG(VB_GENERAL, LOG_ERR,
"PlaybackProfileConfig::Save() -- failed to save items");
return;
}
}
Expand All @@ -1016,7 +1016,7 @@ void PlaybackProfileConfig::pressed(QString cmd)
PlaybackProfileItemConfig itemcfg(items[i]);

if (itemcfg.exec() != kDialogCodeAccepted)
VERBOSE(VB_IMPORTANT, QString("edit #%1").arg(i) + " rejected");
LOG(VB_GENERAL, LOG_ERR, QString("edit #%1").arg(i) + " rejected");

InitLabel(i);
needs_save = true;
Expand All @@ -1036,7 +1036,7 @@ void PlaybackProfileConfig::pressed(QString cmd)
PlaybackProfileItemConfig itemcfg(item);

if (itemcfg.exec() != kDialogCodeAccepted)
VERBOSE(VB_IMPORTANT, "addentry rejected");
LOG(VB_GENERAL, LOG_ERR, "addentry rejected");

items.push_back(item);
InitUI();
Expand Down Expand Up @@ -1181,7 +1181,9 @@ PlaybackProfileConfigs::PlaybackProfileConfigs(const QString &str) :

PlaybackProfileConfigs::~PlaybackProfileConfigs()
{
//VERBOSE(VB_IMPORTANT, "~PlaybackProfileConfigs()");
#if 0
LOG(VB_GENERAL, LOG_DEBUG, "~PlaybackProfileConfigs()");
#endif
}

void PlaybackProfileConfigs::btnPress(QString cmd)
Expand Down
2 changes: 1 addition & 1 deletion mythtv/programs/mythfrontend/grabbersettings.cpp
Expand Up @@ -47,7 +47,7 @@ bool GrabberSettings::Create()
if (!m_movieGrabberButtonList || !m_tvGrabberButtonList ||
!m_gameGrabberButtonList ||!m_okButton || !m_cancelButton)
{
VERBOSE(VB_IMPORTANT, "Theme is missing critical theme elements.");
LOG(VB_GENERAL, LOG_ERR, "Theme is missing critical theme elements.");
return false;
}

Expand Down
9 changes: 5 additions & 4 deletions mythtv/programs/mythfrontend/guidegrid.cpp
Expand Up @@ -189,7 +189,7 @@ void GuideGrid::RunProgramGuide(uint chanid, const QString &channum,
.arg(ChannelGroup::GetChannelGroupName(changrpid));
}

VERBOSE(VB_IMPORTANT, LOC_WARN + message);
LOG(VB_GENERAL, LOG_WARNING, LOC + message);

if (!player)
ShowOkPopup(message);
Expand Down Expand Up @@ -288,7 +288,8 @@ bool GuideGrid::Create()

if (err)
{
VERBOSE(VB_IMPORTANT, QString("Cannot load screen '%1'").arg(windowName));
LOG(VB_GENERAL, LOG_ERR,
QString("Cannot load screen '%1'").arg(windowName));
return false;
}

Expand Down Expand Up @@ -893,7 +894,7 @@ void GuideGrid::fillChannelInfos(bool gotostartchannel)

if (m_channelInfos.empty())
{
VERBOSE(VB_IMPORTANT, "GuideGrid: "
LOG(VB_GENERAL, LOG_ERR, "GuideGrid: "
"\n\t\t\tYou don't have any channels defined in the database."
"\n\t\t\tGuide grid will have nothing to show you.");
}
Expand Down Expand Up @@ -1346,7 +1347,7 @@ void GuideGrid::customEvent(QEvent *event)
if (record)
{
if ((buttonnum > 0) && !record->Delete())
VERBOSE(VB_IMPORTANT, "Failed to delete recording rule");
LOG(VB_GENERAL, LOG_ERR, "Failed to delete recording rule");
delete record;
}
}
Expand Down
2 changes: 1 addition & 1 deletion mythtv/programs/mythfrontend/keygrabber.cpp
Expand Up @@ -41,7 +41,7 @@ bool KeyGrabPopupBox::Create(void)

if (!m_messageText || !m_okButton || !m_cancelButton)
{
VERBOSE(VB_IMPORTANT, "Theme is missing critical elements.");
LOG(VB_GENERAL, LOG_ERR, "Theme is missing critical elements.");
return false;
}

Expand Down

0 comments on commit 48520d5

Please sign in to comment.