Skip to content

Commit

Permalink
Logging: status changed from Startup to Activate and Shutdown to Deac…
Browse files Browse the repository at this point in the history
…tivate
  • Loading branch information
HaseenaSainul committed Jul 1, 2024
1 parent 3240b71 commit 9fec30a
Show file tree
Hide file tree
Showing 9 changed files with 48 additions and 48 deletions.
46 changes: 23 additions & 23 deletions BluetoothControl/BluetoothControl.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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());
Expand Down Expand Up @@ -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;
Expand All @@ -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()));
}
}

Expand Down
2 changes: 1 addition & 1 deletion Dictionary/Dictionary.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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!")));
}
}
}
Expand Down
12 changes: 6 additions & 6 deletions IOConnector/IOConnector.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand All @@ -179,10 +179,10 @@ namespace Plugin
Core::JSON::ArrayType<Config::Pin::Handler>::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) {
Expand All @@ -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<uint32_t, uint32_t> >::iterator loop(intervals.begin());
Expand All @@ -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<uint32_t,uint32_t>(start,end));
Expand Down
10 changes: 5 additions & 5 deletions NetworkControl/NetworkControlImplementation.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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();

Expand All @@ -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");
}
Expand All @@ -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) {
Expand Down Expand Up @@ -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()));
}
}

Expand Down Expand Up @@ -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()));
}
}

Expand Down
16 changes: 8 additions & 8 deletions RemoteControl/RemoteAdministrator.h
Original file line number Diff line number Diff line change
Expand Up @@ -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));
}
}

Expand All @@ -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));
}
}

Expand All @@ -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));
}
}

Expand All @@ -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));
}
}

Expand Down
2 changes: 1 addition & 1 deletion Streamer/Streamer.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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);
}
Expand Down
4 changes: 2 additions & 2 deletions VolumeControl/AMLogic/VolumeControlPlatform.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}
}
Expand Down
2 changes: 1 addition & 1 deletion WebPA/WebPAImplementation.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
2 changes: 1 addition & 1 deletion WebServer/WebServer.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down

0 comments on commit 9fec30a

Please sign in to comment.