aboutsummaryrefslogtreecommitdiffstats
path: root/src/modules
diff options
context:
space:
mode:
authorGravatar Sadie Powell2022-08-23 23:18:55 +0100
committerGravatar Sadie Powell2022-08-23 23:18:55 +0100
commita5c2a94bd8d6b2e7ea5fc531a109e5ea3e81a287 (patch)
treef138145b2047cd910b90c3dee83577fa0990b463 /src/modules
parentRefactor the core event macros. (diff)
downloadinspircd++-a5c2a94bd8d6b2e7ea5fc531a109e5ea3e81a287.tar.gz
inspircd++-a5c2a94bd8d6b2e7ea5fc531a109e5ea3e81a287.tar.bz2
inspircd++-a5c2a94bd8d6b2e7ea5fc531a109e5ea3e81a287.zip
Fix cached log messages not having the correct timestamp.
Diffstat (limited to 'src/modules')
-rw-r--r--src/modules/extra/m_log_json.cpp6
-rw-r--r--src/modules/extra/m_log_syslog.cpp2
-rw-r--r--src/modules/m_log_sql.cpp4
3 files changed, 6 insertions, 6 deletions
diff --git a/src/modules/extra/m_log_json.cpp b/src/modules/extra/m_log_json.cpp
index cc7ba9334..afa6d58a3 100644
--- a/src/modules/extra/m_log_json.cpp
+++ b/src/modules/extra/m_log_json.cpp
@@ -63,13 +63,13 @@ public:
// RapidJSON API: We implement our own flushing in OnLog.
void Flush() { }
- void OnLog(Log::Level level, const std::string& type, const std::string& message) override
+ void OnLog(time_t time, Log::Level level, const std::string& type, const std::string& message) override
{
static time_t prevtime = 0;
static std::string timestr;
- if (prevtime != ServerInstance->Time())
+ if (prevtime != time)
{
- prevtime = ServerInstance->Time();
+ prevtime = time;
timestr = InspIRCd::TimeString(prevtime, "%Y-%m-%dT%H:%M:%S%z");
}
diff --git a/src/modules/extra/m_log_syslog.cpp b/src/modules/extra/m_log_syslog.cpp
index 6e94c76a1..a3cf23ec6 100644
--- a/src/modules/extra/m_log_syslog.cpp
+++ b/src/modules/extra/m_log_syslog.cpp
@@ -49,7 +49,7 @@ private:
}
public:
- void OnLog(Log::Level level, const std::string& type, const std::string& message) override
+ void OnLog(time_t time, Log::Level level, const std::string& type, const std::string& message) override
{
syslog(LevelToPriority(level), "%s: %s", type.c_str(), message.c_str());
}
diff --git a/src/modules/m_log_sql.cpp b/src/modules/m_log_sql.cpp
index 6d6df048d..4ffe6784a 100644
--- a/src/modules/m_log_sql.cpp
+++ b/src/modules/m_log_sql.cpp
@@ -59,7 +59,7 @@ public:
{
}
- void OnLog(Log::Level level, const std::string& type, const std::string& message) override
+ void OnLog(time_t time, Log::Level level, const std::string& type, const std::string& message) override
{
if (!sql)
{
@@ -71,7 +71,7 @@ public:
{ "level", ConvToStr(static_cast<uint8_t>(level)) },
{ "levelstr", Log::LevelToString(level) },
{ "message", message },
- { "time", ConvToStr(ServerInstance->Time()) },
+ { "time", ConvToStr(time) },
{ "type", type },
};
sql->Submit(new SQLQuery(thismod), query, params);