Skip to content

Commit

Permalink
VERBOSE -> LOG in mythavtest, mythbackend
Browse files Browse the repository at this point in the history
Also a bit of cleanup in the main_helpers/main for mythbackend to tidy the
mainline and the now unused functions that have been handled elsewhere during
the startup.
  • Loading branch information
Beirdo committed Jul 6, 2011
1 parent f144d98 commit 26cff56
Show file tree
Hide file tree
Showing 21 changed files with 1,076 additions and 1,005 deletions.
12 changes: 6 additions & 6 deletions mythtv/programs/mythavtest/main.cpp
Expand Up @@ -70,7 +70,7 @@ int main(int argc, char *argv[])
gContext = new MythContext(MYTH_BINARY_VERSION);
if (!gContext->Init())
{
VERBOSE(VB_IMPORTANT, "Failed to init MythContext, exiting.");
LOG(VB_GENERAL, LOG_ERR, "Failed to init MythContext, exiting.");
return GENERIC_EXIT_NO_MYTHCONTEXT;
}

Expand All @@ -84,7 +84,7 @@ int main(int argc, char *argv[])
{
QString msg = QString("Fatal Error: Couldn't find theme '%1'.")
.arg(themename);
VERBOSE(VB_IMPORTANT, msg);
LOG(VB_GENERAL, LOG_ERR, msg);
return GENERIC_EXIT_NO_THEME;
}

Expand All @@ -96,8 +96,8 @@ int main(int argc, char *argv[])
QString auddevice = gCoreContext->GetSetting("AudioOutputDevice");
if (auddevice.isEmpty())
{
VERBOSE(VB_IMPORTANT, "Fatal Error: Audio not configured, you need "
"to run 'mythfrontend', not 'mythtv'.");
LOG(VB_GENERAL, LOG_ERR, "Fatal Error: Audio not configured, you need "
"to run 'mythfrontend', not 'mythtv'.");
return GENERIC_EXIT_SETUP_ERROR;
}
#endif
Expand All @@ -109,15 +109,15 @@ int main(int argc, char *argv[])

if (!UpgradeTVDatabaseSchema(false))
{
VERBOSE(VB_IMPORTANT, "Fatal Error: Incorrect database schema.");
LOG(VB_GENERAL, LOG_ERR, "Fatal Error: Incorrect database schema.");
delete gContext;
return GENERIC_EXIT_DB_OUTOFDATE;
}

TV *tv = new TV();
if (!tv->Init())
{
VERBOSE(VB_IMPORTANT, "Fatal Error: Could not initialize TV class.");
LOG(VB_GENERAL, LOG_ERR, "Fatal Error: Could not initialize TV class.");
return GENERIC_EXIT_NOT_OK;
}

Expand Down
177 changes: 90 additions & 87 deletions mythtv/programs/mythbackend/autoexpire.cpp

Large diffs are not rendered by default.

75 changes: 39 additions & 36 deletions mythtv/programs/mythbackend/encoderlink.cpp
Expand Up @@ -176,7 +176,7 @@ TVState EncoderLink::GetState(void)
else if (sock)
retval = (TVState)sock->GetEncoderState(m_capturecardnum);
else
VERBOSE(VB_GENERAL, QString("Broken for card: %1")
LOG(VB_GENERAL, LOG_ERR, QString("Broken for card: %1")
.arg(m_capturecardnum));

return retval;
Expand All @@ -198,7 +198,7 @@ uint EncoderLink::GetFlags(void) const
else if (sock)
retval = sock->GetEncoderState(m_capturecardnum);
else
VERBOSE(VB_IMPORTANT, LOC_ERR + "GetFlags failed");
LOG(VB_GENERAL, LOG_ERR, LOC + "GetFlags failed");

return retval;
}
Expand Down Expand Up @@ -389,9 +389,9 @@ RecStatusType EncoderLink::StartRecording(const ProgramInfo *rec)
else if (sock)
retval = sock->StartRecording(m_capturecardnum, rec);
else
VERBOSE(VB_IMPORTANT,
QString("Wanted to start recording on recorder %1,\n\t\t\t"
"but the backend is not there anymore\n")
LOG(VB_GENERAL, LOG_ERR,
QString("Wanted to start recording on recorder %1,\n\t\t\t"
"but the backend is not there anymore\n")
.arg(m_capturecardnum));

if (retval != rsRecording && retval != rsTuning)
Expand All @@ -413,9 +413,9 @@ RecStatusType EncoderLink::GetRecordingStatus(void)
else if (sock)
retval = sock->GetRecordingStatus(m_capturecardnum);
else
VERBOSE(VB_IMPORTANT,
QString("Wanted to get status on recorder %1,\n\t\t\t"
"but the backend is not there anymore\n")
LOG(VB_GENERAL, LOG_ERR,
QString("Wanted to get status on recorder %1,\n\t\t\t"
"but the backend is not there anymore\n")
.arg(m_capturecardnum));

if (retval != rsRecording && retval != rsTuning)
Expand Down Expand Up @@ -492,7 +492,7 @@ bool EncoderLink::IsReallyRecording(void)
if (local)
return tv->IsReallyRecording();

VERBOSE(VB_IMPORTANT, "Should be local only query: IsReallyRecording");
LOG(VB_GENERAL, LOG_ERR, "Should be local only query: IsReallyRecording");
return false;
}

Expand All @@ -508,7 +508,7 @@ float EncoderLink::GetFramerate(void)
if (local)
return tv->GetFramerate();

VERBOSE(VB_IMPORTANT, "Should be local only query: GetFramerate");
LOG(VB_GENERAL, LOG_ERR, "Should be local only query: GetFramerate");
return -1;
}

