From 907aaf6dc5c82a4adb4a0d09bf51605822bfc808 Mon Sep 17 00:00:00 2001 From: HaseenaSainul Date: Wed, 22 May 2024 05:44:13 -0400 Subject: [PATCH] Logging: status changed from Startup to Activate and Shutdown to Deactivate --- BluetoothControl/BluetoothControl.cpp | 46 +++++++++---------- Dictionary/Dictionary.cpp | 2 +- IOConnector/IOConnector.cpp | 12 ++--- .../NetworkControlImplementation.cpp | 10 ++-- RemoteControl/RemoteAdministrator.h | 16 +++---- Streamer/Streamer.cpp | 2 +- .../AMLogic/VolumeControlPlatform.cpp | 4 +- WebPA/WebPAImplementation.cpp | 2 +- WebServer/WebServer.cpp | 2 +- 9 files changed, 48 insertions(+), 48 deletions(-) diff --git a/BluetoothControl/BluetoothControl.cpp b/BluetoothControl/BluetoothControl.cpp index 0937d0108..7ee8ee8e3 100644 --- a/BluetoothControl/BluetoothControl.cpp +++ b/BluetoothControl/BluetoothControl.cpp @@ -180,30 +180,30 @@ namespace Plugin { SaveController(service->PersistentPath(), controllerData); } - SYSLOG(Logging::Startup, (_T(" Name: %s"), info.Name().c_str())); + SYSLOG(Logging::Activate, (_T(" Name: %s"), info.Name().c_str())); if (info.Name() != info.ShortName()) { - SYSLOG(Logging::Startup, (_T(" ShortName %s"), info.ShortName().c_str())); + SYSLOG(Logging::Activate, (_T(" ShortName %s"), info.ShortName().c_str())); } - SYSLOG(Logging::Startup, (_T(" Version: %d"), info.Version())); - SYSLOG(Logging::Startup, (_T(" Address: %s"), info.Address().ToString().c_str())); - SYSLOG(Logging::Startup, (_T(" DeviceClass: 0x%06X"), info.DeviceClass())); - SYSLOG(Logging::Startup, (_T("%s Power: %s"), supported.IsPowered() ? _T("[true] ") : _T("[false]"), actuals.IsPowered() ? _T("on") : _T("off"))); - SYSLOG(Logging::Startup, (_T("%s Connectable: %s"), supported.IsConnectable() ? _T("[true] ") : _T("[false]"), actuals.IsConnectable() ? _T("on") : _T("off"))); - SYSLOG(Logging::Startup, (_T("%s FastConnectable: %s"), supported.IsFastConnectable() ? _T("[true] ") : _T("[false]"), actuals.IsFastConnectable() ? _T("on") : _T("off"))); - SYSLOG(Logging::Startup, (_T("%s Discoverable: %s"), supported.IsDiscoverable() ? _T("[true] ") : _T("[false]"), actuals.IsDiscoverable() ? _T("on") : _T("off"))); - SYSLOG(Logging::Startup, (_T("%s Bondable: %s"), supported.IsBondable() ? _T("[true] ") : _T("[false]"), actuals.IsBondable() ? _T("on") : _T("off"))); - SYSLOG(Logging::Startup, (_T("%s LinkSecurity: %s"), supported.HasLinkLevelSecurity() ? _T("[true] ") : _T("[false]"), actuals.HasLinkLevelSecurity() ? _T("on") : _T("off"))); - SYSLOG(Logging::Startup, (_T("%s SimplePairing: %s"), supported.HasSecureSimplePairing() ? _T("[true] ") : _T("[false]"), actuals.HasSecureSimplePairing() ? _T("on") : _T("off"))); - SYSLOG(Logging::Startup, (_T("%s BasicEnhancedRate: %s"), supported.HasBasicEnhancedRate() ? _T("[true] ") : _T("[false]"), actuals.HasBasicEnhancedRate() ? _T("on") : _T("off"))); - SYSLOG(Logging::Startup, (_T("%s HighSpeed: %s"), supported.HasHighSpeed() ? _T("[true] ") : _T("[false]"), actuals.HasHighSpeed() ? _T("on") : _T("off"))); - SYSLOG(Logging::Startup, (_T("%s LowEnergy: %s"), supported.HasLowEnergy() ? _T("[true] ") : _T("[false]"), actuals.HasLowEnergy() ? _T("on") : _T("off"))); - SYSLOG(Logging::Startup, (_T("%s Advertising: %s"), supported.IsAdvertising() ? _T("[true] ") : _T("[false]"), actuals.IsAdvertising() ? _T("on") : _T("off"))); - SYSLOG(Logging::Startup, (_T("%s SecureConnection: %s"), supported.HasSecureConnections() ? _T("[true] ") : _T("[false]"), actuals.HasSecureConnections() ? _T("on") : _T("off"))); - SYSLOG(Logging::Startup, (_T("%s DebugKeys: %s"), supported.HasDebugKeys() ? _T("[true] ") : _T("[false]"), actuals.HasDebugKeys() ? _T("on") : _T("off"))); - SYSLOG(Logging::Startup, (_T("%s Privacy: %s"), supported.HasPrivacy() ? _T("[true] ") : _T("[false]"), actuals.HasPrivacy() ? _T("on") : _T("off"))); - SYSLOG(Logging::Startup, (_T("%s Configuration: %s"), supported.HasConfiguration() ? _T("[true] ") : _T("[false]"), actuals.HasConfiguration() ? _T("on") : _T("off"))); - SYSLOG(Logging::Startup, (_T("%s StaticAddress: %s"), supported.HasStaticAddress() ? _T("[true] ") : _T("[false]"), actuals.HasStaticAddress() ? _T("on") : _T("off"))); + SYSLOG(Logging::Activate, (_T(" Version: %d"), info.Version())); + SYSLOG(Logging::Activate, (_T(" Address: %s"), info.Address().ToString().c_str())); + SYSLOG(Logging::Activate, (_T(" DeviceClass: 0x%06X"), info.DeviceClass())); + SYSLOG(Logging::Activate, (_T("%s Power: %s"), supported.IsPowered() ? _T("[true] ") : _T("[false]"), actuals.IsPowered() ? _T("on") : _T("off"))); + SYSLOG(Logging::Activate, (_T("%s Connectable: %s"), supported.IsConnectable() ? _T("[true] ") : _T("[false]"), actuals.IsConnectable() ? _T("on") : _T("off"))); + SYSLOG(Logging::Activate, (_T("%s FastConnectable: %s"), supported.IsFastConnectable() ? _T("[true] ") : _T("[false]"), actuals.IsFastConnectable() ? _T("on") : _T("off"))); + SYSLOG(Logging::Activate, (_T("%s Discoverable: %s"), supported.IsDiscoverable() ? _T("[true] ") : _T("[false]"), actuals.IsDiscoverable() ? _T("on") : _T("off"))); + SYSLOG(Logging::Activate, (_T("%s Bondable: %s"), supported.IsBondable() ? _T("[true] ") : _T("[false]"), actuals.IsBondable() ? _T("on") : _T("off"))); + SYSLOG(Logging::Activate, (_T("%s LinkSecurity: %s"), supported.HasLinkLevelSecurity() ? _T("[true] ") : _T("[false]"), actuals.HasLinkLevelSecurity() ? _T("on") : _T("off"))); + SYSLOG(Logging::Activate, (_T("%s SimplePairing: %s"), supported.HasSecureSimplePairing() ? _T("[true] ") : _T("[false]"), actuals.HasSecureSimplePairing() ? _T("on") : _T("off"))); + SYSLOG(Logging::Activate, (_T("%s BasicEnhancedRate: %s"), supported.HasBasicEnhancedRate() ? _T("[true] ") : _T("[false]"), actuals.HasBasicEnhancedRate() ? _T("on") : _T("off"))); + SYSLOG(Logging::Activate, (_T("%s HighSpeed: %s"), supported.HasHighSpeed() ? _T("[true] ") : _T("[false]"), actuals.HasHighSpeed() ? _T("on") : _T("off"))); + SYSLOG(Logging::Activate, (_T("%s LowEnergy: %s"), supported.HasLowEnergy() ? _T("[true] ") : _T("[false]"), actuals.HasLowEnergy() ? _T("on") : _T("off"))); + SYSLOG(Logging::Activate, (_T("%s Advertising: %s"), supported.IsAdvertising() ? _T("[true] ") : _T("[false]"), actuals.IsAdvertising() ? _T("on") : _T("off"))); + SYSLOG(Logging::Activate, (_T("%s SecureConnection: %s"), supported.HasSecureConnections() ? _T("[true] ") : _T("[false]"), actuals.HasSecureConnections() ? _T("on") : _T("off"))); + SYSLOG(Logging::Activate, (_T("%s DebugKeys: %s"), supported.HasDebugKeys() ? _T("[true] ") : _T("[false]"), actuals.HasDebugKeys() ? _T("on") : _T("off"))); + SYSLOG(Logging::Activate, (_T("%s Privacy: %s"), supported.HasPrivacy() ? _T("[true] ") : _T("[false]"), actuals.HasPrivacy() ? _T("on") : _T("off"))); + SYSLOG(Logging::Activate, (_T("%s Configuration: %s"), supported.HasConfiguration() ? _T("[true] ") : _T("[false]"), actuals.HasConfiguration() ? _T("on") : _T("off"))); + SYSLOG(Logging::Activate, (_T("%s StaticAddress: %s"), supported.HasStaticAddress() ? _T("[true] ") : _T("[false]"), actuals.HasStaticAddress() ? _T("on") : _T("off"))); if (_config.ContinuousBackgroundScan.IsSet() == true) { Connector().ContinuousBackgroundScan(_config.ContinuousBackgroundScan.Value()); @@ -804,7 +804,7 @@ namespace Plugin { if (Core::File(devicePath).Exists() == false) { if (Core::Directory(devicePath.c_str()).CreatePath() == false) { - SYSLOG(Logging::Startup, (_T("Failed to create persistent storage folder '%s'\n"), devicePath.c_str())); + SYSLOG(Logging::Activate, (_T("Failed to create persistent storage folder '%s'\n"), devicePath.c_str())); } } else { Bluetooth::LinkKeys lks; @@ -816,7 +816,7 @@ namespace Plugin { if (LoadDevice(dir.Current(), lks, ltks, irks) != Core::ERROR_NONE) { TRACE(Trace::Error, (_T("Failed to load device %s"), dir.Name().c_str())); } else { - SYSLOG(Logging::Startup, (_T("Loaded device: %s"), Core::File::FileName(dir.Name()).c_str())); + SYSLOG(Logging::Activate, (_T("Loaded device: %s"), Core::File::FileName(dir.Name()).c_str())); } } diff --git a/Dictionary/Dictionary.cpp b/Dictionary/Dictionary.cpp index 41a1f6f9f..89af24f33 100644 --- a/Dictionary/Dictionary.cpp +++ b/Dictionary/Dictionary.cpp @@ -149,7 +149,7 @@ namespace Plugin { NameSpace dictionary; CreateExternalDictionary(EMPTY_STRING, dictionary); if (dictionary.IElement::ToFile(dictionaryFile) == false) { - SYSLOG(Logging::Shutdown, (_T("Error occured while trying to save dictionary data to file!"))); + SYSLOG(Logging::Deactivate, (_T("Error occured while trying to save dictionary data to file!"))); } } } diff --git a/IOConnector/IOConnector.cpp b/IOConnector/IOConnector.cpp index 679706a9d..7303d6917 100644 --- a/IOConnector/IOConnector.cpp +++ b/IOConnector/IOConnector.cpp @@ -166,7 +166,7 @@ namespace Plugin } if (_pins.find(pin->Identifier()) != _pins.end()) { - SYSLOG(Logging::Startup, (_T("Pin [%d] defined multiple times, only the first definitions is used !!"), pin->Identifier() & 0xFFFF)); + SYSLOG(Logging::Activate, (_T("Pin [%d] defined multiple times, only the first definitions is used !!"), pin->Identifier() & 0xFFFF)); } else { auto newEntry = _pins.emplace(std::piecewise_construct, @@ -179,10 +179,10 @@ namespace Plugin Core::JSON::ArrayType::Iterator handler(index.Current().Handlers.Elements()); if (mode == 0) { - SYSLOG(Logging::Startup, (_T("Pin [%d] defined as output but handlers associated with it!"), pin->Identifier() & 0xFFFF)); + SYSLOG(Logging::Activate, (_T("Pin [%d] defined as output but handlers associated with it!"), pin->Identifier() & 0xFFFF)); } else if (mode == 1) { - SYSLOG(Logging::Startup, (_T("Handlers requires input pins where BOTH states are reported. Error on pin [%d]."), pin->Identifier() & 0xFFFF)); + SYSLOG(Logging::Activate, (_T("Handlers requires input pins where BOTH states are reported. Error on pin [%d]."), pin->Identifier() & 0xFFFF)); } while (handler.Next() == true) { @@ -193,7 +193,7 @@ namespace Plugin uint32_t end = info.End.Value(); if (start > end) { - SYSLOG(Logging::Startup, (_T("Handler [%s] on pin [%d] has an incorrect interval [%d-%d]."), info.Name.Value().c_str(), pin->Identifier() & 0xFFFF, start, end)); + SYSLOG(Logging::Activate, (_T("Handler [%s] on pin [%d] has an incorrect interval [%d-%d]."), info.Name.Value().c_str(), pin->Identifier() & 0xFFFF, start, end)); } else { std::list< std::pair >::iterator loop(intervals.begin()); @@ -205,10 +205,10 @@ namespace Plugin } if (loop != intervals.end()) { - SYSLOG(Logging::Startup, (_T("Interval conflict on pin [%d], at handler [%s]."), pin->Identifier() & 0xFFFF, info.Name.Value().c_str())); + SYSLOG(Logging::Activate, (_T("Interval conflict on pin [%d], at handler [%s]."), pin->Identifier() & 0xFFFF, info.Name.Value().c_str())); } else if (newEntry.first->second.Add(_service, info.Name.Value(), info.Config.Value(), start, end) == false) { - SYSLOG(Logging::Startup, (_T("Could not instantiate handler [%s] on pin [%d]."), info.Name.Value().c_str(), pin->Identifier() & 0xFFFF)); + SYSLOG(Logging::Activate, (_T("Could not instantiate handler [%s] on pin [%d]."), info.Name.Value().c_str(), pin->Identifier() & 0xFFFF)); } else { intervals.push_back(std::pair(start,end)); diff --git a/NetworkControl/NetworkControlImplementation.cpp b/NetworkControl/NetworkControlImplementation.cpp index 77ed90d3c..bffea20eb 100644 --- a/NetworkControl/NetworkControlImplementation.cpp +++ b/NetworkControl/NetworkControlImplementation.cpp @@ -743,7 +743,7 @@ namespace Plugin Core::File dnsFile(_dnsFile); if (dnsFile.Exists() == false) { if (dnsFile.Create() == false) { - SYSLOG(Logging::Startup, (_T("Could not create DNS configuration file [%s]"), _dnsFile.c_str())); + SYSLOG(Logging::Activate, (_T("Could not create DNS configuration file [%s]"), _dnsFile.c_str())); } else { dnsFile.Close(); @@ -766,7 +766,7 @@ namespace Plugin if (_persistentStoragePath.empty() == false) { if (Core::Directory(_persistentStoragePath.c_str()).CreatePath() == false) { _persistentStoragePath.clear(); - SYSLOG(Logging::Startup, (_T("Failed to create storage for network info: %s"), _persistentStoragePath.c_str())); + SYSLOG(Logging::Activate, (_T("Failed to create storage for network info: %s"), _persistentStoragePath.c_str())); } _persistentStoragePath += _T("Data.json"); } @@ -792,7 +792,7 @@ namespace Plugin Core::AdapterIterator hardware(interfaceName); if (hardware.IsValid() == false) { - SYSLOG(Logging::Startup, (_T("Interface [%s], not available"), interfaceName.c_str())); + SYSLOG(Logging::Activate, (_T("Interface [%s], not available"), interfaceName.c_str())); } else { DHCPEngine& engine = AddInterface(hardware, index.Current()); if (hardware.IsUp() == false) { @@ -1014,7 +1014,7 @@ namespace Plugin uint8_t buffer[DHCPClient::MACSize]; Core::FromHexString(entry.MAC.IsNull() ? info.MAC.Value() : entry.MAC.Value(), buffer, sizeof(buffer), ':'); if (hardware.MACAddress(buffer) != Core::ERROR_NONE) { - SYSLOG(Logging::Startup, (_T("Interface [%s], could not set requested MAC address"), interfaceName.c_str())); + SYSLOG(Logging::Activate, (_T("Interface [%s], could not set requested MAC address"), interfaceName.c_str())); } } @@ -1377,7 +1377,7 @@ namespace Plugin ::memcpy(&(file[offset]), data.c_str(), data.length()); file.Sync(); - SYSLOG(Logging::Startup, (_T("DNS functionality updated [%s]"), _dnsFile.c_str())); + SYSLOG(Logging::Activate, (_T("DNS functionality updated [%s]"), _dnsFile.c_str())); } } diff --git a/RemoteControl/RemoteAdministrator.h b/RemoteControl/RemoteAdministrator.h index 825c452a0..80dc0667d 100644 --- a/RemoteControl/RemoteAdministrator.h +++ b/RemoteControl/RemoteAdministrator.h @@ -430,9 +430,9 @@ namespace Remotes { if (result != Core::ERROR_NONE) { if (callback == nullptr) { - SYSLOG(Logging::Startup, (_T("Failed to initialize %s, error [%d]"), (*index)->Name(), result)); + SYSLOG(Logging::Activate, (_T("Failed to initialize %s, error [%d]"), (*index)->Name(), result)); } else { - SYSLOG(Logging::Shutdown, (_T("Failed to deinitialize %s, error [%d]"), (*index)->Name(), result)); + SYSLOG(Logging::Deactivate, (_T("Failed to deinitialize %s, error [%d]"), (*index)->Name(), result)); } } @@ -455,9 +455,9 @@ namespace Remotes { if (result != Core::ERROR_NONE) { if (callback == nullptr) { - SYSLOG(Logging::Startup, (_T("Failed to initialize %s, error [%d]"), (*index)->Name(), result)); + SYSLOG(Logging::Activate, (_T("Failed to initialize %s, error [%d]"), (*index)->Name(), result)); } else { - SYSLOG(Logging::Shutdown, (_T("Failed to deinitialize %s, error [%d]"), (*index)->Name(), result)); + SYSLOG(Logging::Deactivate, (_T("Failed to deinitialize %s, error [%d]"), (*index)->Name(), result)); } } @@ -480,9 +480,9 @@ namespace Remotes { if (result != Core::ERROR_NONE) { if (callback == nullptr) { - SYSLOG(Logging::Startup, (_T("Failed to initialize %s, error [%d]"), (*index)->Name(), result)); + SYSLOG(Logging::Activate, (_T("Failed to initialize %s, error [%d]"), (*index)->Name(), result)); } else { - SYSLOG(Logging::Shutdown, (_T("Failed to deinitialize %s, error [%d]"), (*index)->Name(), result)); + SYSLOG(Logging::Deactivate, (_T("Failed to deinitialize %s, error [%d]"), (*index)->Name(), result)); } } @@ -505,9 +505,9 @@ namespace Remotes { if (result != Core::ERROR_NONE) { if (callback == nullptr) { - SYSLOG(Logging::Startup, (_T("Failed to initialize %s, error [%d]"), (*index)->Name(), result)); + SYSLOG(Logging::Activate, (_T("Failed to initialize %s, error [%d]"), (*index)->Name(), result)); } else { - SYSLOG(Logging::Shutdown, (_T("Failed to deinitialize %s, error [%d]"), (*index)->Name(), result)); + SYSLOG(Logging::Deactivate, (_T("Failed to deinitialize %s, error [%d]"), (*index)->Name(), result)); } } diff --git a/Streamer/Streamer.cpp b/Streamer/Streamer.cpp index f84625da1..5775e1e6a 100644 --- a/Streamer/Streamer.cpp +++ b/Streamer/Streamer.cpp @@ -67,7 +67,7 @@ namespace Plugin { PluginHost::ISubSystem* subSystem = service->SubSystems(); if (subSystem != nullptr) { if (subSystem->IsActive(PluginHost::ISubSystem::STREAMING) == true) { - SYSLOG(Logging::Startup, (_T("Streamer is not defined as External !!"))); + SYSLOG(Logging::Activate, (_T("Streamer is not defined as External !!"))); } else { subSystem->Set(PluginHost::ISubSystem::STREAMING, nullptr); } diff --git a/VolumeControl/AMLogic/VolumeControlPlatform.cpp b/VolumeControl/AMLogic/VolumeControlPlatform.cpp index f708ca811..a8f224871 100644 --- a/VolumeControl/AMLogic/VolumeControlPlatform.cpp +++ b/VolumeControl/AMLogic/VolumeControlPlatform.cpp @@ -40,9 +40,9 @@ namespace Plugin { { audio_hw_load_interface(&_device); if(_device != nullptr && _device->init_check(_device) == 0){ - SYSLOG(Logging::Startup, (_T("Initialized audio_client interface."))); + SYSLOG(Logging::Activate, (_T("Initialized audio_client interface."))); } else { - SYSLOG(Logging::Startup, (_T("Failed to initialize audio_client interface."))); + SYSLOG(Logging::Activate, (_T("Failed to initialize audio_client interface."))); _device = nullptr; } } diff --git a/WebPA/WebPAImplementation.cpp b/WebPA/WebPAImplementation.cpp index 558beb6bb..36d4d6dd6 100644 --- a/WebPA/WebPAImplementation.cpp +++ b/WebPA/WebPAImplementation.cpp @@ -201,7 +201,7 @@ class WebPAImplementation : _adminLock.Unlock(); if (clientSize == 0) { - SYSLOG(Logging::Startup, (_T("No WebPA Clients registered, please wait for sometime to get client ready"))); + SYSLOG(Logging::Activate, (_T("No WebPA Clients registered, please wait for sometime to get client ready"))); } return result; diff --git a/WebServer/WebServer.cpp b/WebServer/WebServer.cpp index 3a2ef9160..ed4eb7ebc 100644 --- a/WebServer/WebServer.cpp +++ b/WebServer/WebServer.cpp @@ -89,7 +89,7 @@ namespace Plugin { PluginHost::ISubSystem* subSystem = service->SubSystems(); if (subSystem != nullptr) { if (subSystem->IsActive(PluginHost::ISubSystem::WEBSOURCE) == true) { - SYSLOG(Logging::Startup, (_T("WebSource is not defined as External !!"))); + SYSLOG(Logging::Activate, (_T("WebSource is not defined as External !!"))); } else { subSystem->Set(PluginHost::ISubSystem::WEBSOURCE, nullptr);