#include "collectd.h"
#include "common.h"
#include "plugin.h"
-#include "utils_debug.h"
#if HAVE_MACH_MACH_TYPES_H
# include <mach/mach_types.h>
kCFStringEncodingASCII);
if (key_obj == NULL)
{
- DBG ("CFStringCreateWithCString (%s) failed.\n", key_string);
+ DEBUG ("CFStringCreateWithCString (%s) failed.\n", key_string);
return (INVALID_VALUE);
}
if ((val_obj = CFDictionaryGetValue (dict, key_obj)) == NULL)
{
- DBG ("CFDictionaryGetValue (%s) failed.", key_string);
+ DEBUG ("CFDictionaryGetValue (%s) failed.", key_string);
CFRelease (key_obj);
return (INVALID_VALUE);
}
}
else
{
- DBG ("CFGetTypeID (val_obj) = %i", (int) CFGetTypeID (val_obj));
+ DEBUG ("CFGetTypeID (val_obj) = %i", (int) CFGetTypeID (val_obj));
return (INVALID_VALUE);
}
ps_array = IOPSCopyPowerSourcesList (ps_raw);
ps_array_len = CFArrayGetCount (ps_array);
- DBG ("ps_array_len == %i", ps_array_len);
+ DEBUG ("ps_array_len == %i", ps_array_len);
for (i = 0; i < ps_array_len; i++)
{
if (ps_dict == NULL)
{
- DBG ("IOPSGetPowerSourceDescription failed.");
+ DEBUG ("IOPSGetPowerSourceDescription failed.");
continue;
}
if (CFGetTypeID (ps_dict) != CFDictionaryGetTypeID ())
{
- DBG ("IOPSGetPowerSourceDescription did not return a CFDictionaryRef");
+ DEBUG ("IOPSGetPowerSourceDescription did not return a CFDictionaryRef");
continue;
}
&iterator);
if (status != kIOReturnSuccess)
{
- DBG ("IOServiceGetMatchingServices failed.");
+ DEBUG ("IOServiceGetMatchingServices failed.");
return;
}
kNilOptions);
if (status != kIOReturnSuccess)
{
- DBG ("IORegistryEntryCreateCFProperties failed.");
+ DEBUG ("IORegistryEntryCreateCFProperties failed.");
continue;
}
if ((dh = opendir ("/proc/acpi/battery")) == NULL)
{
- syslog (LOG_ERR, "Cannot open `/proc/acpi/battery': %s", strerror (errno));
+ ERROR ("Cannot open `/proc/acpi/battery': %s", strerror (errno));
return (-1);
}
if ((fh = fopen (filename, "r")) == NULL)
{
- syslog (LOG_ERR, "Cannot open `%s': %s", filename, strerror (errno));
+ ERROR ("Cannot open `%s': %s", filename, strerror (errno));
continue;
}