feat: add startup info printing during initialization (#107)

Include a method to print detailed startup information about the framework, enhancing user awareness of the version and providing relevant links for support.
This commit is contained in:
zhangyi1357 2024-11-18 21:53:25 +08:00 committed by GitHub
parent 1f3401341a
commit 1f173fdd46
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
3 changed files with 24 additions and 1 deletions

View File

@ -25,6 +25,27 @@ AimRTCore::~AimRTCore() {
hook_task_vec_array_.clear();
}
void AimRTCore::PrintStartupInfo() const {
constexpr const char* aimrt_info = R"(
Modern High Performance Robotics Framework
Official Website: https://aimrt.org ║
Documentation: https://docs.aimrt.org ║
Version: v{:<32}
)";
constexpr const auto* version_str = util::GetAimRTVersion();
AIMRT_INFO(aimrt_info, version_str);
}
void AimRTCore::Initialize(const Options& options) {
EnterState(State::kPreInit);
@ -70,6 +91,7 @@ void AimRTCore::Initialize(const Options& options) {
std::bind(&AimRTCore::GetExecutor, this, std::placeholders::_1));
logger_manager_.Initialize(configurator_manager_.GetAimRTOptionsNode("log"));
SetCoreLogger();
PrintStartupInfo();
EnterState(State::kPostInitLog);
// Init allocator

View File

@ -214,6 +214,7 @@ class AimRTCore {
void CheckCfgFile() const;
void StartImpl();
void ShutdownImpl();
void PrintStartupInfo() const;
private:
Options options_;

View File

@ -5,7 +5,7 @@
namespace aimrt::runtime::core::util {
inline const char* GetAimRTVersion() {
constexpr const char* GetAimRTVersion() {
return AIMRT_VERSION;
}
} // namespace aimrt::runtime::core::util