56 changes: 28 additions & 28 deletions mythtv/libs/libmyth/mediamonitor-darwin.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -53,11 +53,11 @@ MythMediaType FindMediaType(io_service_t service)
&iter);

if (KERN_SUCCESS != kernResult)
LogPrint(VB_GENERAL, LOG_CRIT,
LOG(VB_GENERAL, LOG_CRIT,
QString("IORegistryEntryCreateIterator returned %1")
.arg(kernResult));
else if (!iter)
LogPrint(VB_GENERAL, LOG_CRIT,
LOG(VB_GENERAL, LOG_CRIT,
"IORegistryEntryCreateIterator returned NULL iterator");
else
{
Expand All @@ -77,7 +77,7 @@ MythMediaType FindMediaType(io_service_t service)
kCFAllocatorDefault, 0);

if (!wholeMedia)
LogPrint(VB_GENERAL, LOG_ALERT,
LOG(VB_GENERAL, LOG_ALERT,
"Could not retrieve Whole property");
else
{
Expand Down Expand Up @@ -120,14 +120,14 @@ MythMediaType MediaTypeForBSDName(const char *bsdName)

if (!bsdName || !*bsdName)
{
LogPrint(VB_GENERAL, LOG_ALERT, msg + " - No name supplied?");
LOG(VB_GENERAL, LOG_ALERT, msg + " - No name supplied?");
return MEDIATYPE_UNKNOWN;
}

matchingDict = IOBSDNameMatching(sMasterPort, 0, bsdName);
if (!matchingDict)
{
LogPrint(VB_GENERAL, LOG_ALERT,
LOG(VB_GENERAL, LOG_ALERT,
msg + " - IOBSDNameMatching() returned a NULL dictionary.");
return MEDIATYPE_UNKNOWN;
}
Expand All @@ -138,14 +138,14 @@ MythMediaType MediaTypeForBSDName(const char *bsdName)

if (KERN_SUCCESS != kernResult)
{
LogPrint(VB_GENERAL, LOG_ALERT,
LOG(VB_GENERAL, LOG_ALERT,
QString(msg + " - IOServiceGetMatchingServices() returned %2")
.arg(kernResult));
return MEDIATYPE_UNKNOWN;
}
if (!iter)
{
LogPrint(VB_GENERAL, LOG_ALERT,
LOG(VB_GENERAL, LOG_ALERT,
msg + " - IOServiceGetMatchingServices() returned a NULL "
"iterator");
return MEDIATYPE_UNKNOWN;
Expand All @@ -159,7 +159,7 @@ MythMediaType MediaTypeForBSDName(const char *bsdName)

if (!service)
{
LogPrint(VB_GENERAL, LOG_ALERT,
LOG(VB_GENERAL, LOG_ALERT,
msg + " - IOIteratorNext() returned a NULL iterator");
return MEDIATYPE_UNKNOWN;
}
Expand Down Expand Up @@ -188,7 +188,7 @@ static char * getVolName(CFDictionaryRef diskDetails)
volName = (char *) malloc(size);
if (!volName)
{
LogPrint(VB_GENERAL, LOG_ALERT,
LOG(VB_GENERAL, LOG_ALERT,
QString("getVolName() - Can't malloc(%1)?").arg(size));
return NULL;
}
Expand Down Expand Up @@ -264,13 +264,13 @@ void diskAppearedCallback(DADiskRef disk, void *context)

if (!BSDname)
{
LogPrint(VB_MEDIA, LOG_INFO, "Skipping non-local device");
LOG(VB_MEDIA, LOG_INFO, "Skipping non-local device");
return;
}

if (!context)
{
LogPrint(VB_GENERAL, LOG_ALERT, "Error. Invoked with a NULL context.");
LOG(VB_GENERAL, LOG_ALERT, "Error. Invoked with a NULL context.");
return;
}

Expand All @@ -287,7 +287,7 @@ void diskAppearedCallback(DADiskRef disk, void *context)
if (kCFBooleanFalse ==
CFDictionaryGetValue(details, kDADiskDescriptionMediaRemovableKey))
{
LogPrint(VB_MEDIA, LOG_INFO, "Skipping non-removable " + BSDname);
LOG(VB_MEDIA, LOG_INFO, "Skipping non-removable " + BSDname);
CFRelease(details);
return;
}
Expand All @@ -296,7 +296,7 @@ void diskAppearedCallback(DADiskRef disk, void *context)
volName = getVolName(details);
if (!volName)
{
LogPrint(VB_MEDIA, LOG_INFO, "No volume name for dev " + BSDname);
LOG(VB_MEDIA, LOG_INFO, "No volume name for dev " + BSDname);
CFRelease(details);
return;
}
Expand All @@ -309,7 +309,7 @@ void diskAppearedCallback(DADiskRef disk, void *context)
// We know it is removable, and have guessed the type.
// Call a helper function to create appropriate objects and insert

LogPrint(VB_MEDIA, LOG_INFO, QString("Found disk %1 - volume name '%2'.")
LOG(VB_MEDIA, LOG_INFO, QString("Found disk %1 - volume name '%2'.")
.arg(BSDname).arg(volName));

mtd->diskInsert(BSDname, volName, model, isCDorDVD);
Expand All @@ -335,7 +335,7 @@ void diskChangedCallback(DADiskRef disk, CFArrayRef keys, void *context)
CFDictionaryRef details = DADiskCopyDescription(disk);
char *volName = getVolName(details);

LogPrint(VB_MEDIA, LOG_INFO, QString("Disk %1 - changed name to '%2'.")
LOG(VB_MEDIA, LOG_INFO, QString("Disk %1 - changed name to '%2'.")
.arg(BSDname).arg(volName));

reinterpret_cast<MonitorThreadDarwin *>(context)
Expand Down Expand Up @@ -396,7 +396,7 @@ void MonitorThreadDarwin::diskInsert(const char *devName,
{
MythMediaDevice *media;

LogPrint(VB_MEDIA, LOG_DEBUG, QString("(%1,%2,'%3',%4)")
LOG(VB_MEDIA, LOG_DEBUG, QString("(%1,%2,'%3',%4)")
.arg(devName).arg(volName).arg(model).arg(isCDorDVD));

if (isCDorDVD)
Expand All @@ -406,7 +406,7 @@ void MonitorThreadDarwin::diskInsert(const char *devName,

if (!media)
{
LogPrint(VB_GENERAL, LOG_ALERT, "Couldn't create MythMediaDevice.");
LOG(VB_GENERAL, LOG_ALERT, "Couldn't create MythMediaDevice.");
return;
}

Expand All @@ -433,7 +433,7 @@ void MonitorThreadDarwin::diskInsert(const char *devName,

void MonitorThreadDarwin::diskRemove(QString devName)
{
LogPrint(VB_MEDIA, LOG_DEBUG,
LOG(VB_MEDIA, LOG_DEBUG,
QString("MonitorThreadDarwin::diskRemove(%1)").arg(devName));

if (m_Monitor->m_SendEvent)
Expand All @@ -443,7 +443,7 @@ void MonitorThreadDarwin::diskRemove(QString devName)
if (pDevice) // Probably should ValidateAndLock() here?
pDevice->setStatus(MEDIASTAT_NODISK);
else
LogPrint(VB_MEDIA, LOG_INFO,
LOG(VB_MEDIA, LOG_INFO,
"Couldn't find MythMediaDevice: " + devName);
}

Expand All @@ -458,7 +458,7 @@ void MonitorThreadDarwin::diskRemove(QString devName)
*/
void MonitorThreadDarwin::diskRename(const char *devName, const char *volName)
{
LogPrint(VB_MEDIA, LOG_DEBUG,
LOG(VB_MEDIA, LOG_DEBUG,
QString("MonitorThreadDarwin::diskRename(%1,%2)")
.arg(devName).arg(volName));

Expand All @@ -480,7 +480,7 @@ void MonitorThreadDarwin::diskRename(const char *devName, const char *volName)
m_Monitor->Unlock(pDevice);
}
else
LogPrint(VB_MEDIA, LOG_INFO,
LOG(VB_MEDIA, LOG_INFO,
"Couldn't find MythMediaDevice: " + devName);
}

Expand Down Expand Up @@ -511,7 +511,7 @@ void MediaMonitorDarwin::StartMonitoring(void)

qRegisterMetaType<MythMediaStatus>("MythMediaStatus");

LogPrint(VB_MEDIA, LOG_NOTICE, "Starting MediaMonitor");
LOG(VB_MEDIA, LOG_NOTICE, "Starting MediaMonitor");
m_Active = true;
m_Thread->start();
}
Expand All @@ -525,7 +525,7 @@ bool MediaMonitorDarwin::AddDevice(MythMediaDevice* pDevice)
{
if ( !pDevice )
{
LogPrint(VB_GENERAL, LOG_ALERT, "MediaMonitor::AddDevice(null)");
LOG(VB_GENERAL, LOG_ALERT, "MediaMonitor::AddDevice(null)");
return false;
}

Expand Down Expand Up @@ -613,7 +613,7 @@ QStringList MediaMonitorDarwin::GetCDROMBlockDevices()
devices = IOServiceMatching(kIOBlockStorageDeviceClass);
if (!devices)
{
LogPrint(VB_GENERAL, LOG_ALERT, msg + "No Storage Devices? Unlikely!");
LOG(VB_GENERAL, LOG_ALERT, msg + "No Storage Devices? Unlikely!");
return list;
}

Expand All @@ -622,14 +622,14 @@ QStringList MediaMonitorDarwin::GetCDROMBlockDevices()

if (KERN_SUCCESS != kernResult)
{
LogPrint(VB_GENERAL, LOG_ALERT,
LOG(VB_GENERAL, LOG_ALERT,
QString("IORegistryEntryCreateIterator returned %1")
.arg(kernResult));
return list;
}
if (!iter)
{
LogPrint(VB_GENERAL, LOG_ALERT,
LOG(VB_GENERAL, LOG_ALERT,
"IORegistryEntryCreateIterator returned a NULL iterator");
return list;
}
Expand All @@ -650,12 +650,12 @@ QStringList MediaMonitorDarwin::GetCDROMBlockDevices()
QString desc = getModel(drive);

list.append(desc);
LogPrint(VB_MEDIA, LOG_INFO, desc.prepend("Found CD/DVD: "));
LOG(VB_MEDIA, LOG_INFO, desc.prepend("Found CD/DVD: "));
CFRelease(p);
}
}
else
LogPrint(VB_GENERAL, LOG_ALERT,
LOG(VB_GENERAL, LOG_ALERT,
msg + "Could not retrieve drive properties");

IOObjectRelease(drive);
Expand Down
50 changes: 25 additions & 25 deletions mythtv/libs/libmyth/mediamonitor-unix.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -91,14 +91,14 @@ static const QString LOC = QString("MMUnix:");
// TODO: are these used?
static void fstabError(const QString &methodName)
{
LogPrint(VB_GENERAL, LOG_ALERT,
LOG(VB_GENERAL, LOG_ALERT,
LOC + methodName + " Error: failed to open " + _PATH_FSTAB +
" for reading, " + ENO);
}

static void statError(const QString &methodName, const QString devPath)
{
LogPrint(VB_GENERAL, LOG_ALERT,
LOG(VB_GENERAL, LOG_ALERT,
LOC + methodName + " Error: failed to stat " + devPath +
", " + ENO);
}
Expand All @@ -114,7 +114,7 @@ MediaMonitorUnix::MediaMonitorUnix(QObject* par,
CheckFileSystemTable();
CheckMountable();

LogPrint(VB_MEDIA, LOG_INFO, "Initial device list...\n" + listDevices());
LOG(VB_MEDIA, LOG_INFO, "Initial device list...\n" + listDevices());
}


Expand Down Expand Up @@ -198,7 +198,7 @@ bool MediaMonitorUnix::CheckMountable(void)
QDBusConnection::systemBus() );
if (!iface.isValid())
{
LogPrint(VB_GENERAL, LOG_ALERT,
LOG(VB_GENERAL, LOG_ALERT,
"CheckMountable: DBus interface error: " +
iface.lastError().message() );
return false;
Expand All @@ -209,7 +209,7 @@ bool MediaMonitorUnix::CheckMountable(void)
QDBusReply<QDBusObjectPathList> reply = iface.call("EnumerateDevices");
if (!reply.isValid())
{
LogPrint(VB_GENERAL, LOG_ALERT,
LOG(VB_GENERAL, LOG_ALERT,
"CheckMountable DBus EnumerateDevices error: " +
reply.error().message() );
return false;
Expand Down Expand Up @@ -290,13 +290,13 @@ bool MediaMonitorUnix::CheckRemovable(const QString &dev)

if (ok)
{
LogPrint(VB_MEDIA, LOG_DEBUG, msg + c);
LOG(VB_MEDIA, LOG_DEBUG, msg + c);
if (c == '1')
return true;
}
else
{
LogPrint(VB_GENERAL, LOG_ALERT, msg + "failed");
LOG(VB_GENERAL, LOG_ALERT, msg + "failed");
}
}
return false;
Expand Down Expand Up @@ -339,22 +339,22 @@ QString MediaMonitorUnix::GetDeviceFile(const QString &sysfs)
// device with partitions. FindPartition locates a partition
// in sysfs but udev hasn't created the devnode for it yet.
// Udev will send another AddDevice for the partition later.
LogPrint(VB_MEDIA, LOG_DEBUG, msg + " devnode not (yet) known");
LOG(VB_MEDIA, LOG_DEBUG, msg + " devnode not (yet) known");
}

udev_device_unref(device);
}
else
{
LogPrint(VB_GENERAL, LOG_ALERT,
LOG(VB_GENERAL, LOG_ALERT,
msg + " udev_device_new_from_syspath returned NULL");
ret = "";
}

udev_unref(udev);
}
else
LogPrint(VB_GENERAL, LOG_ALERT,
LOG(VB_GENERAL, LOG_ALERT,
"MediaMonitorUnix::GetDeviceFile udev_new failed");
#else // HAVE_LIBUDEV
// Use udevadm info to determine the name
Expand All @@ -380,7 +380,7 @@ QString MediaMonitorUnix::GetDeviceFile(const QString &sysfs)
{
QTextStream estream(udevinfo->ReadAllErr());
while( !estream.atEnd() )
LogPrint(VB_MEDIA, LOG_DEBUG,
LOG(VB_MEDIA, LOG_DEBUG,
msg + " - udevadm info error...\n" + estream.readLine());
}

Expand All @@ -393,7 +393,7 @@ QString MediaMonitorUnix::GetDeviceFile(const QString &sysfs)
#endif // HAVE_LIBUDEV
#endif // linux

LogPrint(VB_MEDIA, LOG_INFO, msg + "->'" + ret + "'");
LOG(VB_MEDIA, LOG_INFO, msg + "->'" + ret + "'");
return ret;
}
#endif // !CONFIG_QTDBUS
Expand Down Expand Up @@ -453,7 +453,7 @@ QStringList MediaMonitorUnix::GetCDROMBlockDevices(void)
}
#endif // linux

LogPrint(VB_MEDIA, LOG_DEBUG,
LOG(VB_MEDIA, LOG_DEBUG,
LOC + ":GetCDROMBlockDevices()->'" + l.join(", ") + "'");
return l;
}
Expand Down Expand Up @@ -526,7 +526,7 @@ static void LookupModel(MythMediaDevice* device)
}
#endif

LogPrint(VB_MEDIA, LOG_DEBUG, QString("LookupModel '%1' -> '%2'")
LOG(VB_MEDIA, LOG_DEBUG, QString("LookupModel '%1' -> '%2'")
.arg(device->getRealDevice()).arg(desc) );
device->setDeviceModel(desc.toAscii().constData());
}
Expand All @@ -538,7 +538,7 @@ bool MediaMonitorUnix::AddDevice(MythMediaDevice* pDevice)
{
if ( ! pDevice )
{
LogPrint(VB_GENERAL, LOG_ALERT,
LOG(VB_GENERAL, LOG_ALERT,
"Error - MediaMonitorUnix::AddDevice(null)");
return false;
}
Expand All @@ -550,7 +550,7 @@ bool MediaMonitorUnix::AddDevice(MythMediaDevice* pDevice)
QString path = pDevice->getDevicePath();
if (!path.length())
{
LogPrint(VB_GENERAL, LOG_ALERT,
LOG(VB_GENERAL, LOG_ALERT,
"MediaMonitorUnix::AddDevice() - empty device path.");
return false;
}
Expand Down Expand Up @@ -579,7 +579,7 @@ bool MediaMonitorUnix::AddDevice(MythMediaDevice* pDevice)

if (sb.st_rdev == new_rdev)
{
LogPrint(VB_MEDIA, LOG_INFO,
LOG(VB_MEDIA, LOG_INFO,
LOC + ":AddDevice() - not adding " + path +
"\n "
"because it appears to be a duplicate of " +
Expand All @@ -596,7 +596,7 @@ bool MediaMonitorUnix::AddDevice(MythMediaDevice* pDevice)
this, SLOT(mediaStatusChanged(MythMediaStatus, MythMediaDevice*)));
m_Devices.push_back( pDevice );
m_UseCount[pDevice] = 0;
LogPrint(VB_MEDIA, LOG_INFO, LOC + ":AddDevice() - Added " + path);
LOG(VB_MEDIA, LOG_INFO, LOC + ":AddDevice() - Added " + path);

return true;
}
Expand All @@ -609,7 +609,7 @@ bool MediaMonitorUnix::AddDevice(struct fstab * mep)

QString devicePath( mep->fs_spec );
#if 0
LogPrint(VB_GENERAL, LOG_DEBUG, "AddDevice - " + devicePath);
LOG(VB_GENERAL, LOG_DEBUG, "AddDevice - " + devicePath);
#endif

MythMediaDevice* pDevice = NULL;
Expand Down Expand Up @@ -646,7 +646,7 @@ bool MediaMonitorUnix::AddDevice(struct fstab * mep)
{
is_cdrom = true;
#if 0
LogPrint(VB_GENERAL, LOG_DEBUG, "Device is a CDROM");
LOG(VB_GENERAL, LOG_DEBUG, "Device is a CDROM");
#endif
}

Expand Down Expand Up @@ -701,7 +701,7 @@ bool MediaMonitorUnix::AddDevice(struct fstab * mep)
*/
void MediaMonitorUnix::deviceAdded( QDBusObjectPath o)
{
LogPrint(VB_MEDIA, LOG_INFO, LOC + ":deviceAdded " + o.path());
LOG(VB_MEDIA, LOG_INFO, LOC + ":deviceAdded " + o.path());

// Don't add devices with partition tables, just the partitions
if (!DeviceProperty(o, "DeviceIsPartitionTable").toBool())
Expand All @@ -724,7 +724,7 @@ void MediaMonitorUnix::deviceAdded( QDBusObjectPath o)
*/
void MediaMonitorUnix::deviceRemoved( QDBusObjectPath o)
{
LogPrint(VB_MEDIA, LOG_INFO, LOC + "deviceRemoved " + o.path());
LOG(VB_MEDIA, LOG_INFO, LOC + "deviceRemoved " + o.path());
#if 0 // This fails because the DeviceFile has just been deleted
QString dev = DeviceProperty(o, "DeviceFile");
if (!dev.isEmpty())
Expand Down Expand Up @@ -756,7 +756,7 @@ void MediaMonitorUnix::deviceRemoved( QDBusObjectPath o)
*/
bool MediaMonitorUnix::FindPartitions(const QString &dev, bool checkPartitions)
{
LogPrint(VB_MEDIA, LOG_DEBUG,
LOG(VB_MEDIA, LOG_DEBUG,
LOC + ":FindPartitions(" + dev +
QString(",%1").arg(checkPartitions ? " true" : " false" ) + ")");
MythMediaDevice* pDevice = NULL;
Expand Down Expand Up @@ -850,15 +850,15 @@ void MediaMonitorUnix::CheckDeviceNotifications(void)
if ((*it).startsWith("add"))
{
QString dev = (*it).section(' ', 1, 1);
LogPrint(VB_MEDIA, LOG_INFO, "Udev add " + dev);
LOG(VB_MEDIA, LOG_INFO, "Udev add " + dev);

if (CheckRemovable(dev))
FindPartitions(dev, true);
}
else if ((*it).startsWith("remove"))
{
QString dev = (*it).section(' ', 2, 2);
LogPrint(VB_MEDIA, LOG_INFO, "Udev remove " + dev);
LOG(VB_MEDIA, LOG_INFO, "Udev remove " + dev);
RemoveDevice(dev);
}
}
Expand Down
8 changes: 4 additions & 4 deletions mythtv/libs/libmyth/mediamonitor-windows.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ MediaMonitorWindows::MediaMonitorWindows(QObject* par,

if (!media)
{
LogPrint(VB_GENERAL, LOG_ALERT,
LOG(VB_GENERAL, LOG_ALERT,
"Error. Couldn't create MythMediaDevice.");
return;
}
Expand All @@ -61,14 +61,14 @@ MediaMonitorWindows::MediaMonitorWindows(QObject* par,
AddDevice(media);
}

LogPrint(VB_MEDIA, LOG_INFO, "Initial device list: " + listDevices());
LOG(VB_MEDIA, LOG_INFO, "Initial device list: " + listDevices());
}

bool MediaMonitorWindows::AddDevice(MythMediaDevice *pDevice)
{
if (!pDevice)
{
LogPrint(VB_GENERAL, LOG_ALERT,
LOG(VB_GENERAL, LOG_ALERT,
"Error - MediaMonitorWindows::AddDevice(null)");
return false;
}
Expand All @@ -83,7 +83,7 @@ bool MediaMonitorWindows::AddDevice(MythMediaDevice *pDevice)
{
if ((*itr)->getDevicePath() == path)
{
LogPrint(VB_MEDIA, LOG_INFO,
LOG(VB_MEDIA, LOG_INFO,
"MediamonitorWindows::AddDevice() -- " +
QString("Not adding '%1', it appears to be a duplicate.")
.arg(path));
Expand Down
12 changes: 6 additions & 6 deletions mythtv/libs/libmyth/mythconfiggroups.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -445,7 +445,7 @@ void StackedConfigurationGroup::raise(Configurable* child)
}
}

LogPrint(VB_GENERAL, LOG_ALERT,
LOG(VB_GENERAL, LOG_ALERT,
QString("BUG: StackedConfigurationGroup::raise(): "
"unrecognized child 0x%1 on setting %2/%3")
.arg((uint64_t)child,0,16).arg(getName()).arg(getLabel()));
Expand Down Expand Up @@ -566,7 +566,7 @@ void TriggeredConfigurationGroup::triggerChanged(const QString &value)

if (it == triggerMap.end())
{
LogPrint(VB_GENERAL, LOG_ALERT,
LOG(VB_GENERAL, LOG_ALERT,
"TriggeredConfigurationGroup::" +
QString("triggerChanged(%1) Error:").arg(value) +
"Failed to locate value in triggerMap");
Expand All @@ -587,7 +587,7 @@ void TriggeredConfigurationGroup::SetVertical(bool vert)
{
if (configLayout)
{
LogPrint(VB_GENERAL, LOG_ALERT,
LOG(VB_GENERAL, LOG_ALERT,
"TriggeredConfigurationGroup::setVertical(): "
"Sorry, this must be called before any children are added "
"to the group.");
Expand All @@ -602,7 +602,7 @@ void TriggeredConfigurationGroup::removeTarget(QString triggerValue)
ComboBoxSetting *combobox = dynamic_cast<ComboBoxSetting*>(trigger);
if (!combobox)
{
LogPrint(VB_GENERAL, LOG_ALERT,
LOG(VB_GENERAL, LOG_ALERT,
"TriggeredConfigurationGroup::removeTarget(): "
"Failed to cast trigger to ComboBoxSetting -- aborting");
return;
Expand All @@ -611,7 +611,7 @@ void TriggeredConfigurationGroup::removeTarget(QString triggerValue)
QMap<QString,Configurable*>::iterator cit = triggerMap.find(triggerValue);
if (cit == triggerMap.end())
{
LogPrint(VB_GENERAL, LOG_ALERT,
LOG(VB_GENERAL, LOG_ALERT,
QString("TriggeredConfigurationGroup::removeTarget(): "
"Failed to find desired value(%1) -- aborting")
.arg(triggerValue));
Expand All @@ -632,7 +632,7 @@ void TriggeredConfigurationGroup::removeTarget(QString triggerValue)

if (!ok)
{
LogPrint(VB_GENERAL, LOG_ALERT,
LOG(VB_GENERAL, LOG_ALERT,
QString("TriggeredConfigurationGroup::removeTarget(): "
"Failed to remove '%1' from combobox -- aborting")
.arg(triggerValue));
Expand Down
68 changes: 34 additions & 34 deletions mythtv/libs/libmyth/mythcontext.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -173,7 +173,7 @@ static void exec_program_tv_cb(const QString &cmd)
"in-progress recordings from the delete menu");
}

LogPrint(VB_GENERAL, LOG_ALERT, QString("exec_program_tv: ") + label);
LOG(VB_GENERAL, LOG_ALERT, QString("exec_program_tv: ") + label);

ShowOkPopup(label);
}
Expand Down Expand Up @@ -353,7 +353,7 @@ bool MythContextPrivate::FindDatabase(const bool prompt, const bool noPrompt)
autoSelect = manualSelect = false; // so disable any further UPnP
else
if (failure.length())
LogPrint(VB_GENERAL, LOG_ALERT, failure);
LOG(VB_GENERAL, LOG_ALERT, failure);

failure = TestDBconnection();
if (failure.isEmpty())
Expand Down Expand Up @@ -413,21 +413,21 @@ bool MythContextPrivate::FindDatabase(const bool prompt, const bool noPrompt)
// line or the GUI depending on the application.
while (!failure.isEmpty())
{
LogPrint(VB_GENERAL, LOG_ALERT, failure);
LOG(VB_GENERAL, LOG_ALERT, failure);
if (( manualSelect && ChooseBackend(failure)) ||
(!manualSelect && PromptForDatabaseParams(failure)))
{
failure = TestDBconnection();
if (failure.length())
LogPrint(VB_GENERAL, LOG_ALERT, failure);
LOG(VB_GENERAL, LOG_ALERT, failure);
}
else
goto NoDBfound;
}

DBfound:
#if 0
LogPrint(VB_GENERAL, LOG_DEBUG, "FindDatabase() - Success!");
LOG(VB_GENERAL, LOG_DEBUG, "FindDatabase() - Success!");
#endif
StoreConnectionInfo();
EnableDBerrors();
Expand All @@ -436,7 +436,7 @@ bool MythContextPrivate::FindDatabase(const bool prompt, const bool noPrompt)

NoDBfound:
#if 0
LogPrint(VB_GENERAL, LOG_DEBUG, "FindDatabase() - failed");
LOG(VB_GENERAL, LOG_DEBUG, "FindDatabase() - failed");
#endif
return false;
}
Expand All @@ -458,15 +458,15 @@ void MythContextPrivate::LoadDatabaseSettings(void)
char localhostname[1024];
if (gethostname(localhostname, 1024))
{
LogPrint(VB_GENERAL, LOG_ALERT,
LOG(VB_GENERAL, LOG_ALERT,
"MCP: Error, could not determine host name." + ENO);
localhostname[0] = '\0';
}
hostname = localhostname;
LogPrint(VB_GENERAL, LOG_ALERT, "Empty LocalHostName.");
LOG(VB_GENERAL, LOG_ALERT, "Empty LocalHostName.");
}

LogPrint(VB_GENERAL, LOG_INFO, QString("Using localhost value of %1")
LOG(VB_GENERAL, LOG_INFO, QString("Using localhost value of %1")
.arg(hostname));
gCoreContext->SetLocalHostname(hostname);
}
Expand All @@ -486,7 +486,7 @@ bool MythContextPrivate::PromptForDatabaseParams(const QString &error)
DatabaseSettings settings(m_DBhostCp);
accepted = (settings.exec() == QDialog::Accepted);
if (!accepted)
LogPrint(VB_GENERAL, LOG_ALERT,
LOG(VB_GENERAL, LOG_ALERT,
"User cancelled database configuration");

EndTempWindow();
Expand Down Expand Up @@ -580,19 +580,19 @@ QString MythContextPrivate::TestDBconnection(void)
break;
}

LogPrint(VB_GENERAL, LOG_INFO,
LOG(VB_GENERAL, LOG_INFO,
QString("Trying to wake up host %1, attempt %2")
.arg(host).arg(attempt));
myth_system(m_DBparams.wolCommand);

LogPrint(VB_GENERAL, LOG_INFO,
LOG(VB_GENERAL, LOG_INFO,
QString("Waiting for %1 seconds").arg(wakeupTime));
sleep(m_DBparams.wolReconnect);
}

if (doPing)
{
LogPrint(VB_GENERAL, LOG_INFO,
LOG(VB_GENERAL, LOG_INFO,
QString("Testing network connectivity to '%1'").arg(host));
}

Expand Down Expand Up @@ -694,7 +694,7 @@ int MythContextPrivate::ChooseBackend(const QString &error)
if (error.length())
ShowOkPopup(error);

LogPrint(VB_GENERAL, LOG_INFO, "Putting up the UPnP backend chooser");
LOG(VB_GENERAL, LOG_INFO, "Putting up the UPnP backend chooser");

BackendSelection::prompt(&m_DBparams, m_pConfig);

Expand Down Expand Up @@ -749,22 +749,22 @@ int MythContextPrivate::UPnPautoconf(const int milliSeconds)

if (!backends)
{
LogPrint(VB_GENERAL, LOG_INFO, "No UPnP backends found");
LOG(VB_GENERAL, LOG_INFO, "No UPnP backends found");
return 0;
}

count = backends->Count();
switch (count)
{
case 0:
LogPrint(VB_GENERAL, LOG_ALERT,
LOG(VB_GENERAL, LOG_ALERT,
"No UPnP backends found, but SSDP::Find() not NULL!");
break;
case 1:
LogPrint(VB_GENERAL, LOG_INFO, "Found one UPnP backend");
LOG(VB_GENERAL, LOG_INFO, "Found one UPnP backend");
break;
default:
LogPrint(VB_GENERAL, LOG_INFO,
LOG(VB_GENERAL, LOG_INFO,
QString("More than one UPnP backend found (%1)")
.arg(count));
}
Expand Down Expand Up @@ -805,11 +805,11 @@ bool MythContextPrivate::DefaultUPnP(QString &error)

if (USN.isEmpty())
{
LogPrint(VB_UPNP, LOG_INFO, "No default UPnP backend");
LOG(VB_UPNP, LOG_INFO, "No default UPnP backend");
return false;
}

LogPrint(VB_UPNP, LOG_INFO, "config.xml has default " +
LOG(VB_UPNP, LOG_INFO, "config.xml has default " +
QString("PIN '%1' and host USN: %2") .arg(PIN).arg(USN));

// ----------------------------------------------------------------------
Expand Down Expand Up @@ -873,24 +873,24 @@ bool MythContextPrivate::UPnPconnect(const DeviceLocation *backend,
QString URL = backend->m_sLocation;
MythXMLClient client(URL);

LogPrint(VB_UPNP, LOG_INFO, QString("Trying host at %1").arg(URL));
LOG(VB_UPNP, LOG_INFO, QString("Trying host at %1").arg(URL));
switch (client.GetConnectionInfo(PIN, &m_DBparams, error))
{
case UPnPResult_Success:
gCoreContext->GetDB()->SetDatabaseParams(m_DBparams);
LogPrint(VB_UPNP, LOG_INFO,
LOG(VB_UPNP, LOG_INFO,
"Got database hostname: " + m_DBparams.dbHostName);
return true;

case UPnPResult_ActionNotAuthorized:
// The stored PIN is probably not correct.
// We could prompt for the PIN and try again, but that needs a UI.
// Easier to fail for now, and put up the full UI selector later
LogPrint(VB_UPNP, LOG_ERR, "Wrong PIN?");
LOG(VB_UPNP, LOG_ERR, "Wrong PIN?");
return false;

default:
LogPrint(VB_UPNP, LOG_ERR, error);
LOG(VB_UPNP, LOG_ERR, error);
break;
}

Expand All @@ -902,7 +902,7 @@ bool MythContextPrivate::UPnPconnect(const DeviceLocation *backend,
if (URL.isEmpty())
return false;

LogPrint(VB_UPNP, LOG_INFO, "Trying default DB credentials at " + URL);
LOG(VB_UPNP, LOG_INFO, "Trying default DB credentials at " + URL);
m_DBparams.dbHostName = URL;

return true;
Expand Down Expand Up @@ -981,7 +981,7 @@ void MythContextPrivate::ShowVersionMismatchPopup(uint remote_version)
}
else
{
LogPrint(VB_GENERAL, LOG_ERR, message);
LOG(VB_GENERAL, LOG_ERR, message);
qApp->exit(GENERIC_EXIT_SOCKET_ERROR);
}
}
Expand All @@ -1005,7 +1005,7 @@ MythContext::MythContext(const QString &binversion)
if (!WSAStarted) {
WSADATA wsadata;
int res = WSAStartup(MAKEWORD(2, 0), &wsadata);
LogPrint(VB_SOCKET, LOG_INFO,
LOG(VB_SOCKET, LOG_INFO,
QString("WSAStartup returned %1").arg(res));
}
#endif
Expand All @@ -1016,7 +1016,7 @@ MythContext::MythContext(const QString &binversion)

if (!gCoreContext || !gCoreContext->Init())
{
LogPrint(VB_GENERAL, LOG_EMERG, "Unable to allocate MythCoreContext");
LOG(VB_GENERAL, LOG_EMERG, "Unable to allocate MythCoreContext");
qApp->exit(GENERIC_EXIT_NO_MYTHCONTEXT);
}
}
Expand All @@ -1028,13 +1028,13 @@ bool MythContext::Init(const bool gui,
{
if (!d)
{
LogPrint(VB_GENERAL, LOG_EMERG, "Init() Out-of-memory");
LOG(VB_GENERAL, LOG_EMERG, "Init() Out-of-memory");
return false;
}

if (app_binary_version != MYTH_BINARY_VERSION)
{
LogPrint(VB_GENERAL, LOG_EMERG,
LOG(VB_GENERAL, LOG_EMERG,
QString("Application binary version (%1) does not "
"match libraries (%2)")
.arg(app_binary_version) .arg(MYTH_BINARY_VERSION));
Expand All @@ -1047,7 +1047,7 @@ bool MythContext::Init(const bool gui,
d->TempMainWindow(false);
ShowOkPopup(warning);
}
LogPrint(VB_GENERAL, LOG_WARNING, warning);
LOG(VB_GENERAL, LOG_WARNING, warning);

return false;
}
Expand Down Expand Up @@ -1082,7 +1082,7 @@ bool MythContext::Init(const bool gui,
d->TempMainWindow(false);
ShowOkPopup(warning);
}
LogPrint(VB_GENERAL, LOG_WARNING, warning);
LOG(VB_GENERAL, LOG_WARNING, warning);

return false;
}
Expand All @@ -1100,7 +1100,7 @@ bool MythContext::Init(const bool gui,
MythContext::~MythContext()
{
if (QThreadPool::globalInstance()->activeThreadCount())
LogPrint(VB_GENERAL, LOG_INFO, "Waiting for threads to exit.");
LOG(VB_GENERAL, LOG_INFO, "Waiting for threads to exit.");

QThreadPool::globalInstance()->waitForDone();
logStop();
Expand All @@ -1122,7 +1122,7 @@ bool MythContext::TestPopupVersion(const QString &name,
"Plugin %1 is not compatible with the installed MythTV "
"libraries.");

LogPrint(VB_GENERAL, LOG_EMERG,
LOG(VB_GENERAL, LOG_EMERG,
QString("Plugin %1 (%2) binary version does not "
"match libraries (%3)")
.arg(name).arg(pluginversion).arg(libversion));
Expand Down
24 changes: 12 additions & 12 deletions mythtv/libs/libmyth/mythdialogs.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ MythDialog::MythDialog(MythMainWindow *parent, const char *name, bool setsize)
setObjectName(name);
if (!parent)
{
LogPrint(VB_GENERAL, LOG_ALERT,
LOG(VB_GENERAL, LOG_ALERT,
"Trying to create a dialog without a parent.");
return;
}
Expand Down Expand Up @@ -119,7 +119,7 @@ void MythDialog::setResult(DialogCode r)
if ((r < kDialogCodeRejected) ||
((kDialogCodeAccepted < r) && (r < kDialogCodeListStart)))
{
LogPrint(VB_GENERAL, LOG_ALERT,
LOG(VB_GENERAL, LOG_ALERT,
QString("MythDialog::setResult(%1) "
"called with invalid DialogCode").arg(r));
}
Expand All @@ -138,7 +138,7 @@ void MythDialog::AcceptItem(int i)
{
if (i < 0)
{
LogPrint(VB_GENERAL, LOG_ALERT,
LOG(VB_GENERAL, LOG_ALERT,
QString("MythDialog::AcceptItem(%1) "
"called with negative index").arg(i));
reject();
Expand Down Expand Up @@ -167,7 +167,7 @@ DialogCode MythDialog::exec(void)
{
if (in_loop)
{
LogPrint(VB_GENERAL, LOG_ALERT,
LOG(VB_GENERAL, LOG_ALERT,
"MythDialog::exec: Recursive call detected.");
return kDialogCodeRejected;
}
Expand Down Expand Up @@ -699,7 +699,7 @@ void MythPopupBox::defaultButtonPressedHandler(void)
return;
}

LogPrint(VB_GENERAL, LOG_ALERT, "We should never get here!");
LOG(VB_GENERAL, LOG_ALERT, "We should never get here!");
done(kDialogCodeRejected);
}

Expand Down Expand Up @@ -1190,7 +1190,7 @@ void MythThemedDialog::loadWindow(QDomElement &element)
}
else
{
LogPrint(VB_GENERAL, LOG_ALERT,
LOG(VB_GENERAL, LOG_ALERT,
QString("MythThemedDialog::loadWindow(): Do not "
"understand DOM Element: '%1'. Ignoring.")
.arg(e.tagName()));
Expand All @@ -1213,7 +1213,7 @@ void MythThemedDialog::parseContainer(QDomElement &element)
theme->parseContainer(element, name, a_context, area);
if (name.length() < 1)
{
LogPrint(VB_GENERAL, LOG_ALERT,
LOG(VB_GENERAL, LOG_ALERT,
"Failed to parse a container. Ignoring.");
return;
}
Expand All @@ -1238,7 +1238,7 @@ void MythThemedDialog::parsePopup(QDomElement &element)
// theme doesn't know how to do this yet
//
element = element;
LogPrint(VB_GENERAL, LOG_ALERT,
LOG(VB_GENERAL, LOG_ALERT,
"MythThemedDialog cannot parse popups yet - ignoring");
}

Expand Down Expand Up @@ -1302,7 +1302,7 @@ void MythThemedDialog::updateForeground(const QRect &r)
QRect rect_to_update = r;
if (r.width() == 0 || r.height() == 0)
{
LogPrint(VB_GENERAL, LOG_ALERT, ZeroSizedRect);
LOG(VB_GENERAL, LOG_ALERT, ZeroSizedRect);
rect_to_update = this->geometry();
}

Expand All @@ -1316,7 +1316,7 @@ void MythThemedDialog::ReallyUpdateForeground(const QRect &r)
QRect rect_to_update = r;
if (r.width() == 0 || r.height() == 0)
{
LogPrint(VB_GENERAL, LOG_ALERT, ZeroSizedRect);
LOG(VB_GENERAL, LOG_ALERT, ZeroSizedRect);
rect_to_update = this->geometry();
}

Expand Down Expand Up @@ -1369,7 +1369,7 @@ void MythThemedDialog::UpdateForegroundRect(const QRect &inv_rect)
// Debugging
//
#if 0
LogPrint(VB_GENERAL, LOG_DEBUG,
LOG(VB_GENERAL, LOG_DEBUG,
QString("A container called \"%1\" said its "
"area is %2,%3 to %4,%5")
.arg(looper->GetName())
Expand Down Expand Up @@ -1514,7 +1514,7 @@ void MythThemedDialog::activateCurrent()
}
else
{
LogPrint(VB_GENERAL, LOG_ALERT, "MythThemedDialog::activateCurrent() - "
LOG(VB_GENERAL, LOG_ALERT, "MythThemedDialog::activateCurrent() - "
"there is no current widget!");
}
}
Expand Down
60 changes: 30 additions & 30 deletions mythtv/libs/libmyth/mythmediamonitor.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -97,7 +97,7 @@ void MediaMonitor::SetCDSpeed(const char *device, int speed)
delete cd;
}

LogPrint(VB_MEDIA, LOG_INFO,
LOG(VB_MEDIA, LOG_INFO,
QString("MediaMonitor::setSpeed(%1) - Cannot find/create CDROM?")
.arg(device));
}
Expand Down Expand Up @@ -160,15 +160,15 @@ MythMediaDevice * MediaMonitor::selectDrivePopup(const QString label,

if (drives.count() == 0)
{
LogPrint(VB_MEDIA, LOG_INFO,
LOG(VB_MEDIA, LOG_INFO,
"MediaMonitor::selectDrivePopup(" + label +
") - No suitable devices");
return NULL;
}

if (drives.count() == 1)
{
LogPrint(VB_MEDIA, LOG_INFO,
LOG(VB_MEDIA, LOG_INFO,
"MediaMonitor::selectDrivePopup(" + label +
") - One suitable device");
return drives.front();
Expand Down Expand Up @@ -233,7 +233,7 @@ void MediaMonitor::AttemptEject(MythMediaDevice *device)

if (device->getStatus() == MEDIASTAT_OPEN)
{
LogPrint(VB_MEDIA, LOG_INFO,
LOG(VB_MEDIA, LOG_INFO,
QString("Disk %1's tray is OPEN. Closing tray").arg(dev));

if (device->eject(false) != MEDIAERR_OK)
Expand All @@ -249,7 +249,7 @@ void MediaMonitor::AttemptEject(MythMediaDevice *device)

if (device->isMounted())
{
LogPrint(VB_MEDIA, LOG_INFO,
LOG(VB_MEDIA, LOG_INFO,
QString("Disk %1 is mounted? Unmounting").arg(dev));
device->unmount();

Expand All @@ -260,7 +260,7 @@ void MediaMonitor::AttemptEject(MythMediaDevice *device)
}
}

LogPrint(VB_MEDIA, LOG_INFO,
LOG(VB_MEDIA, LOG_INFO,
QString("Unlocking disk %1, then ejecting").arg(dev));
device->unlock();

Expand Down Expand Up @@ -302,16 +302,16 @@ MediaMonitor::MediaMonitor(QObject* par, unsigned long interval,
m_IgnoreList = QStringList(); // Force empty list

if (m_StartThread)
LogPrint(VB_MEDIA, LOG_NOTICE, "Creating MediaMonitor");
LOG(VB_MEDIA, LOG_NOTICE, "Creating MediaMonitor");
else
#ifdef USING_DARWIN_DA
LogPrint(VB_MEDIA, LOG_INFO,
LOG(VB_MEDIA, LOG_INFO,
"MediaMonitor is disabled. Eject will not work");
#else
LogPrint(VB_MEDIA, LOG_INFO,
LOG(VB_MEDIA, LOG_INFO,
"Creating inactive MediaMonitor and static device list");
#endif
LogPrint(VB_MEDIA, LOG_INFO, "IgnoreDevices=" + ignore);
LOG(VB_MEDIA, LOG_INFO, "IgnoreDevices=" + ignore);

// If any of IgnoreDevices are symlinks, also add the real device
QStringList::Iterator dev;
Expand All @@ -325,7 +325,7 @@ MediaMonitor::MediaMonitor(QObject* par, unsigned long interval,

if (m_IgnoreList.filter(target).isEmpty())
{
LogPrint(VB_MEDIA, LOG_INFO,
LOG(VB_MEDIA, LOG_INFO,
"Also ignoring " + target + " (symlinked from " +
*dev + ").");
m_IgnoreList += target;
Expand Down Expand Up @@ -420,7 +420,7 @@ void MediaMonitor::StartMonitoring(void)

qRegisterMetaType<MythMediaStatus>("MythMediaStatus");

LogPrint(VB_MEDIA, LOG_NOTICE, "Starting MediaMonitor");
LOG(VB_MEDIA, LOG_NOTICE, "Starting MediaMonitor");
m_Active = true;
m_Thread->start();
}
Expand All @@ -434,7 +434,7 @@ void MediaMonitor::StopMonitoring(void)
if (!m_Active)
return;

LogPrint(VB_MEDIA, LOG_NOTICE, "Stopping MediaMonitor");
LOG(VB_MEDIA, LOG_NOTICE, "Stopping MediaMonitor");
m_Active = false;
m_Thread->wait();
}
Expand Down Expand Up @@ -534,7 +534,7 @@ QString MediaMonitor::GetMountPath(const QString& devPath)
if (pMedia && pMedia->findMountPath())
mountPath = pMedia->getMountPath();
else
LogPrint(VB_MEDIA, LOG_INFO,
LOG(VB_MEDIA, LOG_INFO,
"MediaMonitor::GetMountPath() - failed");
// need some way to delete the media device.
}
Expand Down Expand Up @@ -588,7 +588,7 @@ QList<MythMediaDevice*> MediaMonitor::GetMedias(MythMediaType mediatype)
void MediaMonitor::MonitorRegisterExtensions(uint mediatype,
const QString &extensions)
{
LogPrint(VB_GENERAL, LOG_DEBUG,
LOG(VB_GENERAL, LOG_DEBUG,
QString("MonitorRegisterExtensions(0x%1, %2)")
.arg(mediatype, 0, 16).arg(extensions));

Expand Down Expand Up @@ -616,7 +616,7 @@ void MediaMonitor::RegisterMediaHandler(const QString &destination,
if (extensions.length())
msg += QString(", ext(%1)").arg(extensions);

LogPrint(VB_MEDIA, LOG_INFO,
LOG(VB_MEDIA, LOG_INFO,
"Registering '" + destination + "' as a media handler for " +
msg);

Expand All @@ -627,7 +627,7 @@ void MediaMonitor::RegisterMediaHandler(const QString &destination,
}
else
{
LogPrint(VB_GENERAL, LOG_INFO,
LOG(VB_GENERAL, LOG_INFO,
destination + " is already registered as a media handler.");
}
}
Expand All @@ -648,7 +648,7 @@ void MediaMonitor::JumpToMediaHandler(MythMediaDevice* pMedia)
{
if (((*itr).MythMediaType & (int)pMedia->getMediaType()))
{
LogPrint(VB_GENERAL, LOG_NOTICE,
LOG(VB_GENERAL, LOG_NOTICE,
"Found a handler - '" + itr.key() + "'");
handlers.append(*itr);
}
Expand All @@ -657,7 +657,7 @@ void MediaMonitor::JumpToMediaHandler(MythMediaDevice* pMedia)

if (handlers.empty())
{
LogPrint(VB_MEDIA, LOG_INFO, "No media handler found for event type");
LOG(VB_MEDIA, LOG_INFO, "No media handler found for event type");
return;
}

Expand Down Expand Up @@ -694,7 +694,7 @@ void MediaMonitor::mediaStatusChanged(MythMediaStatus oldStatus,
// Should we ValidateAndLock() first?
QEvent *e = new MythMediaEvent(stat, pMedia);

LogPrint(VB_MEDIA, LOG_INFO, "Posting MediaEvent" + msg);
LOG(VB_MEDIA, LOG_INFO, "Posting MediaEvent" + msg);

// sendEvent() is needed here - it waits for the event to be used.
// postEvent() would result in pDevice's media type changing
Expand All @@ -704,7 +704,7 @@ void MediaMonitor::mediaStatusChanged(MythMediaStatus oldStatus,
delete e;
}
else
LogPrint(VB_MEDIA, LOG_INFO,
LOG(VB_MEDIA, LOG_INFO,
"Media status changed, but not sending event" + msg);


Expand All @@ -724,17 +724,17 @@ bool MediaMonitor::shouldIgnore(const MythMediaDevice* device)
m_IgnoreList.contains(device->getRealDevice())||
m_IgnoreList.contains(device->getDevicePath()) )
{
LogPrint(VB_MEDIA, LOG_INFO,
LOG(VB_MEDIA, LOG_INFO,
"Ignoring device: " + device->getDevicePath());
return true;
}
#if 0
else
{
LogPrint(VB_MEDIA, LOG_DEBUG,
LOG(VB_MEDIA, LOG_DEBUG,
"Not ignoring: " + device->getDevicePath() + " / " +
device->getMountPath());
LogPrint(VB_MEDIA, LOG_DEBUG,
LOG(VB_MEDIA, LOG_DEBUG,
"Paths not in: " + m_IgnoreList.join(", "));
}
#endif
Expand All @@ -754,7 +754,7 @@ bool MediaMonitor::eventFilter(QObject *obj, QEvent *event)

if (!pDev)
{
LogPrint(VB_GENERAL, LOG_ALERT,
LOG(VB_GENERAL, LOG_ALERT,
"MediaMonitor::eventFilter() got a bad media event?");
return true;
}
Expand Down Expand Up @@ -800,7 +800,7 @@ QString MediaMonitor::defaultDevice(QString dbSetting,
{
QString device = gCoreContext->GetSetting(dbSetting);

LogPrint(VB_MEDIA, LOG_DEBUG,
LOG(VB_MEDIA, LOG_DEBUG,
QString("MediaMonitor::defaultDevice(%1,..,%2) dbSetting='%3'")
.arg(dbSetting).arg(hardCodedDefault).arg(device));

Expand All @@ -827,7 +827,7 @@ QString MediaMonitor::defaultDevice(QString dbSetting,
}
}

LogPrint(VB_MEDIA, LOG_DEBUG,
LOG(VB_MEDIA, LOG_DEBUG,
"MediaMonitor::defaultDevice() returning " + device);
return device;
}
Expand Down Expand Up @@ -924,12 +924,12 @@ void MediaMonitor::ejectOpticalDisc()
mon->ChooseAndEjectMedia();
else
{
LogPrint(VB_MEDIA, LOG_INFO, "CD/DVD Monitor isn't enabled.");
LOG(VB_MEDIA, LOG_INFO, "CD/DVD Monitor isn't enabled.");
#ifdef __linux__
LogPrint(VB_MEDIA, LOG_INFO, "Trying Linux 'eject -T' command");
LOG(VB_MEDIA, LOG_INFO, "Trying Linux 'eject -T' command");
myth_system("eject -T");
#elif CONFIG_DARWIN
LogPrint(VB_MEDIA, LOG_INFO, "Trying 'disktool -e disk1");
LOG(VB_MEDIA, LOG_INFO, "Trying 'disktool -e disk1");
myth_system("disktool -e disk1");
#endif
}
Expand Down
14 changes: 7 additions & 7 deletions mythtv/libs/libmyth/mythplugin.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ int MythPlugin::init(const char *libversion)
error_msg = dlerror();
}

LogPrint(VB_GENERAL, LOG_EMERG, QString("MythPlugin::init() dlerror: %1")
LOG(VB_GENERAL, LOG_EMERG, QString("MythPlugin::init() dlerror: %1")
.arg(error_msg));

return -1;
Expand Down Expand Up @@ -144,7 +144,7 @@ MythPluginManager::MythPluginManager()

QStringList libraries = filterDir.entryList();
if (libraries.isEmpty())
LogPrint(VB_GENERAL, LOG_WARNING,
LOG(VB_GENERAL, LOG_WARNING,
"No libraries in plugins directory " + filterDir.path());

for (QStringList::iterator i = libraries.begin(); i != libraries.end();
Expand All @@ -160,7 +160,7 @@ MythPluginManager::MythPluginManager()
}
}
else
LogPrint(VB_GENERAL, LOG_WARNING,
LOG(VB_GENERAL, LOG_WARNING,
"No plugins directory " + filterDir.path());

gContext->SetDisableLibraryPopup(false);
Expand All @@ -187,7 +187,7 @@ bool MythPluginManager::init_plugin(const QString &plugname)
{
delete m_dict[newname];
m_dict.remove(newname);
LogPrint(VB_GENERAL, LOG_ERR,
LOG(VB_GENERAL, LOG_ERR,
QString("Unable to initialize plugin '%1'.") .arg(plugname));
return false;
}
Expand Down Expand Up @@ -215,7 +215,7 @@ bool MythPluginManager::run_plugin(const QString &plugname)

if (!m_dict[newname] && !init_plugin(plugname))
{
LogPrint(VB_GENERAL, LOG_ALERT,
LOG(VB_GENERAL, LOG_ALERT,
QString("Unable to run plugin '%1': not initialized")
.arg(plugname));
return true;
Expand All @@ -233,7 +233,7 @@ bool MythPluginManager::config_plugin(const QString &plugname)

if (!m_dict[newname] && !init_plugin(plugname))
{
LogPrint(VB_GENERAL, LOG_ALERT,
LOG(VB_GENERAL, LOG_ALERT,
QString("Unable to configure plugin '%1': not initialized")
.arg(plugname));
return true;
Expand All @@ -250,7 +250,7 @@ bool MythPluginManager::destroy_plugin(const QString &plugname)

if (!m_dict[newname] && !init_plugin(plugname))
{
LogPrint(VB_GENERAL, LOG_ALERT,
LOG(VB_GENERAL, LOG_ALERT,
QString("Unable to destroy plugin '%1': not initialized")
.arg(plugname));
return false;
Expand Down
6 changes: 3 additions & 3 deletions mythtv/libs/libmyth/mythrssmanager.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ void RSSManager::doUpdate()
for (RSSSite::rssList::iterator i = m_sites.begin();
i != m_sites.end(); ++i)
{
LogPrint(VB_GENERAL, LOG_INFO,
LOG(VB_GENERAL, LOG_INFO,
QString("Updating RSS Feed %1") .arg((*i)->GetTitle()));

connect(*i, SIGNAL(finished(RSSSite*)),
Expand Down Expand Up @@ -220,7 +220,7 @@ void RSSSite::process(void)

if (!domDoc.setContent(m_data, true))
{
LogPrint(VB_GENERAL, LOG_ERR,
LOG(VB_GENERAL, LOG_ERR,
"Failed to set content from downloaded XML");
return;
}
Expand Down Expand Up @@ -257,7 +257,7 @@ void RSSSite::process(void)
}
else
{
LogPrint(VB_GENERAL, LOG_ERR, "Data is not valid RSS-feed");
LOG(VB_GENERAL, LOG_ERR, "Data is not valid RSS-feed");
emit finished(this);
}
}
6 changes: 3 additions & 3 deletions mythtv/libs/libmyth/mythwidgets.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -676,7 +676,7 @@ void MythRemoteLineEdit::startCycle(QString current_choice, QString set)
{
if (active_cycle)
{
LogPrint(VB_GENERAL, LOG_ALERT,
LOG(VB_GENERAL, LOG_ALERT,
"startCycle() called, but edit is already in a cycle.");
return;
}
Expand Down Expand Up @@ -746,7 +746,7 @@ void MythRemoteLineEdit::updateCycle(QString current_choice, QString set)
int length = set.length();
if (index < 0 || index > length)
{
LogPrint(VB_GENERAL, LOG_ALERT,
LOG(VB_GENERAL, LOG_ALERT,
QString("MythRemoteLineEdit passed a choice of \"%1"
"\" which is not in set \"%2\"")
.arg(current_choice).arg(set));
Expand Down Expand Up @@ -1008,7 +1008,7 @@ void MythRemoteLineEdit::setCycleTime(float desired_interval)
{
if (desired_interval < 0.5 || desired_interval > 10.0)
{
LogPrint(VB_GENERAL, LOG_ALERT,
LOG(VB_GENERAL, LOG_ALERT,
QString("cycle interval of %1 milliseconds ")
.arg((int) (desired_interval * 1000)) +
"\n\t\t\tis outside of the allowed range of "
Expand Down
18 changes: 9 additions & 9 deletions mythtv/libs/libmyth/netgrabbermanager.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -56,12 +56,12 @@ void GrabberScript::run()
uint status = getTree.Wait();

if( status == GENERIC_EXIT_CMD_NOT_FOUND )
LogPrint(VB_GENERAL, LOG_CRIT,
LOG(VB_GENERAL, LOG_CRIT,
QString("Internet Content Source %1 cannot run, file missing.")
.arg(m_title));
else if( status == GENERIC_EXIT_OK )
{
LogPrint(VB_GENERAL, LOG_INFO,
LOG(VB_GENERAL, LOG_INFO,
QString("Internet Content Source %1 completed download, "
"beginning processing...").arg(m_title));

Expand All @@ -80,12 +80,12 @@ void GrabberScript::run()
channel = channel.nextSiblingElement("channel");
}
markTreeUpdated(this, QDateTime::currentDateTime());
LogPrint(VB_GENERAL, LOG_INFO,
LOG(VB_GENERAL, LOG_INFO,
QString("Internet Content Source %1 completed processing, "
"marking as updated.").arg(m_title));
}
else
LogPrint(VB_GENERAL, LOG_ERR,
LOG(VB_GENERAL, LOG_ERR,
QString("Internet Content Source %1 crashed while grabbing "
"tree.").arg(m_title));

Expand Down Expand Up @@ -228,7 +228,7 @@ void GrabberDownloadThread::run()
GrabberScript *script = m_scripts.takeFirst();
if (script && (needsUpdate(script, updateFreq) || m_refreshAll))
{
LogPrint(VB_GENERAL, LOG_INFO,
LOG(VB_GENERAL, LOG_INFO,
QString("Internet Content Source %1 Updating...")
.arg(script->GetTitle()));
script->run();
Expand Down Expand Up @@ -261,7 +261,7 @@ void Search::executeSearch(const QString &script, const QString &query, uint pag
{
resetSearch();

LogPrint(VB_GENERAL, LOG_DEBUG, "Search::executeSearch");
LOG(VB_GENERAL, LOG_DEBUG, "Search::executeSearch");
m_searchProcess = new MythSystem();

connect(m_searchProcess, SIGNAL(finished()),
Expand All @@ -283,7 +283,7 @@ void Search::executeSearch(const QString &script, const QString &query, uint pag
QString term = query;
args.append(ShellEscape(term));

LogPrint(VB_GENERAL, LOG_DEBUG, QString("Internet Search Query: %1 %2")
LOG(VB_GENERAL, LOG_DEBUG, QString("Internet Search Query: %1 %2")
.arg(cmd).arg(args.join(" ")));

uint flags = kMSRunShell | kMSStdOut | kMSBuffered | kMSRunBackground;
Expand Down Expand Up @@ -358,7 +358,7 @@ void Search::slotProcessSearchExit(uint exitcode)
{
if (exitcode == GENERIC_EXIT_TIMEOUT)
{
LogPrint(VB_GENERAL, LOG_WARNING, "Internet Search Timeout");
LOG(VB_GENERAL, LOG_WARNING, "Internet Search Timeout");

if (m_searchProcess)
{
Expand All @@ -376,7 +376,7 @@ void Search::slotProcessSearchExit(uint exitcode)
}
else
{
LogPrint(VB_GENERAL, LOG_INFO,
LOG(VB_GENERAL, LOG_INFO,
"Internet Search Successfully Completed");

m_data = m_searchProcess->ReadAll();
Expand Down
38 changes: 19 additions & 19 deletions mythtv/libs/libmyth/programinfo.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1164,7 +1164,7 @@ void ProgramInfo::ToStringList(QStringList &list) const

#define NEXT_STR() do { if (it == listend) \
{ \
LogPrint(VB_GENERAL, LOG_ERR, listerror); \
LOG(VB_GENERAL, LOG_ERR, listerror); \
clear(); \
return false; \
} \
Expand Down Expand Up @@ -1657,7 +1657,7 @@ bool ProgramInfo::LoadProgramFromRecorded(
{
if (is_reload)
{
LogPrint(VB_FILE, LOG_INFO,
LOG(VB_FILE, LOG_INFO,
QString("Updated pathname '%1':'%2' -> '%3'")
.arg(pathname).arg(GetBasename()).arg(new_basename));
}
Expand Down Expand Up @@ -1910,7 +1910,7 @@ void ProgramInfo::SetAvailableStatus(
{
if (status != availableStatus)
{
LogPrint(VB_GUI, LOG_INFO,
LOG(VB_GUI, LOG_INFO,
toString(kTitleSubtitle) + QString(": %1 -> %2")
.arg(::toString((AvailableStatusType)availableStatus))
.arg(::toString(status)));
Expand Down Expand Up @@ -1976,7 +1976,7 @@ QString ProgramInfo::QueryBasename(void) const
}
else
{
LogPrint(VB_GENERAL, LOG_INFO,
LOG(VB_GENERAL, LOG_INFO,
QString("QueryBasename found no entry for %1 @ %2")
.arg(chanid).arg(recstartts.toString(Qt::ISODate)));
}
Expand Down Expand Up @@ -2039,21 +2039,21 @@ QString ProgramInfo::GetPlaybackURL(
// Check to see if the file exists locally
StorageGroup sgroup(storagegroup);
#if 0
LogPrint(VB_FILE, LOG_DEBUG,
LOG(VB_FILE, LOG_DEBUG,
QString("GetPlaybackURL: CHECKING SG : %1 : ").arg(tmpURL));
#endif
tmpURL = sgroup.FindFile(basename);

if (!tmpURL.isEmpty())
{
LogPrint(VB_FILE, LOG_INFO,
LOG(VB_FILE, LOG_INFO,
QString("GetPlaybackURL: File is local: '%1'")
.arg(tmpURL));
return tmpURL;
}
else if (hostname == gCoreContext->GetHostName())
{
LogPrint(VB_GENERAL, LOG_ERR,
LOG(VB_GENERAL, LOG_ERR,
QString("GetPlaybackURL: '%1' should be local, but it can "
"not be found.").arg(basename));
// Note do not preceed with "/" that will cause existing code
Expand All @@ -2072,7 +2072,7 @@ QString ProgramInfo::GetPlaybackURL(
gCoreContext->GetSetting("MasterServerPort").toInt(),
basename);

LogPrint(VB_FILE, LOG_INFO,
LOG(VB_FILE, LOG_INFO,
QString("GetPlaybackURL: Found @ '%1'").arg(tmpURL));
return tmpURL;
}
Expand All @@ -2082,7 +2082,7 @@ QString ProgramInfo::GetPlaybackURL(
gCoreContext->GetSettingOnHost("BackendServerPort", hostname).toInt(),
basename);

LogPrint(VB_FILE, LOG_INFO,
LOG(VB_FILE, LOG_INFO,
QString("GetPlaybackURL: Using default of: '%1'")
.arg(tmpURL));

Expand Down Expand Up @@ -3552,7 +3552,7 @@ QString ProgramInfo::ChannelText(const QString &format) const
void ProgramInfo::UpdateInUseMark(bool force)
{
#ifdef DEBUG_IN_USE
LogPrint(VB_GENERAL, LOG_DEBUG, QString("UpdateInUseMark(%1) '%2'")
LOG(VB_GENERAL, LOG_DEBUG, QString("UpdateInUseMark(%1) '%2'")
.arg(force?"force":"no force").arg(inUseForWhat));
#endif

Expand Down Expand Up @@ -3715,14 +3715,14 @@ void ProgramInfo::MarkAsInUse(bool inuse, QString usedFor)
#ifdef DEBUG_IN_USE
if (!inUseForWhat.isEmpty())
{
LogPrint(VB_GENERAL, LOG_INFO,
LOG(VB_GENERAL, LOG_INFO,
QString("MarkAsInUse(true, '%1'->'%2')")
.arg(inUseForWhat).arg(usedFor) +
" -- use has changed");
}
else
{
LogPrint(VB_GENERAL, LOG_INFO,
LOG(VB_GENERAL, LOG_INFO,
QString("MarkAsInUse(true, ''->'%1')").arg(usedFor));
}
#endif // DEBUG_IN_USE
Expand All @@ -3734,7 +3734,7 @@ void ProgramInfo::MarkAsInUse(bool inuse, QString usedFor)
QString oldInUseForWhat = inUseForWhat;
inUseForWhat = QString("%1 [%2]")
.arg(QObject::tr("Unknown")).arg(getpid());
LogPrint(VB_GENERAL, LOG_WARNING,
LOG(VB_GENERAL, LOG_WARNING,
QString("MarkAsInUse(true, ''->'%1')").arg(inUseForWhat) +
" -- use was not explicitly set");
}
Expand All @@ -3744,15 +3744,15 @@ void ProgramInfo::MarkAsInUse(bool inuse, QString usedFor)

if (!inuse && !inUseForWhat.isEmpty() && usedFor != inUseForWhat)
{
LogPrint(VB_GENERAL, LOG_WARNING,
LOG(VB_GENERAL, LOG_WARNING,
QString("MarkAsInUse(false, '%1'->'%2')")
.arg(inUseForWhat).arg(usedFor) +
" -- use has changed since first setting as in use.");
}
#ifdef DEBUG_IN_USE
else if (!inuse)
{
LogPrint(VB_GENERAL, LOG_DEBUG, QString("MarkAsInUse(false, '%1')")
LOG(VB_GENERAL, LOG_DEBUG, QString("MarkAsInUse(false, '%1')")
.arg(inUseForWhat));
}
#endif // DEBUG_IN_USE
Expand All @@ -3762,7 +3762,7 @@ void ProgramInfo::MarkAsInUse(bool inuse, QString usedFor)

if (!inuse && inUseForWhat.isEmpty())
{
LogPrint(VB_GENERAL, LOG_WARNING,
LOG(VB_GENERAL, LOG_WARNING,
"MarkAsInUse requires a key to delete in use mark");
return; // can't delete if we don't have a key
}
Expand Down Expand Up @@ -3812,7 +3812,7 @@ void ProgramInfo::MarkAsInUse(bool inuse, QString usedFor)
}
else if (!query.next())
{
LogPrint(VB_GENERAL, LOG_ERR, "MarkAsInUse -- select query failed");
LOG(VB_GENERAL, LOG_ERR, "MarkAsInUse -- select query failed");
}
else if (query.value(0).toUInt())
{
Expand Down Expand Up @@ -4120,7 +4120,7 @@ QStringList ProgramInfo::LoadFromScheduler(
QStringList slist;
if (gCoreContext->IsBackend())
{
LogPrint(VB_GENERAL, LOG_ALERT,
LOG(VB_GENERAL, LOG_ALERT,
"LoadFromScheduler(): Error, called from backend.");
return slist;
}
Expand All @@ -4132,7 +4132,7 @@ QStringList ProgramInfo::LoadFromScheduler(

if (!gCoreContext->SendReceiveStringList(slist) || slist.size() < 2)
{
LogPrint(VB_GENERAL, LOG_ALERT,
LOG(VB_GENERAL, LOG_ALERT,
"LoadFromScheduler(): Error querying master.");
slist.clear();
}
Expand Down
2 changes: 1 addition & 1 deletion mythtv/libs/libmyth/rawsettingseditor.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ bool RawSettingsEditor::Create(void)

if (!m_settingsList || !m_textLabel || !m_saveButton || !m_cancelButton)
{
LogPrint(VB_GENERAL, LOG_EMERG,
LOG(VB_GENERAL, LOG_EMERG,
"Theme is missing critical theme elements.");
return false;
}
Expand Down
20 changes: 10 additions & 10 deletions mythtv/libs/libmyth/remoteutil.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -136,7 +136,7 @@ bool RemoteDeleteRecording(

if (!result)
{
LogPrint(VB_GENERAL, LOG_ALERT,
LOG(VB_GENERAL, LOG_ALERT,
QString("Failed to delete recording %1:%2")
.arg(chanid).arg(recstartts.toString(Qt::ISODate)));
}
Expand Down Expand Up @@ -190,7 +190,7 @@ uint RemoteGetRecordingList(

if (numrecordings * NUMPROGRAMLINES + 1 > (int)strList.size())
{
LogPrint(VB_GENERAL, LOG_ERR,
LOG(VB_GENERAL, LOG_ERR,
"RemoteGetRecordingList() list size appears to be incorrect.");
return 0;
}
Expand Down Expand Up @@ -301,15 +301,15 @@ QDateTime RemoteGetPreviewIfModified(
if (!gCoreContext->SendReceiveStringList(strlist) ||
strlist.empty() || strlist[0] == "ERROR")
{
LogPrint(VB_GENERAL, LOG_ERR, "Remote error" +
LOG(VB_GENERAL, LOG_ERR, "Remote error" +
((strlist.size() >= 2) ? (":\n\t\t\t" + strlist[1]) : ""));

return QDateTime();
}

if (strlist[0] == "WARNING")
{
LogPrint(VB_NETWORK, LOG_WARNING, "Remote warning" +
LOG(VB_NETWORK, LOG_WARNING, "Remote warning" +
((strlist.size() >= 2) ? (":\n\t\t\t" + strlist[1]) : ""));

return QDateTime();
Expand All @@ -330,7 +330,7 @@ QDateTime RemoteGetPreviewIfModified(
QByteArray data = QByteArray::fromBase64(strlist[3].toAscii());
if ((size_t) data.size() < length)
{ // (note data.size() may be up to 3 bytes longer after decoding
LogPrint(VB_GENERAL, LOG_ERR,
LOG(VB_GENERAL, LOG_ERR,
QString("Preview size check failed %1 < %2")
.arg(data.size()).arg(length));
return QDateTime();
Expand All @@ -339,15 +339,15 @@ QDateTime RemoteGetPreviewIfModified(

if (checksum16 != qChecksum(data.constData(), data.size()))
{
LogPrint(VB_GENERAL, LOG_ERR, "Preview checksum failed");
LOG(VB_GENERAL, LOG_ERR, "Preview checksum failed");
return QDateTime();
}

QString pdir(cachefile.section("/", 0, -2));
QDir cfd(pdir);
if (!cfd.exists() && !cfd.mkdir(pdir))
{
LogPrint(VB_GENERAL, LOG_ERR,
LOG(VB_GENERAL, LOG_ERR,
QString("Unable to create remote cache directory '%1'")
.arg(pdir));

Expand All @@ -357,7 +357,7 @@ QDateTime RemoteGetPreviewIfModified(
QFile file(cachefile);
if (!file.open(QIODevice::WriteOnly|QIODevice::Truncate))
{
LogPrint(VB_GENERAL, LOG_ERR,
LOG(VB_GENERAL, LOG_ERR,
QString("Unable to open cached preview file for writing '%1'")
.arg(cachefile));

Expand All @@ -384,7 +384,7 @@ QDateTime RemoteGetPreviewIfModified(

if (remaining)
{
LogPrint(VB_GENERAL, LOG_ERR,
LOG(VB_GENERAL, LOG_ERR,
QString("Failed to write cached preview file '%1'")
.arg(cachefile));

Expand Down Expand Up @@ -483,7 +483,7 @@ int RemoteGetFreeRecorderCount(void)

if (strlist[0] == "UNKNOWN_COMMAND")
{
LogPrint(VB_GENERAL, LOG_EMERG,
LOG(VB_GENERAL, LOG_EMERG,
"Unknown command GET_FREE_RECORDER_COUNT, upgrade your "
"backend version.");
return 0;
Expand Down
2 changes: 1 addition & 1 deletion mythtv/libs/libmyth/rssparse.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -711,7 +711,7 @@ ResultItem::resultList Parse::parseRSS(QDomDocument domDoc)
ResultItem::resultList vList;

QString document = domDoc.toString();
LogPrint(VB_GENERAL, LOG_DEBUG, "Will Be Parsing: " + document);
LOG(VB_GENERAL, LOG_DEBUG, "Will Be Parsing: " + document);

QDomElement root = domDoc.documentElement();
QDomElement channel = root.firstChildElement("channel");
Expand Down
28 changes: 14 additions & 14 deletions mythtv/libs/libmyth/schemawizard.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,7 @@ MythDBBackupStatus SchemaUpgradeWizard::BackupDB(void)
{
if (emptyDB)
{
LogPrint(VB_GENERAL, LOG_INFO,
LOG(VB_GENERAL, LOG_INFO,
"The database seems to be empty - not attempting a backup");
return kDB_Backup_Empty_DB;
}
Expand All @@ -104,16 +104,16 @@ int SchemaUpgradeWizard::Compare(void)
// No current schema? Investigate further:
if (DBver.isEmpty() || DBver == "0")
{
LogPrint(VB_GENERAL, LOG_INFO, "No current database version?");
LOG(VB_GENERAL, LOG_INFO, "No current database version?");

if (DBUtil::IsNewDatabase())
{
LogPrint(VB_GENERAL, LOG_INFO, "Database appears to be empty/new!");
LOG(VB_GENERAL, LOG_INFO, "Database appears to be empty/new!");
emptyDB = true;
}
}
else
LogPrint(VB_GENERAL, LOG_INFO,
LOG(VB_GENERAL, LOG_INFO,
QString("Current %1 Schema Version (%2): %3")
.arg(m_schemaName).arg(m_schemaSetting).arg(DBver));

Expand All @@ -133,7 +133,7 @@ int SchemaUpgradeWizard::CompareAndWait(const int seconds)
QString message = tr("%1 database schema is old. Waiting to see if DB "
"is being upgraded.").arg(m_schemaName);

LogPrint(VB_GENERAL, LOG_CRIT, message);
LOG(VB_GENERAL, LOG_CRIT, message);

MSqlQuery query(MSqlQuery::InitCon());
bool backupRunning = false;
Expand All @@ -147,7 +147,7 @@ int SchemaUpgradeWizard::CompareAndWait(const int seconds)

if (IsBackupInProgress())
{
LogPrint(VB_GENERAL, LOG_CRIT,
LOG(VB_GENERAL, LOG_CRIT,
"Waiting for Database Backup to complete.");
if (!backupRunning)
{
Expand All @@ -159,7 +159,7 @@ int SchemaUpgradeWizard::CompareAndWait(const int seconds)

if (!lockSchema(query))
{
LogPrint(VB_GENERAL, LOG_CRIT,
LOG(VB_GENERAL, LOG_CRIT,
"Waiting for Database Upgrade to complete.");
if (!upgradeRunning)
{
Expand All @@ -177,9 +177,9 @@ int SchemaUpgradeWizard::CompareAndWait(const int seconds)
}

if (versionsBehind)
LogPrint(VB_GENERAL, LOG_CRIT, "Timed out waiting.");
LOG(VB_GENERAL, LOG_CRIT, "Timed out waiting.");
else
LogPrint(VB_GENERAL, LOG_CRIT,
LOG(VB_GENERAL, LOG_CRIT,
"Schema version was upgraded while we were waiting.");
}
// else DB is same version, or newer. Either way, we won't upgrade it
Expand Down Expand Up @@ -313,24 +313,24 @@ SchemaUpgradeWizard::PromptForUpgrade(const char *name,

if (!gui && (!isatty(fileno(stdin)) || !isatty(fileno(stdout))))
{
LogPrint(VB_GENERAL, LOG_INFO,
LOG(VB_GENERAL, LOG_INFO,
"Console is non-interactive, can't prompt user...");

if (m_expertMode)
{
LogPrint(VB_GENERAL, LOG_CRIT, "Using existing schema.");
LOG(VB_GENERAL, LOG_CRIT, "Using existing schema.");
return MYTH_SCHEMA_USE_EXISTING;
}

if (!validDBMS)
{
LogPrint(VB_GENERAL, LOG_CRIT, warnOldDBMS);
LOG(VB_GENERAL, LOG_CRIT, warnOldDBMS);
return MYTH_SCHEMA_EXIT;
}

if (versionsBehind < 0)
{
LogPrint(VB_GENERAL, LOG_CRIT,
LOG(VB_GENERAL, LOG_CRIT,
QString("Error: MythTV database has newer %1 schema (%2) "
"than expected (%3).")
.arg(name).arg(DBver).arg(m_newSchemaVer));
Expand All @@ -339,7 +339,7 @@ SchemaUpgradeWizard::PromptForUpgrade(const char *name,

if (upgradeIfNoUI && validDBMS)
{
LogPrint(VB_GENERAL, LOG_CRIT, "Upgrading.");
LOG(VB_GENERAL, LOG_CRIT, "Upgrading.");
return MYTH_SCHEMA_UPGRADE;
}

Expand Down
6 changes: 3 additions & 3 deletions mythtv/libs/libmyth/settings.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ QWidget* Configurable::configWidget(ConfigurationGroup *cg, QWidget* parent,
(void)cg;
(void)parent;
(void)widgetName;
LogPrint(VB_GENERAL, LOG_ALERT,
LOG(VB_GENERAL, LOG_ALERT,
"BUG: Configurable is visible, but has no configWidget");
return NULL;
}
Expand Down Expand Up @@ -199,7 +199,7 @@ void SelectSetting::setValue(int which)
{
if ((which >= ((int) values.size())) || (which < 0))
{
LogPrint(VB_GENERAL, LOG_ERR,
LOG(VB_GENERAL, LOG_ERR,
QString("SelectSetting::setValue(): invalid index: %1 size: ")
.arg(which).arg(values.size()));
}
Expand Down Expand Up @@ -992,7 +992,7 @@ void AutoIncrementDBSetting::Save(QString table)
setValue(lii);
}
else
LogPrint(VB_GENERAL, LOG_EMERG,
LOG(VB_GENERAL, LOG_EMERG,
"Can't determine the Id of the last insert "
"QSqlQuery.lastInsertId() failed, the workaround "
"failed too!");
Expand Down
10 changes: 5 additions & 5 deletions mythtv/libs/libmyth/uilistbtntype.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -245,7 +245,7 @@ void UIListTreeType::SetTree(UIListGenericTree *toplevel)
//

#if 0
LogPrint(VB_GENERAL, LOG_DEBUG, "No top-level children?");
LOG(VB_GENERAL, LOG_DEBUG, "No top-level children?");
#endif
return;
}
Expand All @@ -258,7 +258,7 @@ void UIListTreeType::SetTree(UIListGenericTree *toplevel)

if (!currentlevel)
{
LogPrint(VB_GENERAL, LOG_ALERT,
LOG(VB_GENERAL, LOG_ALERT,
"Something is seriously wrong (currentlevel = NULL)");
return;
}
Expand Down Expand Up @@ -462,7 +462,7 @@ UIListBtnType *UIListTreeType::GetLevel(int levelnum)
{
if ((uint)levelnum > (uint)listLevels.size())
{
LogPrint(VB_GENERAL, LOG_ERR, "OOB GetLevel call");
LOG(VB_GENERAL, LOG_ERR, "OOB GetLevel call");
return NULL;
}

Expand Down Expand Up @@ -739,7 +739,7 @@ bool UIListTreeType::tryToSetCurrent(QStringList route)
currentpos = (UIListGenericTree *)next_child;
if (!currentlevel->MoveToNamedPosition(currentpos->getString()))
{
LogPrint(VB_GENERAL, LOG_CRIT,
LOG(VB_GENERAL, LOG_CRIT,
"had problem finding something it knows is there");
keep_going = false;
}
Expand Down Expand Up @@ -1420,7 +1420,7 @@ bool UIListBtnType::MoveItemUpDown(UIListBtnTypeItem *item, bool flag)

if (item != m_selItem)
{
LogPrint(VB_GENERAL, LOG_ERR, "Can't move non-selected item");
LOG(VB_GENERAL, LOG_ERR, "Can't move non-selected item");
return false;
}

Expand Down
76 changes: 38 additions & 38 deletions mythtv/libs/libmyth/uitypes.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,7 @@ void LayerSet::Draw(QPainter *dr, int drawlayer, int context)
for (; i != allTypes->end(); i++)
{
if (m_debug)
LogPrint(VB_GENERAL, LOG_DEBUG, "-LayerSet::Draw");
LOG(VB_GENERAL, LOG_DEBUG, "-LayerSet::Draw");
UIType *type = (*i);
type->Draw(dr, drawlayer, context);
}
Expand All @@ -99,7 +99,7 @@ void LayerSet::DrawRegion(QPainter *dr, QRect &area, int drawlayer, int context)
for (; i != allTypes->end(); i++)
{
if (m_debug)
LogPrint(VB_GENERAL, LOG_DEBUG, "-LayerSet::DrawRegion");
LOG(VB_GENERAL, LOG_DEBUG, "-LayerSet::DrawRegion");
UIType *type = (*i);
type->DrawRegion(dr, area, drawlayer, context);
}
Expand Down Expand Up @@ -402,7 +402,7 @@ void UIListType::Draw(QPainter *dr, int drawlayer, int context)
int tempArrows = 0;

if (m_debug)
LogPrint(VB_GENERAL, LOG_DEBUG,
LOG(VB_GENERAL, LOG_DEBUG,
" +UIListType::Draw() <- within Layer");

for (int i = 0; i < m_count; i++)
Expand Down Expand Up @@ -434,7 +434,7 @@ void UIListType::Draw(QPainter *dr, int drawlayer, int context)

if (m_debug)
{
LogPrint(VB_GENERAL, LOG_DEBUG,
LOG(VB_GENERAL, LOG_DEBUG,
QString(" -Column #%1, Column Context: %2, "
"Draw Context: %3")
.arg(j) .arg(columnContext[j]) .arg(context));
Expand Down Expand Up @@ -506,7 +506,7 @@ void UIListType::Draw(QPainter *dr, int drawlayer, int context)
m_justification, tempWrite);
dr->setFont(tmpfont->face);
if (m_debug)
LogPrint(VB_GENERAL, LOG_DEBUG,
LOG(VB_GENERAL, LOG_DEBUG,
" +UIListType::Draw() Data: " + tempWrite);
lastShown = true;
}
Expand Down Expand Up @@ -560,7 +560,7 @@ void UIListType::Draw(QPainter *dr, int drawlayer, int context)

if (m_debug)
{
LogPrint(VB_GENERAL, LOG_DEBUG,
LOG(VB_GENERAL, LOG_DEBUG,
QString(" -Column #%1, Column Context: %2, "
"Draw Context: %3")
.arg(j) .arg(columnContext[j]) .arg(context));
Expand Down Expand Up @@ -631,7 +631,7 @@ void UIListType::Draw(QPainter *dr, int drawlayer, int context)
else
{
if (m_debug)
LogPrint(VB_GENERAL, LOG_DEBUG,
LOG(VB_GENERAL, LOG_DEBUG,
QString(" +UIListType::Draw() <- outside "
"(layer = %1, widget layer = %2)")
.arg(drawlayer) .arg(m_order));
Expand Down Expand Up @@ -767,14 +767,14 @@ void UIImageType::LoadImage()

if (!GetMythUI()->FindThemeFile(file))
{
LogPrint(VB_GENERAL, LOG_CRIT,
LOG(VB_GENERAL, LOG_CRIT,
"UIImageType::LoadImage() - Cannot find image: " + m_filename);
m_show = false;
return;
}

if (m_debug)
LogPrint(VB_GENERAL, LOG_DEBUG,
LOG(VB_GENERAL, LOG_DEBUG,
QString(" -Filename: %1").arg(file));

if (m_hmult == 1 && m_wmult == 1 && m_force_x == -1 && m_force_y == -1)
Expand All @@ -794,14 +794,14 @@ void UIImageType::LoadImage()
{
doX = m_force_x;
if (m_debug)
LogPrint(VB_GENERAL, LOG_DEBUG,
LOG(VB_GENERAL, LOG_DEBUG,
QString(" +Force X: %1") .arg(doX));
}
if (m_force_y != -1)
{
doY = m_force_y;
if (m_debug)
LogPrint(VB_GENERAL, LOG_DEBUG,
LOG(VB_GENERAL, LOG_DEBUG,
QString(" +Force Y: %1") .arg(doY));
}

Expand All @@ -812,14 +812,14 @@ void UIImageType::LoadImage()
m_show = true;
img = QPixmap::fromImage(scalerImg);
if (m_debug)
LogPrint(VB_GENERAL, LOG_DEBUG,
LOG(VB_GENERAL, LOG_DEBUG,
QString(" -Image: %1 loaded.") .arg(file));
}
else
{
m_show = false;
if (m_debug)
LogPrint(VB_GENERAL, LOG_DEBUG,
LOG(VB_GENERAL, LOG_DEBUG,
QString(" -Image: %1 failed to load.") .arg(file));
}
delete sourceImg;
Expand Down Expand Up @@ -847,12 +847,12 @@ void UIImageType::Draw(QPainter *dr, int drawlayer, int context)
{
if (m_debug)
{
LogPrint(VB_GENERAL, LOG_DEBUG,
LOG(VB_GENERAL, LOG_DEBUG,
" +UIImageType::Draw() <- inside Layer");
LogPrint(VB_GENERAL, LOG_DEBUG,
LOG(VB_GENERAL, LOG_DEBUG,
QString(" -Drawing @ (%1, %2)")
.arg(m_displaypos.x()) .arg(m_displaypos.y()));
LogPrint(VB_GENERAL, LOG_DEBUG,
LOG(VB_GENERAL, LOG_DEBUG,
QString(" -Skip Section: (%1, %2)")
.arg(m_drop_x) .arg(m_drop_y));
}
Expand All @@ -861,14 +861,14 @@ void UIImageType::Draw(QPainter *dr, int drawlayer, int context)
}
else if (m_debug)
{
LogPrint(VB_GENERAL, LOG_DEBUG,
LOG(VB_GENERAL, LOG_DEBUG,
" +UIImageType::Draw() <= Image is null");
}
}
}
else if (m_debug)
{
LogPrint(VB_GENERAL, LOG_DEBUG,
LOG(VB_GENERAL, LOG_DEBUG,
QString(" +UIImageType::Draw() <- outside "
"(layer = %1, widget layer = %2)")
.arg(drawlayer) .arg(m_order));
Expand Down Expand Up @@ -934,12 +934,12 @@ void UIRepeatedImageType::Draw(QPainter *p, int drawlayer, int context)
{
if (m_debug)
{
LogPrint(VB_GENERAL, LOG_DEBUG,
LOG(VB_GENERAL, LOG_DEBUG,
" +UIRepeatedImageType::Draw() <- inside Layer");
LogPrint(VB_GENERAL, LOG_DEBUG,
LOG(VB_GENERAL, LOG_DEBUG,
QString(" -Drawing @ (%1, %2)")
.arg(m_displaypos.x()) .arg(m_displaypos.y()));
LogPrint(VB_GENERAL, LOG_DEBUG,
LOG(VB_GENERAL, LOG_DEBUG,
QString(" -Skip Section: (%1, %2)")
.arg(m_drop_x) .arg(m_drop_y));
}
Expand Down Expand Up @@ -982,7 +982,7 @@ void UIRepeatedImageType::Draw(QPainter *p, int drawlayer, int context)
}
else if (m_debug)
{
LogPrint(VB_GENERAL, LOG_DEBUG,
LOG(VB_GENERAL, LOG_DEBUG,
" +UIImageType::Draw() <= Image is null");
}
}
Expand All @@ -992,7 +992,7 @@ void UIRepeatedImageType::Draw(QPainter *p, int drawlayer, int context)
{
if (m_debug)
{
LogPrint(VB_GENERAL, LOG_DEBUG,
LOG(VB_GENERAL, LOG_DEBUG,
QString(" +UIImageType::Draw() <- outside "
"(layer = %1, widget layer = %2)")
.arg(drawlayer) .arg(m_order));
Expand All @@ -1017,7 +1017,7 @@ void UIRepeatedImageType::setOrientation(int x)
{
if (x < 0 || x > 3)
{
LogPrint(VB_GENERAL, LOG_CRIT,
LOG(VB_GENERAL, LOG_CRIT,
QString("UIRepeatedImageType received an invalid "
"request to set orientation to %1") .arg(x));
return;
Expand Down Expand Up @@ -1603,7 +1603,7 @@ QPixmap *UIImageGridType::createScaledPixmap(QString filename,
QImage *img = GetMythUI()->LoadScaleImage(filename);
if (!img)
{
LogPrint(VB_GENERAL, LOG_CRIT, "Failed to load image" + filename);
LOG(VB_GENERAL, LOG_CRIT, "Failed to load image" + filename);
return NULL;
}
else
Expand Down Expand Up @@ -1729,14 +1729,14 @@ void UITextType::Draw(QPainter *dr, int drawlayer, int context)
m_displaysize.width(), m_displaysize.height());
}
if (m_cutdown && m_debug)
LogPrint(VB_GENERAL, LOG_DEBUG,
LOG(VB_GENERAL, LOG_DEBUG,
" +UITextType::CutDown Called.");

if (drawFontShadow && (fontdrop.x() != 0 || fontdrop.y() != 0))
{
if (m_debug)
{
LogPrint(VB_GENERAL, LOG_DEBUG,
LOG(VB_GENERAL, LOG_DEBUG,
QString(" +UITextType::Drawing "
"shadow @ (%1, %2)")
.arg((int)(m_displaysize.left() + fontdrop.x()))
Expand All @@ -1756,7 +1756,7 @@ void UITextType::Draw(QPainter *dr, int drawlayer, int context)

if (m_debug)
{
LogPrint(VB_GENERAL, LOG_DEBUG,
LOG(VB_GENERAL, LOG_DEBUG,
QString(" +UITextType::Drawing @ (%1, %2)")
.arg((int)(m_displaysize.left()))
.arg((int)(m_displaysize.top())));
Expand All @@ -1768,16 +1768,16 @@ void UITextType::Draw(QPainter *dr, int drawlayer, int context)

if (m_debug)
{
LogPrint(VB_GENERAL, LOG_DEBUG,
LOG(VB_GENERAL, LOG_DEBUG,
" +UITextType::Draw() <- inside Layer");
LogPrint(VB_GENERAL, LOG_DEBUG,
LOG(VB_GENERAL, LOG_DEBUG,
QString(" -Message: %1 (cut: %2)")
.arg(m_message) .arg(msg));
}
}
else if (m_debug)
{
LogPrint(VB_GENERAL, LOG_DEBUG,
LOG(VB_GENERAL, LOG_DEBUG,
QString(" +UITextType::Draw() <- outside "
"(layer = %1, widget layer = %2)")
.arg(drawlayer) .arg(m_order));
Expand Down Expand Up @@ -1986,7 +1986,7 @@ void UIStatusBarType::Draw(QPainter *dr, int drawlayer, int context)
{
if (m_debug)
{
LogPrint(VB_GENERAL, LOG_DEBUG,
LOG(VB_GENERAL, LOG_DEBUG,
" +UIStatusBarType::Draw() <- within Layer");
}

Expand All @@ -2005,9 +2005,9 @@ void UIStatusBarType::Draw(QPainter *dr, int drawlayer, int context)

if (m_debug)
{
LogPrint(VB_GENERAL, LOG_DEBUG,
LOG(VB_GENERAL, LOG_DEBUG,
QString(" -Width = %1") .arg(width));
LogPrint(VB_GENERAL, LOG_DEBUG,
LOG(VB_GENERAL, LOG_DEBUG,
QString(" -Height = %1") .arg(height));
}

Expand Down Expand Up @@ -2057,7 +2057,7 @@ void UIStatusBarType::setOrientation(int x)
{
if (x < 0 || x > 3)
{
LogPrint(VB_GENERAL, LOG_ERR,
LOG(VB_GENERAL, LOG_ERR,
QString("UIStatusBarType received an invalid "
"request to set orientation to %1") .arg(x));
return;
Expand Down Expand Up @@ -2196,7 +2196,7 @@ void UIManagedTreeListType::Draw(QPainter *p, int drawlayer, int context)
GenericTree *parent = current_node->getParent();
if (parent == NULL)
{
LogPrint(VB_IMPORTANT, LOG_CRIT,
LOG(VB_IMPORTANT, LOG_CRIT,
"LCD sees no parent to current_node" );
}
else
Expand Down Expand Up @@ -2778,7 +2778,7 @@ void UIManagedTreeListType::assignTreeData(GenericTree *a_tree)
}
else
{
LogPrint(VB_GENERAL, LOG_ERR,
LOG(VB_GENERAL, LOG_ERR,
"somebody just assigned me to assign tree data, "
"but they gave me no data");
}
Expand Down Expand Up @@ -4321,7 +4321,7 @@ QString UIKeyType::decodeChar(QString c)
res += QString(uc);
}
else
LogPrint(VB_GENERAL, LOG_CRIT,
LOG(VB_GENERAL, LOG_CRIT,
QString("UIKeyType::decodeChar - bad char code (%1)")
.arg(sCode));
}
Expand Down
10 changes: 5 additions & 5 deletions mythtv/libs/libmyth/virtualkeyboard_qt.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ void VirtualKeyboardQt::SwitchLayout(const QString &lang)
{
if (!m_parentEdit)
{
LogPrint(VB_GENERAL, LOG_ERR, "No edit receiving output");
LOG(VB_GENERAL, LOG_ERR, "No edit receiving output");
reject();
return;
}
Expand All @@ -44,13 +44,13 @@ void VirtualKeyboardQt::SwitchLayout(const QString &lang)

if (!loadThemedWindow("keyboard", theme_file))
{
LogPrint(VB_GENERAL, LOG_WARNING,
LOG(VB_GENERAL, LOG_WARNING,
QString("Cannot find layout for '%1'").arg(language));

// cannot find layout so fallback to US English layout
if (!loadThemedWindow("keyboard", "keyboard/en_us_"))
{
LogPrint(VB_GENERAL, LOG_ERR, "Cannot find layout for US English");
LOG(VB_GENERAL, LOG_ERR, "Cannot find layout for US English");

reject();
return;
Expand All @@ -62,7 +62,7 @@ void VirtualKeyboardQt::SwitchLayout(const QString &lang)

if (!container)
{
LogPrint(VB_GENERAL, LOG_ERR,
LOG(VB_GENERAL, LOG_ERR,
"Cannot find the 'keyboard_container' in your theme");

reject();
Expand Down Expand Up @@ -163,7 +163,7 @@ void VirtualKeyboardQt::SwitchLayout(const QString &lang)
m_keyboard = getUIKeyboardType("keyboard");
if (!m_keyboard)
{
LogPrint(VB_GENERAL, LOG_ERR,
LOG(VB_GENERAL, LOG_ERR,
"Cannot find the UIKeyboardType in your theme");

reject();
Expand Down
310 changes: 155 additions & 155 deletions mythtv/libs/libmyth/xmlparse.cpp

Large diffs are not rendered by default.

28 changes: 14 additions & 14 deletions mythtv/libs/libmythbase/mythlogging.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -161,13 +161,13 @@ FileLogger::FileLogger(char *filename) : LoggerBase(filename, 0),
{
m_opened = true;
m_fd = 1;
LogPrint(VB_IMPORTANT, LOG_INFO, "Added logging to the console");
LOG(VB_IMPORTANT, LOG_INFO, "Added logging to the console");
}
else
{
m_fd = open(filename, O_WRONLY|O_CREAT|O_APPEND, 0664);
m_opened = (m_fd != -1);
LogPrint(VB_IMPORTANT, LOG_INFO, QString("Added logging to %1")
LOG(VB_IMPORTANT, LOG_INFO, QString("Added logging to %1")
.arg(filename));
}
}
Expand All @@ -178,12 +178,12 @@ FileLogger::~FileLogger()
{
if( m_fd != 1 )
{
LogPrint(VB_IMPORTANT, LOG_INFO, QString("Removed logging to %1")
LOG(VB_IMPORTANT, LOG_INFO, QString("Removed logging to %1")
.arg(m_handle.string));
close( m_fd );
}
else
LogPrint(VB_IMPORTANT, LOG_INFO, "Removed logging to the console");
LOG(VB_IMPORTANT, LOG_INFO, "Removed logging to the console");
}
}

Expand All @@ -199,7 +199,7 @@ void FileLogger::reopen(void)

m_fd = open(filename, O_WRONLY|O_CREAT|O_APPEND, 0664);
m_opened = (m_fd != -1);
LogPrint(VB_IMPORTANT, LOG_INFO, QString("Rolled logging on %1")
LOG(VB_IMPORTANT, LOG_INFO, QString("Rolled logging on %1")
.arg(filename));
}

Expand Down Expand Up @@ -256,7 +256,7 @@ bool FileLogger::logmsg(LoggingItem_t *item)

if( result == -1 )
{
LogPrint(VB_IMPORTANT, LOG_UNKNOWN,
LOG(VB_IMPORTANT, LOG_UNKNOWN,
QString("Closed Log output on fd %1 due to errors").arg(m_fd));
m_opened = false;
if( m_fd != 1 )
Expand All @@ -282,13 +282,13 @@ SyslogLogger::SyslogLogger(int facility) : LoggerBase(NULL, facility),
for( name = &facilitynames[0];
name->c_name && name->c_val != facility; name++ );

LogPrint(VB_IMPORTANT, LOG_INFO, QString("Added syslogging to facility %1")
LOG(VB_IMPORTANT, LOG_INFO, QString("Added syslogging to facility %1")
.arg(name->c_name));
}

SyslogLogger::~SyslogLogger()
{
LogPrint(VB_IMPORTANT, LOG_INFO, "Removing syslogging");
LOG(VB_IMPORTANT, LOG_INFO, "Removing syslogging");
free(m_application);
closelog();
}
Expand Down Expand Up @@ -319,7 +319,7 @@ DatabaseLogger::DatabaseLogger(char *table) : LoggerBase(table, 0),
"msgtime, level, message) VALUES (:HOST, :APPLICATION, "
":PID, :THREAD, :MSGTIME, :LEVEL, :MESSAGE)";

LogPrint(VB_IMPORTANT, LOG_INFO,
LOG(VB_IMPORTANT, LOG_INFO,
QString("Added database logging to table %1")
.arg(m_handle.string));

Expand All @@ -342,7 +342,7 @@ DatabaseLogger::DatabaseLogger(char *table) : LoggerBase(table, 0),

DatabaseLogger::~DatabaseLogger()
{
LogPrint(VB_IMPORTANT, LOG_INFO, "Removing database logging");
LOG(VB_IMPORTANT, LOG_INFO, "Removing database logging");

if( m_thread )
{
Expand Down Expand Up @@ -828,7 +828,7 @@ void logStart(QString logfile, int quiet, int facility, LogLevel_t level,
return;

logLevel = level;
LogPrint(VB_IMPORTANT, LOG_CRIT, QString("Setting Log Level to %1")
LOG(VB_IMPORTANT, LOG_CRIT, QString("Setting Log Level to %1")
.arg(LogLevelNames[logLevel]));

logPropagateOpts.propagate = propagate;
Expand Down Expand Up @@ -856,7 +856,7 @@ void logStart(QString logfile, int quiet, int facility, LogLevel_t level,
#ifndef _WIN32
/* Syslog */
if( facility == -1 )
LogPrint(VB_IMPORTANT, LOG_CRIT,
LOG(VB_IMPORTANT, LOG_CRIT,
"Syslogging facility unknown, disabling syslog output");
else if( facility >= 0 )
logger = new SyslogLogger(facility);
Expand All @@ -868,7 +868,7 @@ void logStart(QString logfile, int quiet, int facility, LogLevel_t level,

#ifndef _WIN32
/* Setup SIGHUP */
LogPrint(VB_IMPORTANT, LOG_CRIT, "Setting up SIGHUP handler");
LOG(VB_IMPORTANT, LOG_CRIT, "Setting up SIGHUP handler");
struct sigaction sa;
sa.sa_sigaction = logSighup;
sigemptyset( &sa.sa_mask );
Expand Down Expand Up @@ -968,7 +968,7 @@ void threadDeregister(void)
int syslogGetFacility(QString facility)
{
#ifdef _WIN32
LogPrint(VB_GENERAL, LOG_CRIT, "Windows does not support syslog,"
LOG(VB_GENERAL, LOG_CRIT, "Windows does not support syslog,"
" disabling" );
return( -2 );
#else
Expand Down
8 changes: 4 additions & 4 deletions mythtv/libs/libmythbase/mythlogging.h
Original file line number Diff line number Diff line change
Expand Up @@ -91,11 +91,11 @@ extern "C" {
#endif

#ifdef __cplusplus
#define LogPrint(mask, level, string) \
#define LOG(mask, level, string) \
LogPrintLine(mask, (LogLevel_t)level, __FILE__, __LINE__, __FUNCTION__, \
QString(string).toLocal8Bit().constData())
#else
#define LogPrint(mask, level, format, ...) \
#define LOG(mask, level, format, ...) \
LogPrintLine(mask, (LogLevel_t)level, __FILE__, __LINE__, __FUNCTION__, \
(const char *)format, ##__VA_ARGS__)
#endif
Expand Down Expand Up @@ -240,10 +240,10 @@ extern MBASE_PUBLIC uint64_t verboseMask;

#ifdef __cplusplus
#define VERBOSE(mask, ...) \
LogPrint((uint64_t)(mask), LOG_INFO, QString(__VA_ARGS__))
LOG((uint64_t)(mask), LOG_INFO, QString(__VA_ARGS__))
#else
#define VERBOSE(mask, ...) \
LogPrint((uint64_t)(mask), LOG_INFO, __VA_ARGS__)
LOG((uint64_t)(mask), LOG_INFO, __VA_ARGS__)
#endif


Expand Down