Expand All @@ -524,7 +524,7 @@ long long EncoderLink::GetFramesWritten(void)
if (local)
return tv->GetFramesWritten();

VERBOSE(VB_IMPORTANT, "Should be local only query: GetFramesWritten");
LOG(VB_GENERAL, LOG_ERR, "Should be local only query: GetFramesWritten");
return -1;
}

Expand All @@ -539,7 +539,7 @@ long long EncoderLink::GetFilePosition(void)
if (local)
return tv->GetFilePosition();

VERBOSE(VB_IMPORTANT, "Should be local only query: GetFilePosition");
LOG(VB_GENERAL, LOG_ERR, "Should be local only query: GetFilePosition");
return -1;
}

Expand All @@ -554,7 +554,7 @@ int64_t EncoderLink::GetKeyframePosition(uint64_t desired)
if (local)
return tv->GetKeyframePosition(desired);

VERBOSE(VB_IMPORTANT, "Should be local only query: GetKeyframePosition");
LOG(VB_GENERAL, LOG_ERR, "Should be local only query: GetKeyframePosition");
return -1;
}

Expand All @@ -563,8 +563,8 @@ bool EncoderLink::GetKeyframePositions(
{
if (!local)
{
VERBOSE(VB_IMPORTANT,
"Should be local only query: GetKeyframePositions");
LOG(VB_GENERAL, LOG_ERR,
"Should be local only query: GetKeyframePositions");
return false;
}

Expand All @@ -581,7 +581,7 @@ void EncoderLink::FrontendReady(void)
if (local)
tv->FrontendReady();
else
VERBOSE(VB_IMPORTANT, "Should be local only query: FrontendReady");
LOG(VB_GENERAL, LOG_ERR, "Should be local only query: FrontendReady");
}

/** \fn EncoderLink::CancelNextRecording(bool)
Expand Down Expand Up @@ -616,7 +616,7 @@ void EncoderLink::SpawnLiveTV(LiveTVChain *chain, bool pip, QString startchan)
if (local)
tv->SpawnLiveTV(chain, pip, startchan);
else
VERBOSE(VB_IMPORTANT, "Should be local only query: SpawnLiveTV");
LOG(VB_GENERAL, LOG_ERR, "Should be local only query: SpawnLiveTV");
}

/** \fn EncoderLink::GetChainID()
Expand All @@ -627,7 +627,7 @@ QString EncoderLink::GetChainID(void)
if (local)
return tv->GetChainID();

VERBOSE(VB_IMPORTANT, "Should be local only query: SpawnLiveTV");
LOG(VB_GENERAL, LOG_ERR, "Should be local only query: SpawnLiveTV");
return "";
}

Expand All @@ -641,7 +641,7 @@ void EncoderLink::StopLiveTV(void)
if (local)
tv->StopLiveTV();
else
VERBOSE(VB_IMPORTANT, "Should be local only query: StopLiveTV");
LOG(VB_GENERAL, LOG_ERR, "Should be local only query: StopLiveTV");
}

/** \fn EncoderLink::PauseRecorder()
Expand All @@ -655,7 +655,7 @@ void EncoderLink::PauseRecorder(void)
if (local)
tv->PauseRecorder();
else
VERBOSE(VB_IMPORTANT, "Should be local only query: PauseRecorder");
LOG(VB_GENERAL, LOG_ERR, "Should be local only query: PauseRecorder");
}

/** \fn EncoderLink::SetLiveRecording(int recording)
Expand All @@ -668,7 +668,8 @@ void EncoderLink::SetLiveRecording(int recording)
if (local)
tv->SetLiveRecording(recording);
else
VERBOSE(VB_IMPORTANT, "Should be local only query: SetLiveRecording");
LOG(VB_GENERAL, LOG_ERR,
"Should be local only query: SetLiveRecording");
}

/**
Expand Down Expand Up @@ -711,7 +712,7 @@ QString EncoderLink::GetInput(void) const
if (local)
return tv->GetInput();

VERBOSE(VB_IMPORTANT, "Should be local only query: GetInput");
LOG(VB_GENERAL, LOG_ERR, "Should be local only query: GetInput");
return QString();
}

Expand All @@ -730,7 +731,7 @@ QString EncoderLink::SetInput(QString input)
if (local)
return tv->SetInput(input);

VERBOSE(VB_IMPORTANT, "Should be local only query: SetInput");
LOG(VB_GENERAL, LOG_ERR, "Should be local only query: SetInput");
return QString();
}

Expand All @@ -744,7 +745,8 @@ void EncoderLink::ToggleChannelFavorite(QString changroup)
if (local)
tv->ToggleChannelFavorite(changroup);
else
VERBOSE(VB_IMPORTANT, "Should be local only query: ToggleChannelFavorite");
LOG(VB_GENERAL, LOG_ERR,
"Should be local only query: ToggleChannelFavorite");
}

/** \brief Changes to the next or previous channel.
Expand All @@ -758,7 +760,7 @@ void EncoderLink::ChangeChannel(ChannelChangeDirection channeldirection)
if (local)
tv->ChangeChannel(channeldirection);
else
VERBOSE(VB_IMPORTANT, "Should be local only query: ChangeChannel");
LOG(VB_GENERAL, LOG_ERR, "Should be local only query: ChangeChannel");
}

/** \fn EncoderLink::SetChannel(const QString&)
Expand All @@ -773,7 +775,7 @@ void EncoderLink::SetChannel(const QString &name)
if (local)
tv->SetChannel(name);
else
VERBOSE(VB_IMPORTANT, "Should be local only query: SetChannel");
LOG(VB_GENERAL, LOG_ERR, "Should be local only query: SetChannel");
}

/** \fn EncoderLink::GetPictureAttribute(PictureAttribute)
Expand All @@ -788,8 +790,8 @@ int EncoderLink::GetPictureAttribute(PictureAttribute attr)
{
if (!local)
{
VERBOSE(VB_IMPORTANT, "Should be local only query: "
"GetPictureAttribute");
LOG(VB_GENERAL, LOG_ERR,
"Should be local only query: GetPictureAttribute");
return -1;
}

Expand All @@ -810,8 +812,8 @@ int EncoderLink::ChangePictureAttribute(PictureAdjustType type,
{
if (!local)
{
VERBOSE(VB_IMPORTANT, "Should be local only query: "
"ChangePictureAttribute");
LOG(VB_GENERAL, LOG_ERR,
"Should be local only query: ChangePictureAttribute");
return -1;
}

Expand All @@ -832,7 +834,7 @@ bool EncoderLink::CheckChannel(const QString &name)
if (local)
return tv->CheckChannel(name);

VERBOSE(VB_IMPORTANT, "Should be local only query: CheckChannel");
LOG(VB_GENERAL, LOG_ERR, "Should be local only query: CheckChannel");
return false;
}

Expand All @@ -850,7 +852,8 @@ bool EncoderLink::ShouldSwitchToAnotherCard(const QString &channelid)
if (local)
return tv->ShouldSwitchToAnotherCard(channelid);

VERBOSE(VB_IMPORTANT, "Should be local only query: ShouldSwitchToAnotherCard");
LOG(VB_GENERAL, LOG_ERR,
"Should be local only query: ShouldSwitchToAnotherCard");
return false;
}

Expand All @@ -874,7 +877,7 @@ bool EncoderLink::CheckChannelPrefix(
is_extra_char_useful, needed_spacer);
}

VERBOSE(VB_IMPORTANT, "Should be local only query: CheckChannelPrefix");
LOG(VB_GENERAL, LOG_ERR, "Should be local only query: CheckChannelPrefix");
is_complete_valid_channel_on_rec = false;
is_extra_char_useful = false;
needed_spacer = "";
Expand Down Expand Up @@ -902,7 +905,7 @@ void EncoderLink::GetNextProgram(BrowseDirection direction,
_chanid, seriesid, programid);
}
else
VERBOSE(VB_IMPORTANT, "Should be local only query: GetNextProgram");
LOG(VB_GENERAL, LOG_ERR, "Should be local only query: GetNextProgram");
}

bool EncoderLink::GetChannelInfo(uint &chanid, uint &sourceid,
Expand All @@ -911,7 +914,7 @@ bool EncoderLink::GetChannelInfo(uint &chanid, uint &sourceid,
{
if (!local)
{
VERBOSE(VB_IMPORTANT, "Should be local only query: GetChannelInfo");
LOG(VB_GENERAL, LOG_ERR, "Should be local only query: GetChannelInfo");
return false;
}

Expand All @@ -926,7 +929,7 @@ bool EncoderLink::SetChannelInfo(uint chanid, uint sourceid,
{
if (!local)
{
VERBOSE(VB_IMPORTANT, "Should be local only query: SetChannelInfo");
LOG(VB_GENERAL, LOG_ERR, "Should be local only query: SetChannelInfo");
return false;
}

Expand Down

0 comments on commit 26cff56

Please sign in to comment.