From ff084ec00cb18588cd0a8abd9635ee7488cb4075 Mon Sep 17 00:00:00 2001 From: stephb9959 Date: Tue, 8 Nov 2022 23:12:05 -0800 Subject: [PATCH] https://telecominfraproject.atlassian.net/browse/WIFI-11303 Signed-off-by: stephb9959 --- build | 2 +- src/framework/ConfigurationValidator.cpp | 10 +++++----- src/framework/MicroService.cpp | 10 +++++----- src/framework/RESTAPI_ExtServer.h | 12 ++++++------ src/framework/RESTAPI_IntServer.h | 12 ++++++------ src/framework/RESTAPI_SystemCommand.h | 2 +- src/framework/SubSystemServer.h | 4 ++-- 7 files changed, 26 insertions(+), 26 deletions(-) diff --git a/build b/build index 62f9457..c793025 100644 --- a/build +++ b/build @@ -1 +1 @@ -6 \ No newline at end of file +7 \ No newline at end of file diff --git a/src/framework/ConfigurationValidator.cpp b/src/framework/ConfigurationValidator.cpp index a2ce465..2154f0f 100644 --- a/src/framework/ConfigurationValidator.cpp +++ b/src/framework/ConfigurationValidator.cpp @@ -2632,7 +2632,7 @@ static json DefaultUCentralSchema = R"( std::string GitSchema; if(MicroServiceConfigGetBool("ucentral.datamodel.internal",true)) { RootSchema_ = DefaultUCentralSchema; - Logger().information("Using uCentral validation from built-in default."); + poco_information(Logger(),"Using uCentral validation from built-in default."); Initialized_ = Working_ = true; return; } @@ -2641,7 +2641,7 @@ static json DefaultUCentralSchema = R"( auto GitURI = MicroServiceConfigGetString("ucentral.datamodel.uri",GitUCentralJSONSchemaFile); if(Utils::wgets(GitURI, GitSchema)) { RootSchema_ = json::parse(GitSchema); - Logger().information("Using uCentral validation schema from GIT."); + poco_information(Logger(),"Using uCentral validation schema from GIT."); } else { std::string FileName{ MicroServiceDataDirectory() + "/ucentral.schema.json" }; std::ifstream input(FileName); @@ -2649,11 +2649,11 @@ static json DefaultUCentralSchema = R"( schema_file << input.rdbuf(); input.close(); RootSchema_ = json::parse(schema_file.str()); - Logger().information("Using uCentral validation schema from local file."); + poco_information(Logger(),"Using uCentral validation schema from local file."); } } catch (const Poco::Exception &E) { RootSchema_ = DefaultUCentralSchema; - Logger().information("Using uCentral validation from built-in default."); + poco_information(Logger(),"Using uCentral validation from built-in default."); } Initialized_ = Working_ = true; } @@ -2812,7 +2812,7 @@ static json DefaultUCentralSchema = R"( } void ConfigurationValidator::reinitialize([[maybe_unused]] Poco::Util::Application &self) { - Logger().information("Reinitializing."); + poco_information(Logger(),"Reinitializing."); Working_ = Initialized_ = false; Init(); } diff --git a/src/framework/MicroService.cpp b/src/framework/MicroService.cpp index 7a9433a..da3c146 100644 --- a/src/framework/MicroService.cpp +++ b/src/framework/MicroService.cpp @@ -78,7 +78,7 @@ namespace OpenWifi { else SvcList += ", " + Svc.second.Type; } - logger().information(fmt::format("Current list of microservices: {}", SvcList)); + poco_information(logger(),fmt::format("Current list of microservices: {}", SvcList)); } } else { poco_error(logger(),fmt::format("KAFKA-MSG: invalid event '{}', missing a field.",Event)); @@ -618,15 +618,15 @@ namespace OpenWifi { logger.notice(fmt::format("Starting {} version {}.",DAEMON_APP_NAME, Version())); if(Poco::Net::Socket::supportsIPv6()) - logger.information("System supports IPv6."); + poco_information(logger,"System supports IPv6."); else - logger.information("System does NOT support IPv6."); + poco_information(logger,"System does NOT support IPv6."); if (config().getBool("application.runAsDaemon", false)) { - logger.information("Starting as a daemon."); + poco_information(logger,"Starting as a daemon."); } - logger.information(fmt::format("System ID set to {}",ID_)); + poco_information(logger,fmt::format("System ID set to {}",ID_)); StartSubSystemServers(); waitForTerminationRequest(); StopSubSystemServers(); diff --git a/src/framework/RESTAPI_ExtServer.h b/src/framework/RESTAPI_ExtServer.h index 16b359a..ab3961a 100644 --- a/src/framework/RESTAPI_ExtServer.h +++ b/src/framework/RESTAPI_ExtServer.h @@ -30,15 +30,15 @@ namespace OpenWifi { } inline int Start() override { - Logger().information("Starting."); + poco_information(Logger(),"Starting."); Server_.InitLogging(); for(const auto & Svr: ConfigServersList_) { if(MicroServiceNoAPISecurity()) { - Logger().information(fmt::format("Starting: {}:{}. Security has been disabled for APIs.", Svr.Address(), Svr.Port())); + poco_information(Logger(),fmt::format("Starting: {}:{}. Security has been disabled for APIs.", Svr.Address(), Svr.Port())); } else { - Logger().information(fmt::format("Starting: {}:{} Keyfile:{} CertFile: {}", Svr.Address(), Svr.Port(), + poco_information(Logger(),fmt::format("Starting: {}:{} Keyfile:{} CertFile: {}", Svr.Address(), Svr.Port(), Svr.KeyFile(),Svr.CertFile())); Svr.LogCert(Logger()); if (!Svr.RootCA().empty()) @@ -64,18 +64,18 @@ namespace OpenWifi { } inline void Stop() override { - Logger().information("Stopping..."); + poco_information(Logger(),"Stopping..."); for( const auto & svr : RESTServers_ ) svr->stopAll(true); Pool_.stopAll(); Pool_.joinAll(); RESTServers_.clear(); - Logger().information("Stopped..."); + poco_information(Logger(),"Stopped..."); } inline void reinitialize([[maybe_unused]] Poco::Util::Application &self) override { MicroServiceLoadConfigurationFile(); - Logger().information("Reinitializing."); + poco_information(Logger(),"Reinitializing."); Stop(); Start(); } diff --git a/src/framework/RESTAPI_IntServer.h b/src/framework/RESTAPI_IntServer.h index cff9946..4926771 100644 --- a/src/framework/RESTAPI_IntServer.h +++ b/src/framework/RESTAPI_IntServer.h @@ -30,15 +30,15 @@ namespace OpenWifi { } inline int Start() override { - Logger().information("Starting."); + poco_information(Logger(),"Starting."); Server_.InitLogging(); for(const auto & Svr: ConfigServersList_) { if(MicroServiceNoAPISecurity()) { - Logger().information(fmt::format("Starting: {}:{}. Security has been disabled for APIs.", Svr.Address(), Svr.Port())); + poco_information(Logger(),fmt::format("Starting: {}:{}. Security has been disabled for APIs.", Svr.Address(), Svr.Port())); } else { - Logger().information(fmt::format("Starting: {}:{}. Keyfile:{} CertFile: {}", Svr.Address(), Svr.Port(), + poco_information(Logger(),fmt::format("Starting: {}:{}. Keyfile:{} CertFile: {}", Svr.Address(), Svr.Port(), Svr.KeyFile(),Svr.CertFile())); Svr.LogCert(Logger()); if (!Svr.RootCA().empty()) @@ -65,17 +65,17 @@ namespace OpenWifi { } inline void Stop() override { - Logger().information("Stopping..."); + poco_information(Logger(),"Stopping..."); for( const auto & svr : RESTServers_ ) svr->stopAll(true); Pool_.stopAll(); Pool_.joinAll(); - Logger().information("Stopped..."); + poco_information(Logger(),"Stopped..."); } inline void reinitialize([[maybe_unused]] Poco::Util::Application &self) override { MicroServiceLoadConfigurationFile(); - Logger().information("Reinitializing."); + poco_information(Logger(),"Reinitializing."); Stop(); Start(); } diff --git a/src/framework/RESTAPI_SystemCommand.h b/src/framework/RESTAPI_SystemCommand.h index d00ae65..9ce9691 100644 --- a/src/framework/RESTAPI_SystemCommand.h +++ b/src/framework/RESTAPI_SystemCommand.h @@ -88,7 +88,7 @@ namespace OpenWifi { auto Name = GetS(RESTAPI::Protocol::TAG, InnerObj); auto Value = GetS(RESTAPI::Protocol::VALUE, InnerObj); MicroServiceSetSubsystemLogLevel(Name, Value); - Logger_.information( + poco_information(Logger_, fmt::format("Setting log level for {} at {}", Name, Value)); } } diff --git a/src/framework/SubSystemServer.h b/src/framework/SubSystemServer.h index d7625d4..268f899 100644 --- a/src/framework/SubSystemServer.h +++ b/src/framework/SubSystemServer.h @@ -23,7 +23,7 @@ namespace OpenWifi { } void onPrivateKeyRequested([[maybe_unused]] const void * pSender,std::string & privateKey) { - Logger_.information("Returning key passphrase."); + poco_information(Logger_,"Returning key passphrase."); privateKey = Password_; }; inline Poco::Logger & Logger() { return Logger_; } @@ -83,7 +83,7 @@ namespace OpenWifi { inline void uninitialize() override { } inline void reinitialize([[maybe_unused]] Poco::Util::Application &self) override { - Logger_->L_.information("Reloading of this subsystem is not supported."); + poco_information(Logger_->L_,"Reloading of this subsystem is not supported."); } inline void defineOptions([[maybe_unused]] Poco::Util::OptionSet &options) override { }