summaryrefslogtreecommitdiff
path: root/modules/sqlite.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/sqlite.cpp
parentff030c1eb7c3764f9add2a689479e84d616cabcb (diff)
Make log system use newer format strings
Also allow log messages to be translatable
Diffstat (limited to 'modules/sqlite.cpp')
-rw-r--r--modules/sqlite.cpp14
1 files changed, 7 insertions, 7 deletions
diff --git a/modules/sqlite.cpp b/modules/sqlite.cpp
index 5fbbb855e..3cc618e4c 100644
--- a/modules/sqlite.cpp
+++ b/modules/sqlite.cpp
@@ -139,7 +139,7 @@ class ModuleSQLite : public Module
if (i == num)
{
- Log(LOG_NORMAL, "sqlite") << "SQLite: Removing server connection " << cname;
+ logger.Log("Removing server connection {0}", cname);
delete s;
this->SQLiteServices.erase(cname);
@@ -160,11 +160,11 @@ class ModuleSQLite : public Module
SQLiteService *ss = new SQLiteService(this, connname, database);
this->SQLiteServices[connname] = ss;
- Log(LOG_NORMAL, "sqlite") << "SQLite: Successfully added database " << database;
+ logger.Log(_("Successfully added database {0}"), database);
}
catch (const SQL::Exception &ex)
{
- Log(LOG_NORMAL, "sqlite") << "SQLite: " << ex.GetReason();
+ logger.Log(ex.GetReason());
}
}
}
@@ -189,7 +189,7 @@ SQLiteService::SQLiteService(Module *o, const Anope::string &n, const Anope::str
int ret = sqlite3_create_function_v2(this->sql, "anope_canonicalize", 1, SQLITE_DETERMINISTIC, NULL, Canonicalize, NULL, NULL, NULL);
if (ret != SQLITE_OK)
- Log(LOG_DEBUG) << "Unable to add anope_canonicalize function: " << sqlite3_errmsg(this->sql);
+ o->logger.Debug("Unable to add anope_canonicalize function: {0}", sqlite3_errmsg(this->sql));
}
SQLiteService::~SQLiteService()
@@ -216,7 +216,7 @@ Result SQLiteService::RunQuery(const Query &query)
{
const char *msg = sqlite3_errmsg(this->sql);
- Log(LOG_DEBUG) << "sqlite: error in query " << real_query << ": " << msg;
+ this->GetOwner()->logger.Debug("error in query {0}: {1}", real_query, msg);
return SQLiteResult(query, real_query, msg);
}
@@ -227,9 +227,9 @@ Result SQLiteService::RunQuery(const Query &query)
sqlite3_finalize(stmt);
if (!result.GetError().empty())
- Log(LOG_DEBUG) << "sqlite: error executing query " << real_query << ": " << result.GetError();
+ this->GetOwner()->logger.Debug("error executing query {0}: {1}", real_query, result.GetError());
else
- Log(LOG_DEBUG) << "sqlite: executed: " << real_query;
+ this->GetOwner()->logger.Debug("executed: {0}", real_query);
return result;
}