diff options
| author | 2023-01-19 13:55:45 +0000 | |
|---|---|---|
| committer | 2023-01-19 14:46:15 +0000 | |
| commit | e36c077346020f7a4313534f5b91bec7cff1684b (patch) | |
| tree | d907e487ea1150ffd4afbc3cd39fc33e0a4ff988 /src/modules/extra/m_pgsql.cpp | |
| parent | Fix Cloak::Method and Log::Method being needlessly Cullable. (diff) | |
Log the versions of third-party libraries used by modules.
Diffstat (limited to 'src/modules/extra/m_pgsql.cpp')
| -rw-r--r-- | src/modules/extra/m_pgsql.cpp | 16 |
1 files changed, 16 insertions, 0 deletions
diff --git a/src/modules/extra/m_pgsql.cpp b/src/modules/extra/m_pgsql.cpp index 99bd0ed79..fc4ec23c1 100644 --- a/src/modules/extra/m_pgsql.cpp +++ b/src/modules/extra/m_pgsql.cpp @@ -37,6 +37,7 @@ #include <libpq-fe.h> +#include <pg_config.h> #include "inspircd.h" #include "modules/sql.h" @@ -575,6 +576,21 @@ public: ClearAllConnections(); } + void init() override + { + int version = PQlibVersion(); + int minor = version / 100 % 100; + int revision = version % 100; + if (version >= 10'00'00) + { + // Ref: https://www.postgresql.org/docs/current/libpq-misc.html#LIBPQ-PQLIBVERSION + minor = revision; + revision = 0; + } + ServerInstance->Logs.Normal(MODNAME, "Module was compiled against libpq version %s and is running against version %d.%d.%d", + PG_VERSION, version / 10000, minor, revision); + } + void ReadConfig(ConfigStatus& status) override { ReadConf(); |
