summaryrefslogtreecommitdiff
path: root/src/backends/evolution/EvolutionCalendarSource.cpp
diff options
context:
space:
mode:
authorPatrick Ohly <patrick.ohly@intel.com>2013-04-08 18:57:11 +0200
committerPatrick Ohly <patrick.ohly@intel.com>2013-05-06 16:28:12 +0200
commitb5befe6cbf450346678a9a5d79ba885be9bd5dab (patch)
treeb0b01da93b2ac0c4c2a826436ef5bbac40c3ccf2 /src/backends/evolution/EvolutionCalendarSource.cpp
parent77b26de4b8bd09edf37adbeeff3b640a535ed1d5 (diff)
Logging: remove usage of Logger instance
Passing an explicit Logger instance to the SE_LOG* macros was hardly ever used and only made the macros more complex. The only usage of it was in some backends, which then added a prefix string automatically. The same effect can be achieved by passing getDisplayName(). Exception handling no longer needs a Logger instance, the prefix alone is enough. The other intended usage, avoiding global variables for logging by passing a logger known to the caller, was not possible at all. To make prefix handling more flexible, it is now passed as a "const std::string *" instead of a "const char *".
Diffstat (limited to 'src/backends/evolution/EvolutionCalendarSource.cpp')
-rw-r--r--src/backends/evolution/EvolutionCalendarSource.cpp14
1 files changed, 7 insertions, 7 deletions
diff --git a/src/backends/evolution/EvolutionCalendarSource.cpp b/src/backends/evolution/EvolutionCalendarSource.cpp
index dc52601c..0fd75ce9 100644
--- a/src/backends/evolution/EvolutionCalendarSource.cpp
+++ b/src/backends/evolution/EvolutionCalendarSource.cpp
@@ -197,7 +197,7 @@ char *EvolutionCalendarSource::authenticate(const char *prompt,
{
std::string passwd = getPassword();
- SE_LOG_DEBUG(this, NULL, "authentication requested, prompt \"%s\", key \"%s\" => %s",
+ SE_LOG_DEBUG(NULL, getDisplayName(), "authentication requested, prompt \"%s\", key \"%s\" => %s",
prompt, key,
!passwd.empty() ? "returning configured password" : "no password configured");
return !passwd.empty() ? strdup(passwd.c_str()) : NULL;
@@ -501,7 +501,7 @@ EvolutionCalendarSource::InsertItemResult EvolutionCalendarSource::insertItem(co
propstart = data.find("\nCATEGORIES", propstart + 1);
}
if (modified) {
- SE_LOG_DEBUG(this, NULL, "after replacing , with \\, in CATEGORIES:\n%s", data.c_str());
+ SE_LOG_DEBUG(NULL, getDisplayName(), "after replacing , with \\, in CATEGORIES:\n%s", data.c_str());
}
eptr<icalcomponent> icomp(icalcomponent_new_from_string((char *)data.c_str()));
@@ -545,7 +545,7 @@ EvolutionCalendarSource::InsertItemResult EvolutionCalendarSource::insertItem(co
const char *tzid = icaltimezone_get_tzid(zone);
if (!tzid || !tzid[0]) {
// cannot add a VTIMEZONE without TZID
- SE_LOG_DEBUG(this, NULL, "skipping VTIMEZONE without TZID");
+ SE_LOG_DEBUG(NULL, getDisplayName(), "skipping VTIMEZONE without TZID");
} else {
gboolean success =
#ifdef USE_EDS_CLIENT
@@ -832,7 +832,7 @@ EvolutionCalendarSource::ICalComps_t EvolutionCalendarSource::removeEvents(const
#endif
) {
if (IsCalObjNotFound(gerror)) {
- SE_LOG_DEBUG(this, NULL, "%s: request to delete non-existant item ignored",
+ SE_LOG_DEBUG(NULL, getDisplayName(), "%s: request to delete non-existant item ignored",
uid.c_str());
if (!ignoreNotFound) {
throwError(STATUS_NOT_FOUND, string("delete item: ") + uid);
@@ -920,7 +920,7 @@ void EvolutionCalendarSource::removeItem(const string &luid)
;
if (!item ||
(!success && IsCalObjNotFound(gerror))) {
- SE_LOG_DEBUG(this, NULL, "%s: request to delete non-existant item",
+ SE_LOG_DEBUG(NULL, getDisplayName(), "%s: request to delete non-existant item",
luid.c_str());
throwError(STATUS_NOT_FOUND, string("delete item: ") + id.getLUID());
} else if (!success) {
@@ -1034,7 +1034,7 @@ string EvolutionCalendarSource::retrieveItemAsString(const ItemID &id)
if (!icalstr) {
throwError(string("could not encode item as iCalendar: ") + id.getLUID());
} else {
- SE_LOG_DEBUG(this, NULL, "had to remove TZIDs because e_cal_get_component_as_string() failed for:\n%s", icalstr.get());
+ SE_LOG_DEBUG(NULL, getDisplayName(), "had to remove TZIDs because e_cal_get_component_as_string() failed for:\n%s", icalstr.get());
}
}
@@ -1066,7 +1066,7 @@ string EvolutionCalendarSource::retrieveItemAsString(const ItemID &id)
propstart = data.find("\nCATEGORIES", propstart + 1);
}
if (modified) {
- SE_LOG_DEBUG(this, NULL, "after replacing \\, with , in CATEGORIES:\n%s", data.c_str());
+ SE_LOG_DEBUG(NULL, getDisplayName(), "after replacing \\, with , in CATEGORIES:\n%s", data.c_str());
}
return data;