summaryrefslogtreecommitdiff
path: root/modules/database/redis.cpp
diff options
context:
space:
mode:
authorAdam <Adam@anope.org>2017-01-23 12:35:14 -0500
committerAdam <Adam@anope.org>2017-01-23 12:35:14 -0500
commit16ca76c2e7ab287e480185fbb03a0bb438351eda (patch)
treedfb25534afa2352b65b2ee707086cb5eecc96fbb /modules/database/redis.cpp
parentff030c1eb7c3764f9add2a689479e84d616cabcb (diff)
Make log system use newer format strings
Also allow log messages to be translatable
Diffstat (limited to 'modules/database/redis.cpp')
-rw-r--r--modules/database/redis.cpp28
1 files changed, 16 insertions, 12 deletions
diff --git a/modules/database/redis.cpp b/modules/database/redis.cpp
index 49ab8cbd4..b6ce95241 100644
--- a/modules/database/redis.cpp
+++ b/modules/database/redis.cpp
@@ -278,7 +278,7 @@ void TypeLoader::OnResult(const Reply &r)
Serialize::Object *obj = type->Require(id);
if (obj == nullptr)
{
- Log(LOG_DEBUG) << "redis: Unable to require object #" << id << " of type " << type->GetName();
+ Anope::Logger.Debug("Unable to require object #{0} of type {1}", id, type->GetName());
continue;
}
@@ -318,7 +318,7 @@ void ObjectLoader::OnResult(const Reply &r)
void FieldLoader::OnResult(const Reply &r)
{
- Log(LOG_DEBUG_2) << "redis: Setting field " << field->serialize_name << " of object #" << obj->id << " of type " << obj->GetSerializableType()->GetName() << " to " << r.bulk;
+ Anope::Logger.Debug2("Setting field {0} of object #{1} of type {2} to {3}", field->serialize_name, obj->id, obj->GetSerializableType()->GetName(), r.bulk);
field->UnserializeFromString(obj, r.bulk);
delete this;
@@ -358,25 +358,27 @@ void SubscriptionListener::OnResult(const Reply &r)
}
catch (const ConvertException &ex)
{
- Log(LOG_DEBUG) << "redis: unable to get id for SL update key " << sid;
+ this->GetOwner()->logger.Debug("unable to get id for SL update key {0}", sid);
return;
}
Serialize::Object *obj = Serialize::GetID(id);
if (obj == nullptr)
{
- Log(LOG_DEBUG) << "redis: pmessage for unknown object #" << id;
+ this->GetOwner()->logger.Debug("message for unknown object #{0}", id);
return;
}
Serialize::FieldBase *field = obj->GetSerializableType()->GetField(key);
if (field == nullptr)
{
- Log(LOG_DEBUG) << "redis: pmessage for unknown field of object #" << id << ": " << key;
+ this->GetOwner()->logger.Debug("message for unknown field of object #{0}: {1}", id, key);
return;
}
- Log(LOG_DEBUG_2) << "redis: Setting field " << field->serialize_name << " of object #" << obj->id << " of type " << obj->GetSerializableType()->GetName() << " to " << value;
+ this->GetOwner()->logger.Debug2("Setting field {0} of object #{1} of type {2} to {3}",
+ field->serialize_name, obj->id, obj->GetSerializableType()->GetName(), value);
+
field->UnserializeFromString(obj, value);
}
else if (command == "create")
@@ -393,21 +395,21 @@ void SubscriptionListener::OnResult(const Reply &r)
}
catch (const ConvertException &ex)
{
- Log(LOG_DEBUG) << "redis: unable to get id for SL update key " << sid;
+ this->GetOwner()->logger.Debug("unable to get id for SL update key {0}", sid);
return;
}
Serialize::TypeBase *type = Serialize::TypeBase::Find(stype);
if (type == nullptr)
{
- Log(LOG_DEBUG) << "redis: pmessage create for nonexistant type " << stype;
+ this->GetOwner()->logger.Debug("message create for nonexistant type {0}", stype);
return;
}
Serialize::Object *obj = type->Require(id);
if (obj == nullptr)
{
- Log(LOG_DEBUG) << "redis: require for pmessage create type " << type->GetName() << " id #" << id << " returned nullptr";
+ this->GetOwner()->logger.Debug("require for message create type {0} id #{1} returned nullptr", type->GetName(), id);
return;
}
}
@@ -424,21 +426,23 @@ void SubscriptionListener::OnResult(const Reply &r)
}
catch (const ConvertException &ex)
{
- Log(LOG_DEBUG) << "redis: unable to get id for SL update key " << sid;
+ this->GetOwner()->logger.Debug("unable to get id for SL update key {0}", sid);
return;
}
Serialize::Object *obj = Serialize::GetID(id);
if (obj == nullptr)
{
- Log(LOG_DEBUG) << "redis: message for unknown object #" << id;
+ this->GetOwner()->logger.Debug("message for unknown object #{0}", id);
return;
}
obj->Delete();
}
else
- Log(LOG_DEBUG) << "redis: unknown message: " << message;
+ {
+ this->GetOwner()->logger.Debug("unknown message: {0}", message);
+ }
}
MODULE_INIT(DatabaseRedis)