mirror of
https://github.com/matrix-construct/construct
synced 2024-11-15 14:31:11 +01:00
ircd::info: Update info.
This commit is contained in:
parent
ca6dc44a6c
commit
557b521d62
3 changed files with 116 additions and 103 deletions
|
@ -27,12 +27,14 @@
|
||||||
namespace ircd::info
|
namespace ircd::info
|
||||||
{
|
{
|
||||||
struct line;
|
struct line;
|
||||||
|
struct tc_version;
|
||||||
|
|
||||||
extern const std::vector<info::line> myinfo;
|
extern const std::vector<info::line> myinfo;
|
||||||
extern const std::vector<std::string> credits;
|
extern const std::vector<std::string> credits;
|
||||||
extern const std::string serno;
|
extern const std::string serno;
|
||||||
extern const std::string version;
|
extern const std::string version;
|
||||||
extern const char *const ircd_version; // legacy
|
extern const char *const ircd_version; // legacy
|
||||||
|
extern const uint boost_version[3];
|
||||||
|
|
||||||
extern const time_t configured_time;
|
extern const time_t configured_time;
|
||||||
extern const time_t compiled_time;
|
extern const time_t compiled_time;
|
||||||
|
@ -40,6 +42,8 @@ namespace ircd::info
|
||||||
extern const std::string compiled;
|
extern const std::string compiled;
|
||||||
extern const std::string configured;
|
extern const std::string configured;
|
||||||
extern const std::string startup;
|
extern const std::string startup;
|
||||||
|
|
||||||
|
void init();
|
||||||
}
|
}
|
||||||
|
|
||||||
struct ircd::info::line
|
struct ircd::info::line
|
||||||
|
|
166
ircd/info.cc
166
ircd/info.cc
|
@ -1,100 +1,154 @@
|
||||||
/*
|
//
|
||||||
* Copyright (C) 1990 Chelsea Ashley Dyerman
|
// Matrix Construct
|
||||||
* Copyright (C) 2008 ircd-ratbox development team
|
//
|
||||||
* Copyright (C) 2016 Charybdis Development Team
|
// Copyright (C) Matrix Construct Developers, Authors & Contributors
|
||||||
* Copyright (C) 2016 Jason Volk <jason@zemos.net>
|
// Copyright (C) 2016-2018 Jason Volk <jason@zemos.net>
|
||||||
*
|
//
|
||||||
* This program is free software; you can redistribute it and/or modify
|
// Permission to use, copy, modify, and/or distribute this software for any
|
||||||
* it under the terms of the GNU General Public License as published by
|
// purpose with or without fee is hereby granted, provided that the above
|
||||||
* the Free Software Foundation; either version 2, or (at your option)
|
// copyright notice and this permission notice is present in all copies.
|
||||||
* any later version.
|
//
|
||||||
*
|
// THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
|
||||||
* This program is distributed in the hope that it will be useful,
|
// IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
|
||||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
// WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
|
||||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
// DISCLAIMED. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT,
|
||||||
* GNU General Public License for more details.
|
// INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
|
||||||
*
|
// (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
|
||||||
* You should have received a copy of the GNU General Public License
|
// SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
|
||||||
* along with this program; if not, write to the Free Software
|
// HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
|
||||||
* Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
|
// STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING
|
||||||
*/
|
// IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
|
||||||
|
// POSSIBILITY OF SUCH DAMAGE.
|
||||||
|
|
||||||
using namespace ircd;
|
#include <ircd/asio.h>
|
||||||
|
|
||||||
const time_t
|
void
|
||||||
info::configured_time
|
ircd::info::init()
|
||||||
|
{
|
||||||
|
// This message flashes information about IRCd itself for this execution.
|
||||||
|
log::info("%s %ld %s. configured: %s; compiled: %s; executed: %s; %s",
|
||||||
|
BRANDING_VERSION,
|
||||||
|
__cplusplus,
|
||||||
|
__VERSION__,
|
||||||
|
configured,
|
||||||
|
compiled,
|
||||||
|
startup,
|
||||||
|
RB_DEBUG_LEVEL? "(DEBUG MODE)" : "");
|
||||||
|
|
||||||
|
// This message flashes information about our dependencies which are being
|
||||||
|
// assumed for this execution.
|
||||||
|
log::info("%s. boost %u.%u.%u. rocksdb %s. sodium %s. %s.",
|
||||||
|
PACKAGE_STRING,
|
||||||
|
boost_version[0],
|
||||||
|
boost_version[1],
|
||||||
|
boost_version[2],
|
||||||
|
db::version,
|
||||||
|
nacl::version(),
|
||||||
|
openssl::version());
|
||||||
|
}
|
||||||
|
|
||||||
|
/* XXX: integrate CREDITS text again somehow */
|
||||||
|
decltype(ircd::info::credits)
|
||||||
|
ircd::info::credits
|
||||||
|
{{
|
||||||
|
|
||||||
|
"Inspired by the original Internet Relay Chat daemon from Jarkko Oikarinen",
|
||||||
|
" ",
|
||||||
|
"This - is The Construct",
|
||||||
|
" ",
|
||||||
|
"Internet Relay Chat daemon: Matrix Construct",
|
||||||
|
" ",
|
||||||
|
"Copyright (C) 2016-2018 Matrix Construct Developers, Authors & Contributors",
|
||||||
|
"Permission to use, copy, modify, and/or distribute this software for any",
|
||||||
|
"purpose with or without fee is hereby granted, provided that the above",
|
||||||
|
"copyright notice and this permission notice is present in all copies.",
|
||||||
|
" ",
|
||||||
|
}};
|
||||||
|
|
||||||
|
decltype(ircd::info::configured_time)
|
||||||
|
ircd::info::configured_time
|
||||||
{
|
{
|
||||||
RB_TIME_CONFIGURED
|
RB_TIME_CONFIGURED
|
||||||
};
|
};
|
||||||
|
|
||||||
const time_t
|
decltype(ircd::info::compiled_time)
|
||||||
info::compiled_time
|
ircd::info::compiled_time
|
||||||
{
|
{
|
||||||
RB_TIME_COMPILED
|
RB_TIME_COMPILED
|
||||||
};
|
};
|
||||||
|
|
||||||
const time_t
|
decltype(ircd::info::startup_time)
|
||||||
info::startup_time
|
ircd::info::startup_time
|
||||||
{
|
{
|
||||||
std::time(nullptr)
|
std::time(nullptr)
|
||||||
};
|
};
|
||||||
|
|
||||||
const std::string
|
decltype(ircd::info::configured)
|
||||||
info::configured
|
ircd::info::configured
|
||||||
{
|
{
|
||||||
ctime(&configured_time)
|
ctime(&configured_time)
|
||||||
};
|
};
|
||||||
|
|
||||||
const std::string
|
decltype(ircd::info::compiled)
|
||||||
info::compiled
|
ircd::info::compiled
|
||||||
{
|
{
|
||||||
ctime(&compiled_time)
|
//ctime(&compiled_time)
|
||||||
|
__TIMESTAMP__
|
||||||
};
|
};
|
||||||
|
|
||||||
const std::string
|
decltype(ircd::info::startup)
|
||||||
info::startup
|
ircd::info::startup
|
||||||
{
|
{
|
||||||
ctime(&startup_time)
|
ctime(&startup_time)
|
||||||
};
|
};
|
||||||
|
|
||||||
const std::string
|
decltype(ircd::info::serno)
|
||||||
info::serno
|
ircd::info::serno
|
||||||
{
|
{
|
||||||
//TODO: XXX: compile counter?
|
//TODO: XXX: compile counter?
|
||||||
// RB_SERNO
|
// RB_SERNO
|
||||||
0
|
0
|
||||||
};
|
};
|
||||||
|
|
||||||
const std::string
|
decltype(ircd::info::version)
|
||||||
info::version
|
ircd::info::version
|
||||||
{
|
{
|
||||||
RB_VERSION
|
RB_VERSION
|
||||||
};
|
};
|
||||||
|
|
||||||
const char *const
|
decltype(ircd::info::ircd_version)
|
||||||
info::ircd_version
|
ircd::info::ircd_version
|
||||||
{
|
{
|
||||||
RB_VERSION
|
RB_VERSION
|
||||||
};
|
};
|
||||||
|
|
||||||
/* XXX: integrate CREDITS text again somehow */
|
/// Boost version indicator for compiled header files.
|
||||||
const std::vector<std::string>
|
decltype(ircd::info::boost_version)
|
||||||
info::credits
|
ircd::info::boost_version
|
||||||
{{
|
{
|
||||||
|
BOOST_VERSION / 100000,
|
||||||
|
BOOST_VERSION / 100 % 1000,
|
||||||
|
BOOST_VERSION % 100,
|
||||||
|
};
|
||||||
|
|
||||||
"Inspired by the original Internet Relay Chat daemon by Jarkko Oikarinen",
|
/// Provides tcmalloc version information if tcmalloc is linked in to IRCd.
|
||||||
" ",
|
struct ircd::info::tc_version
|
||||||
"Internet Relay Chat daemon: Matrix Construct",
|
{
|
||||||
" ",
|
int major{0}, minor{0};
|
||||||
"* Copyright (C) 2016-2017 Matrix Construct developers",
|
char patch[64] {0};
|
||||||
"* Permission to use, copy, modify, and/or distribute this software for any",
|
std::string version {"unavailable"};
|
||||||
"* purpose with or without fee is hereby granted, provided that the above",
|
}
|
||||||
"* copyright notice and this permission notice is present in all copies.",
|
const ircd::info::tc_version;
|
||||||
" ",
|
|
||||||
}};
|
|
||||||
|
|
||||||
const std::vector<info::line>
|
/*
|
||||||
info::myinfo
|
const char* tc_version(int* major, int* minor, const char** patch);
|
||||||
|
ircd::tc_version::tc_version()
|
||||||
|
:version{::tc_version(&major, &minor, reinterpret_cast<const char **>(&patch))}
|
||||||
|
{}
|
||||||
|
*/
|
||||||
|
|
||||||
|
decltype(ircd::info::myinfo)
|
||||||
|
ircd::info::myinfo
|
||||||
{{
|
{{
|
||||||
#ifdef CPATH
|
#ifdef CPATH
|
||||||
{"CPATH", CPATH, 0, "Path to Main Configuration File"},
|
{"CPATH", CPATH, 0, "Path to Main Configuration File"},
|
||||||
|
|
49
ircd/ircd.cc
49
ircd/ircd.cc
|
@ -22,9 +22,6 @@
|
||||||
|
|
||||||
namespace ircd
|
namespace ircd
|
||||||
{
|
{
|
||||||
extern const uint boost_version[3];
|
|
||||||
struct tc_version extern const tc_version;
|
|
||||||
|
|
||||||
enum runlevel _runlevel; // Current libircd runlevel
|
enum runlevel _runlevel; // Current libircd runlevel
|
||||||
const enum runlevel &runlevel{_runlevel}; // Observer for current RL
|
const enum runlevel &runlevel{_runlevel}; // Observer for current RL
|
||||||
runlevel_handler runlevel_changed; // user's callback
|
runlevel_handler runlevel_changed; // user's callback
|
||||||
|
@ -44,22 +41,6 @@ namespace ircd
|
||||||
void main();
|
void main();
|
||||||
}
|
}
|
||||||
|
|
||||||
/// Provides tcmalloc version information if tcmalloc is linked in to IRCd.
|
|
||||||
struct ircd::tc_version
|
|
||||||
{
|
|
||||||
int major{0}, minor{0};
|
|
||||||
char patch[64] {0};
|
|
||||||
std::string version {"unavailable"};
|
|
||||||
}
|
|
||||||
const ircd::tc_version;
|
|
||||||
|
|
||||||
/*
|
|
||||||
const char* tc_version(int* major, int* minor, const char** patch);
|
|
||||||
ircd::tc_version::tc_version()
|
|
||||||
:version{::tc_version(&major, &minor, reinterpret_cast<const char **>(&patch))}
|
|
||||||
{}
|
|
||||||
*/
|
|
||||||
|
|
||||||
/// Record of the ID of the thread static initialization took place on.
|
/// Record of the ID of the thread static initialization took place on.
|
||||||
const std::thread::id
|
const std::thread::id
|
||||||
ircd::static_thread_id
|
ircd::static_thread_id
|
||||||
|
@ -72,15 +53,6 @@ std::thread::id
|
||||||
ircd::thread_id
|
ircd::thread_id
|
||||||
{};
|
{};
|
||||||
|
|
||||||
/// Boost version indicator for compiled header files.
|
|
||||||
const uint
|
|
||||||
ircd::boost_version[3]
|
|
||||||
{
|
|
||||||
BOOST_VERSION / 100000,
|
|
||||||
BOOST_VERSION / 100 % 1000,
|
|
||||||
BOOST_VERSION % 100,
|
|
||||||
};
|
|
||||||
|
|
||||||
void
|
void
|
||||||
ircd::init(boost::asio::io_context &ios,
|
ircd::init(boost::asio::io_context &ios,
|
||||||
runlevel_handler function)
|
runlevel_handler function)
|
||||||
|
@ -124,25 +96,8 @@ try
|
||||||
log::init();
|
log::init();
|
||||||
log::mark("READY");
|
log::mark("READY");
|
||||||
|
|
||||||
// This message flashes information about our dependencies which are being
|
// This starts off the log with library information.
|
||||||
// assumed for this execution.
|
info::init();
|
||||||
log::info("%s. boost %u.%u.%u. rocksdb %s. sodium %s. %s.",
|
|
||||||
PACKAGE_STRING,
|
|
||||||
boost_version[0],
|
|
||||||
boost_version[1],
|
|
||||||
boost_version[2],
|
|
||||||
db::version,
|
|
||||||
nacl::version(),
|
|
||||||
openssl::version());
|
|
||||||
|
|
||||||
// This message flashes information about IRCd itself for this execution
|
|
||||||
log::info("%s %ld %s. configured: %s. compiled: %s %s",
|
|
||||||
BRANDING_VERSION,
|
|
||||||
__cplusplus,
|
|
||||||
__VERSION__,
|
|
||||||
RB_DATE_CONFIGURED,
|
|
||||||
__TIMESTAMP__,
|
|
||||||
RB_DEBUG_LEVEL? "(DEBUG MODE)" : "");
|
|
||||||
|
|
||||||
// The configuration file is a user-converted Synapse homeserver.yaml
|
// The configuration file is a user-converted Synapse homeserver.yaml
|
||||||
// converted into JSON. The configuration file is only truly meaningful
|
// converted into JSON. The configuration file is only truly meaningful
|
||||||
|
|
Loading…
Reference in a new issue