diff --git a/legacy/LegacyNetworkAPIs.cpp b/legacy/LegacyNetworkAPIs.cpp index 071466cd..4e31974c 100644 --- a/legacy/LegacyNetworkAPIs.cpp +++ b/legacy/LegacyNetworkAPIs.cpp @@ -96,6 +96,7 @@ namespace WPEFramework const string Network::Initialize(PluginHost::IShell* service ) { + NetworkManagerLogger::Init(); m_service = service; m_service->AddRef(); string message{}; diff --git a/legacy/LegacyWiFiManagerAPIs.cpp b/legacy/LegacyWiFiManagerAPIs.cpp index 9a6573ff..02c9da61 100644 --- a/legacy/LegacyWiFiManagerAPIs.cpp +++ b/legacy/LegacyWiFiManagerAPIs.cpp @@ -128,6 +128,7 @@ namespace WPEFramework const string WiFiManager::Initialize(PluginHost::IShell* service ) { + NetworkManagerLogger::Init(); m_service = service; string message{}; diff --git a/plugin/NetworkManager.cpp b/plugin/NetworkManager.cpp index 1049e503..97e55ee6 100644 --- a/plugin/NetworkManager.cpp +++ b/plugin/NetworkManager.cpp @@ -84,12 +84,6 @@ namespace WPEFramework // Still running inside the main WPEFramework process - the child process will have now been spawned and registered if necessary if (_networkManager != nullptr) { - - // Set the plugin log level - Exchange::INetworkManager::Logging _loglevel; - _networkManager->GetLogLevel(_loglevel); - NetworkManagerLogger::SetLevel(static_cast (_loglevel)); - // Register Notifications SYSLOG(Logging::Startup, (_T("Registering Notification to NetworkManager"))); _networkManager->Register(&_notification); @@ -103,6 +97,11 @@ namespace WPEFramework { SYSLOG(Logging::Startup, (_T("Configuring successful"))); } + + // Set the plugin log level + Exchange::INetworkManager::Logging _loglevel; + _networkManager->GetLogLevel(_loglevel); + NetworkManagerLogger::SetLevel(static_cast (_loglevel)); // Register all custom JSON-RPC methods SYSLOG(Logging::Startup, (_T("Registering JSONRPC Methods"))); RegisterAllMethods(); diff --git a/plugin/NetworkManagerImplementation.cpp b/plugin/NetworkManagerImplementation.cpp index c0120534..99c98b39 100644 --- a/plugin/NetworkManagerImplementation.cpp +++ b/plugin/NetworkManagerImplementation.cpp @@ -65,7 +65,7 @@ namespace WPEFramework /* Initialize Network Manager */ NetworkManagerLogger::Init(); - NMLOG_INFO((_T("NWMgrPlugin Out-Of-Process Instantiation; SHA: " _T(EXPAND_AND_QUOTE(PLUGIN_BUILD_REFERENCE))))); + SYSLOG(::WPEFramework::Logging::Startup, (_T("NWMgrPlugin Out-Of-Process Instantiation; SHA: ") _T(EXPAND_AND_QUOTE(PLUGIN_BUILD_REFERENCE)))); m_processMonThread = std::thread(&NetworkManagerImplementation::processMonitor, this, NM_PROCESS_MONITOR_INTERVAL_SEC); #if USE_TELEMETRY // Initialize Telemetry T2 for NwMgrPlugin @@ -142,12 +142,12 @@ namespace WPEFramework Configuration config; if(configLine.empty()) { - NMLOG_FATAL("config line : is empty !"); + SYSLOG(::WPEFramework::Logging::Shutdown, (_T("config line is empty"))); return Core::ERROR_GENERAL; } else { - NMLOG_INFO("Loading the incoming configuration : %s", configLine.c_str()); + SYSLOG(::WPEFramework::Logging::Startup, (_T("Loading incoming configuration"))); config.FromString(configLine); }