From 50c9037bfbd14fe3c46d4caadc0a040ef25a91de Mon Sep 17 00:00:00 2001 From: Ingo Huerner Date: Thu, 4 Dec 2014 20:11:11 +0100 Subject: Rework of DLT messages --- src/persistence_client_library.c | 45 +++++++++------ src/persistence_client_library_backup_filelist.c | 32 +++++------ src/persistence_client_library_custom_loader.c | 70 ++++++++++++------------ src/persistence_client_library_db_access.c | 44 +++++++-------- src/persistence_client_library_dbus_cmd.c | 44 +++++++-------- src/persistence_client_library_dbus_service.c | 38 ++++++------- src/persistence_client_library_file.c | 38 ++++++------- src/persistence_client_library_handle.c | 4 +- src/persistence_client_library_key.c | 14 ++--- src/persistence_client_library_lc_interface.c | 18 +++--- src/persistence_client_library_pas_interface.c | 34 ++++++------ src/persistence_client_library_prct_access.c | 10 ++-- test/persistence_client_library_test.c | 1 - 13 files changed, 200 insertions(+), 192 deletions(-) diff --git a/src/persistence_client_library.c b/src/persistence_client_library.c index 7dff4f5..f0f02fb 100644 --- a/src/persistence_client_library.c +++ b/src/persistence_client_library.c @@ -86,12 +86,12 @@ void doInitAppcheck(const char* appName) if(access(rctFilename, F_OK) == 0) { gAppCheckFlag = 1; // "trusted" application - DLT_LOG(gPclDLTContext, DLT_LOG_INFO, DLT_STRING("pclInitLibrary - app check: "), DLT_STRING(appName), DLT_STRING("is a trusted application")); + DLT_LOG(gPclDLTContext, DLT_LOG_INFO, DLT_STRING("initLibrary - app check: "), DLT_STRING(appName), DLT_STRING("trusted app")); } else { gAppCheckFlag = 0; // currently not a "trusted" application - DLT_LOG(gPclDLTContext, DLT_LOG_INFO, DLT_STRING("pclInitLibrary - app check: "), DLT_STRING(appName), DLT_STRING("is NOT a trusted application")); + DLT_LOG(gPclDLTContext, DLT_LOG_INFO, DLT_STRING("initLibrary - app check: "), DLT_STRING(appName), DLT_STRING("NOT trusted app")); } #endif } @@ -130,14 +130,14 @@ int pclInitLibrary(const char* appName, int shutdownMode) if(gPclInitCounter == 0) { DLT_REGISTER_CONTEXT(gPclDLTContext,"PCL","Context for persistence client library logging"); - DLT_LOG(gPclDLTContext, DLT_LOG_INFO, DLT_STRING("pclInitLibrary => I N I T Persistence Client Library - "), DLT_STRING(appName), + DLT_LOG(gPclDLTContext, DLT_LOG_INFO, DLT_STRING("pclInitLibrary => INIT PCL - "), DLT_STRING(appName), DLT_STRING("- init counter: "), DLT_INT(gPclInitCounter) ); rval = private_pclInitLibrary(appName, shutdownMode); } else { - DLT_LOG(gPclDLTContext, DLT_LOG_INFO, DLT_STRING("pclInitLibrary - I N I T Persistence Client Library - "), DLT_STRING(gAppId), + DLT_LOG(gPclDLTContext, DLT_LOG_INFO, DLT_STRING("pclInitLibrary - INIT PCL - "), DLT_STRING(gAppId), DLT_STRING("- ONLY INCREMENT init counter: "), DLT_INT(gPclInitCounter) ); } @@ -176,7 +176,7 @@ static int private_pclInitLibrary(const char* appName, int shutdownMode) if(readBlacklistConfigFile(blacklistPath) == -1) { - DLT_LOG(gPclDLTContext, DLT_LOG_WARN, DLT_STRING("pclInitLibrary - failed to access blacklist:"), DLT_STRING(blacklistPath)); + DLT_LOG(gPclDLTContext, DLT_LOG_DEBUG, DLT_STRING("initLibrary - Err access blacklist:"), DLT_STRING(blacklistPath)); } #if USE_XSTRACE_PERS @@ -184,7 +184,7 @@ static int private_pclInitLibrary(const char* appName, int shutdownMode) #endif if(setup_dbus_mainloop() == -1) { - DLT_LOG(gPclDLTContext, DLT_LOG_ERROR, DLT_STRING("pclInitLibrary - Failed to setup main loop")); + DLT_LOG(gPclDLTContext, DLT_LOG_ERROR, DLT_STRING("initLibrary - Failed to setup main loop")); pthread_mutex_unlock(&gDbusPendingRegMtx); return EPERS_DBUS_MAINLOOP; } @@ -198,7 +198,7 @@ static int private_pclInitLibrary(const char* appName, int shutdownMode) // register for lifecycle dbus messages if(register_lifecycle(shutdownMode) == -1) { - DLT_LOG(gPclDLTContext, DLT_LOG_ERROR, DLT_STRING("pclInitLibrary => Failed to register to lifecycle dbus interface")); + DLT_LOG(gPclDLTContext, DLT_LOG_ERROR, DLT_STRING("initLibrary => Failed reg to LC dbus interface")); pthread_mutex_unlock(&gDbusPendingRegMtx); return EPERS_REGISTER_LIFECYCLE; } @@ -207,16 +207,16 @@ static int private_pclInitLibrary(const char* appName, int shutdownMode) DLT_LOG(gPclDLTContext, DLT_LOG_INFO, DLT_STRING("PAS interface is enabled!!")); if(register_pers_admin_service() == -1) { - DLT_LOG(gPclDLTContext, DLT_LOG_ERROR, DLT_STRING("pclInitLibrary - Failed to register to pers admin dbus interface")); + DLT_LOG(gPclDLTContext, DLT_LOG_ERROR, DLT_STRING("initLibrary - Failed reg to PAS dbus interface")); pthread_mutex_unlock(&gDbusPendingRegMtx); return EPERS_REGISTER_ADMIN; } else { - DLT_LOG(gPclDLTContext, DLT_LOG_INFO, DLT_STRING("pclInitLibrary - Successfully established IPC protocol for PCL.")); + DLT_LOG(gPclDLTContext, DLT_LOG_INFO, DLT_STRING("initLibrary - Successfully established IPC protocol for PCL.")); } #else - DLT_LOG(gPclDLTContext, DLT_LOG_WARN, DLT_STRING("PAS interface is not enabled, enable with \"./configure --enable-pasinterface\"")); + DLT_LOG(gPclDLTContext, DLT_LOG_DEBUG, DLT_STRING("PAS interface not enabled, enable with \"./configure --enable-pasinterface\"")); #endif // load custom plugins @@ -251,7 +251,7 @@ int pclDeinitLibrary(void) if(gPclInitCounter == 1) { - DLT_LOG(gPclDLTContext, DLT_LOG_INFO, DLT_STRING("pclDeinitLibrary - D E I N I T client library - "), DLT_STRING(gAppId), + DLT_LOG(gPclDLTContext, DLT_LOG_INFO, DLT_STRING("pclDeinitLibrary - DEINIT client lib - "), DLT_STRING(gAppId), DLT_STRING("- init counter: "), DLT_INT(gPclInitCounter)); rval = private_pclDeinitLibrary(); @@ -260,13 +260,13 @@ int pclDeinitLibrary(void) } else if(gPclInitCounter > 1) { - DLT_LOG(gPclDLTContext, DLT_LOG_INFO, DLT_STRING("pclDeinitLibrary - D E I N I T client library - "), DLT_STRING(gAppId), + DLT_LOG(gPclDLTContext, DLT_LOG_INFO, DLT_STRING("pclDeinitLibrary - DEINIT client lib - "), DLT_STRING(gAppId), DLT_STRING("- ONLY DECREMENT init counter: "), DLT_INT(gPclInitCounter)); gPclInitCounter--; // decrement init counter } else { - DLT_LOG(gPclDLTContext, DLT_LOG_WARN, DLT_STRING("pclDeinitLibrary - D E I N I T client library - "), DLT_STRING(gAppId), + DLT_LOG(gPclDLTContext, DLT_LOG_WARN, DLT_STRING("pclDeinitLibrary - DEINIT client lib - "), DLT_STRING(gAppId), DLT_STRING("- NOT INITIALIZED: ")); rval = EPERS_NOT_INITIALIZED; } @@ -297,11 +297,11 @@ static int private_pclDeinitLibrary(void) rval = unregister_pers_admin_service(); if(0 != rval) { - DLT_LOG(gPclDLTContext, DLT_LOG_ERROR, DLT_STRING("pclDeinitLibrary - Failed to de-initialize IPC protocol for PCL.")); + DLT_LOG(gPclDLTContext, DLT_LOG_ERROR, DLT_STRING("pclDeinitLibrary - Err to de-initialize IPC protocol for PCL.")); } else { - DLT_LOG(gPclDLTContext, DLT_LOG_INFO, DLT_STRING("pclDeinitLibrary - Successfully de-initialized IPC protocol for PCL.")); + DLT_LOG(gPclDLTContext, DLT_LOG_INFO, DLT_STRING("pclDeinitLibrary - Succ de-initialized IPC protocol for PCL.")); } #endif @@ -353,12 +353,12 @@ int pclLifecycleSet(int shutdown) { if(shutdown == PCL_SHUTDOWN) { - DLT_LOG(gPclDLTContext, DLT_LOG_INFO, DLT_STRING("pclLifecycleSet - PCL_SHUTDOWN -"), DLT_STRING(gAppId)); + DLT_LOG(gPclDLTContext, DLT_LOG_INFO, DLT_STRING("lifecycleSet - PCL_SHUTDOWN -"), DLT_STRING(gAppId)); process_prepare_shutdown(Shutdown_Partial); // close all db's and fd's and block access } else if(shutdown == PCL_SHUTDOWN_CANCEL) { - DLT_LOG(gPclDLTContext, DLT_LOG_INFO, DLT_STRING("pclLifecycleSet - PCL_SHUTDOWN_CANCEL -"), DLT_STRING(gAppId), DLT_STRING(" Cancel Counter - "), DLT_INT(gCancelCounter)); + DLT_LOG(gPclDLTContext, DLT_LOG_INFO, DLT_STRING("lifecycleSet - PCL_SHUTDOWN_CANCEL -"), DLT_STRING(gAppId), DLT_STRING(" Cancel Counter - "), DLT_INT(gCancelCounter)); if(gCancelCounter < Shutdown_MaxCount) { pers_unlock_access(); @@ -383,3 +383,14 @@ int pclLifecycleSet(int shutdown) +void pcl_test_send_shutdown_command() +{ + const char* command = {"snmpset -v1 -c public 134.86.58.225 iso.3.6.1.4.1.1909.22.1.1.1.5.1 i 1"}; + + if(system(command) == -1) + { + printf("Failed to send shutdown command!!!!\n"); + } +} + + diff --git a/src/persistence_client_library_backup_filelist.c b/src/persistence_client_library_backup_filelist.c index 66918ee..f6c3cf2 100644 --- a/src/persistence_client_library_backup_filelist.c +++ b/src/persistence_client_library_backup_filelist.c @@ -153,7 +153,7 @@ int readBlacklistConfigFile(const char* filename) if(fd == -1) { - DLT_LOG(gPclDLTContext, DLT_LOG_WARN, DLT_STRING("readBlacklistConfigFile - Error file open"), DLT_STRING(filename), DLT_STRING(strerror(errno)) ); + DLT_LOG(gPclDLTContext, DLT_LOG_WARN, DLT_STRING("blacklist - Err file open"), DLT_STRING(filename), DLT_STRING(strerror(errno)) ); return EPERS_COMMON; } @@ -163,7 +163,7 @@ int readBlacklistConfigFile(const char* filename) if(configFileMap == MAP_FAILED) { close(fd); - DLT_LOG(gPclDLTContext, DLT_LOG_ERROR, DLT_STRING("readBlacklistConfigFile - Error mapping the file:"), DLT_STRING(filename), DLT_STRING(strerror(errno)) ); + DLT_LOG(gPclDLTContext, DLT_LOG_ERROR, DLT_STRING("blacklist - Err mapping file:"), DLT_STRING(filename), DLT_STRING(strerror(errno)) ); return EPERS_COMMON; } @@ -179,19 +179,19 @@ int readBlacklistConfigFile(const char* filename) } else { - DLT_LOG(gPclDLTContext, DLT_LOG_WARN, DLT_STRING("readBlacklistConfigFile - Error config file size is 0:"), DLT_STRING(filename)); + DLT_LOG(gPclDLTContext, DLT_LOG_WARN, DLT_STRING("blacklist - Err config file size is 0:"), DLT_STRING(filename)); return EPERS_COMMON; } } else { - DLT_LOG(gPclDLTContext, DLT_LOG_WARN, DLT_STRING("readBlacklistConfigFile - failed to stat() config file:"), DLT_STRING(filename)); + DLT_LOG(gPclDLTContext, DLT_LOG_DEBUG, DLT_STRING("blacklist - failed to stat() conf file:"), DLT_STRING(filename)); return EPERS_COMMON; } } else { - DLT_LOG(gPclDLTContext, DLT_LOG_WARN, DLT_STRING("readBlacklistConfigFile - config file name is NULL:")); + DLT_LOG(gPclDLTContext, DLT_LOG_WARN, DLT_STRING("blacklist - config file name is NULL:")); rval = EPERS_COMMON; } @@ -373,7 +373,7 @@ int pclCreateFile(const char* path, int chached) } else { - DLT_LOG(gPclDLTContext, DLT_LOG_ERROR, DLT_STRING("pclCreateFile - no valid path to create: "), DLT_STRING(path) ); + DLT_LOG(gPclDLTContext, DLT_LOG_ERROR, DLT_STRING("createFile - no valid path to create: "), DLT_STRING(path) ); } return handle; @@ -399,7 +399,7 @@ int pclVerifyConsistency(const char* origPath, const char* backupPath, const cha // ************************************************* if((backupAvail == 0) && (csumAvail == 0) ) { - DLT_LOG(gPclDLTContext, DLT_LOG_INFO, DLT_STRING("pclVerifyConsistency - there is a backup file AND a checksum")); + DLT_LOG(gPclDLTContext, DLT_LOG_INFO, DLT_STRING("verifyConsist- there is a backup file AND csum")); // calculate checksum form backup file fdBackup = open(backupPath, O_RDONLY); if(fdBackup != -1) @@ -458,7 +458,7 @@ int pclVerifyConsistency(const char* origPath, const char* backupPath, const cha // ************************************************* else if(csumAvail == 0) { - DLT_LOG(gPclDLTContext, DLT_LOG_INFO, DLT_STRING("pclVerifyConsistency - there is ONLY a checksum file")); + DLT_LOG(gPclDLTContext, DLT_LOG_INFO, DLT_STRING("verifyConsist - there is ONLY a csum file")); fdCsum = open(csumPath, O_RDONLY); if(fdCsum != -1) @@ -466,7 +466,7 @@ int pclVerifyConsistency(const char* origPath, const char* backupPath, const cha readSize = read(fdCsum, csumBuf, ChecksumBufSize); if(readSize <= 0) { - DLT_LOG(gPclDLTContext, DLT_LOG_ERROR, DLT_STRING("pclVerifyConsistency - read checksum: invalid readSize")); + DLT_LOG(gPclDLTContext, DLT_LOG_ERROR, DLT_STRING("verifyConsist - read csum: invalid readSize")); } close(fdCsum); @@ -500,7 +500,7 @@ int pclVerifyConsistency(const char* origPath, const char* backupPath, const cha // ************************************************* else if(backupAvail == 0) { - DLT_LOG(gPclDLTContext, DLT_LOG_INFO, DLT_STRING("pclVerifyConsistency - there is ONLY a backup file")); + DLT_LOG(gPclDLTContext, DLT_LOG_INFO, DLT_STRING("verifyConsist - there is ONLY a backup file")); // calculate checksum form backup file fdBackup = open(backupPath, O_RDONLY); @@ -561,7 +561,7 @@ int pclRecoverFromBackup(int backupFd, const char* original) // copy data from one file to another if(pclBackupDoFileCopy(backupFd, handle) == -1) { - DLT_LOG(gPclDLTContext, DLT_LOG_ERROR, DLT_STRING("pclRecoverFromBackup - couldn't write whole buffer")); + DLT_LOG(gPclDLTContext, DLT_LOG_ERROR, DLT_STRING("rBackup - couldn't write whole buffer")); } } @@ -592,13 +592,13 @@ int pclCreateBackup(const char* dstPath, int srcfd, const char* csumPath, const int csumSize = strlen(csumBuf); if(write(csfd, csumBuf, csumSize) != csumSize) { - DLT_LOG(gPclDLTContext, DLT_LOG_ERROR, DLT_STRING("pclCreateBackup - failed to write checksum to file")); + DLT_LOG(gPclDLTContext, DLT_LOG_ERROR, DLT_STRING("cBackup - failed write csum to file")); } close(csfd); } else { - DLT_LOG(gPclDLTContext, DLT_LOG_ERROR, DLT_STRING("pclCreateBackup - failed to create checksum file:"), DLT_STRING(strerror(errno)) ); + DLT_LOG(gPclDLTContext, DLT_LOG_ERROR, DLT_STRING("cBackup - failed create csum file:"), DLT_STRING(strerror(errno)) ); } // create backup file, user and group has read/write permission, others have read permission @@ -613,12 +613,12 @@ int pclCreateBackup(const char* dstPath, int srcfd, const char* csumPath, const // copy data from one file to another if((readSize = pclBackupDoFileCopy(srcfd, dstFd)) == -1) { - DLT_LOG(gPclDLTContext, DLT_LOG_ERROR, DLT_STRING("pclCreateBackup - error copying file")); + DLT_LOG(gPclDLTContext, DLT_LOG_ERROR, DLT_STRING("cBackup - err copying file")); } if(close(dstFd) == -1) { - DLT_LOG(gPclDLTContext, DLT_LOG_ERROR, DLT_STRING("pclCreateBackup - error closing fd")); + DLT_LOG(gPclDLTContext, DLT_LOG_ERROR, DLT_STRING("cBackup - err closing fd")); } // set back to the position @@ -626,7 +626,7 @@ int pclCreateBackup(const char* dstPath, int srcfd, const char* csumPath, const } else { - DLT_LOG(gPclDLTContext, DLT_LOG_ERROR, DLT_STRING("pclCreateBackup - failed to open backup file"), + DLT_LOG(gPclDLTContext, DLT_LOG_ERROR, DLT_STRING("cBackup - failed open backup file"), DLT_STRING(dstPath), DLT_STRING(strerror(errno))); } diff --git a/src/persistence_client_library_custom_loader.c b/src/persistence_client_library_custom_loader.c index 134b893..fdbae94 100644 --- a/src/persistence_client_library_custom_loader.c +++ b/src/persistence_client_library_custom_loader.c @@ -161,7 +161,7 @@ PersistenceCustomLibs_e custom_client_name_to_id(const char* lib_name, int subst } else { - DLT_LOG(gPclDLTContext, DLT_LOG_ERROR, DLT_STRING("custom_client_name_to_id - id not found for lib:"), DLT_STRING(lib_name)); + DLT_LOG(gPclDLTContext, DLT_LOG_ERROR, DLT_STRING("customNameToId - id not found lib:"), DLT_STRING(lib_name)); } } else @@ -196,7 +196,7 @@ PersistenceCustomLibs_e custom_client_name_to_id(const char* lib_name, int subst } else { - DLT_LOG(gPclDLTContext, DLT_LOG_ERROR, DLT_STRING("custom_client_name_to_id - id not found for lib:"), DLT_STRING(lib_name)); + DLT_LOG(gPclDLTContext, DLT_LOG_ERROR, DLT_STRING("customNameToId - id not found lib:"), DLT_STRING(lib_name)); } } @@ -230,11 +230,11 @@ int get_custom_libraries() int i = 0; int fd = open(filename, O_RDONLY); - DLT_LOG(gPclDLTContext, DLT_LOG_INFO, DLT_STRING("get_custom_libraries - load config - "), DLT_STRING(filename)); + DLT_LOG(gPclDLTContext, DLT_LOG_INFO, DLT_STRING("gCusLib - load config - "), DLT_STRING(filename)); if (fd == -1) { - DLT_LOG(gPclDLTContext, DLT_LOG_ERROR, DLT_STRING("get_custom_libraries - Error file open: "), + DLT_LOG(gPclDLTContext, DLT_LOG_ERROR, DLT_STRING("gCusLib - Err file open: "), DLT_STRING(filename), DLT_STRING("err msg: "), DLT_STRING(strerror(errno)) ); return EPERS_COMMON; } @@ -245,7 +245,7 @@ int get_custom_libraries() if (customConfFileMap == MAP_FAILED) { close(fd); - DLT_LOG(gPclDLTContext, DLT_LOG_ERROR, DLT_STRING("get_custom_libraries - Error mapping the file")); + DLT_LOG(gPclDLTContext, DLT_LOG_ERROR, DLT_STRING("gCusLib - Err mapping file")); return EPERS_COMMON; } @@ -281,19 +281,19 @@ int get_custom_libraries() if(munmap(customConfFileMap, buffer.st_size) == -1) { - DLT_LOG(gPclDLTContext, DLT_LOG_ERROR, DLT_STRING("get_custom_libraries - failed to unmap - "), DLT_STRING(strerror(errno))); + DLT_LOG(gPclDLTContext, DLT_LOG_ERROR, DLT_STRING("gCusLib - Err unmap - "), DLT_STRING(strerror(errno))); } close(fd); } else { - DLT_LOG(gPclDLTContext, DLT_LOG_ERROR, DLT_STRING("get_custom_libraries - Error file size is 0")); + DLT_LOG(gPclDLTContext, DLT_LOG_ERROR, DLT_STRING("gCusLib - Err file size is 0")); rval = EPERS_COMMON; } } else { - DLT_LOG(gPclDLTContext, DLT_LOG_ERROR, DLT_STRING("get_custom_libraries - failed to stat() file")); + DLT_LOG(gPclDLTContext, DLT_LOG_ERROR, DLT_STRING("customLib - failed stat() file")); rval = EPERS_COMMON; } return rval; @@ -320,113 +320,113 @@ int load_custom_library(PersistenceCustomLibs_e customLib, Pers_custom_functs_s *(void **) (&customFuncts->custom_plugin_handle_close) = dlsym(handle, "plugin_handle_close"); if ((error = dlerror()) != NULL) { - DLT_LOG(gPclDLTContext, DLT_LOG_WARN, DLT_STRING("load_custom_library - error:"), DLT_STRING(error)); + DLT_LOG(gPclDLTContext, DLT_LOG_WARN, DLT_STRING("lCusLib - err:"), DLT_STRING(error)); } // custom_plugin_delete_data *(void **) (&customFuncts->custom_plugin_delete_data) = dlsym(handle, "plugin_delete_data"); if ((error = dlerror()) != NULL) { - DLT_LOG(gPclDLTContext, DLT_LOG_WARN, DLT_STRING("load_custom_library - error:"), DLT_STRING(error)); + DLT_LOG(gPclDLTContext, DLT_LOG_WARN, DLT_STRING("lCusLib - err:"), DLT_STRING(error)); } // custom_plugin_get_data *(void **) (&customFuncts->custom_plugin_handle_get_data) = dlsym(handle, "plugin_handle_get_data"); if ((error = dlerror()) != NULL) { - DLT_LOG(gPclDLTContext, DLT_LOG_WARN, DLT_STRING("load_custom_library - error:"), DLT_STRING(error)); + DLT_LOG(gPclDLTContext, DLT_LOG_WARN, DLT_STRING("lCusLib - err:"), DLT_STRING(error)); } // custom_plugin_get_data *(void **) (&customFuncts->custom_plugin_get_data) = dlsym(handle, "plugin_get_data"); if ((error = dlerror()) != NULL) { - DLT_LOG(gPclDLTContext, DLT_LOG_WARN, DLT_STRING("load_custom_library - error:"), DLT_STRING(error)); + DLT_LOG(gPclDLTContext, DLT_LOG_WARN, DLT_STRING("lCusLib - err:"), DLT_STRING(error)); } // custom_plugin_init *(void **) (&customFuncts->custom_plugin_init) = dlsym(handle, "plugin_init"); if ((error = dlerror()) != NULL) { - DLT_LOG(gPclDLTContext, DLT_LOG_WARN, DLT_STRING("load_custom_library - error:"), DLT_STRING(error)); + DLT_LOG(gPclDLTContext, DLT_LOG_WARN, DLT_STRING("lCusLib - err:"), DLT_STRING(error)); } // custom_plugin_deinit *(void **) (&customFuncts->custom_plugin_deinit) = dlsym(handle, "plugin_deinit"); if ((error = dlerror()) != NULL) { - DLT_LOG(gPclDLTContext, DLT_LOG_WARN, DLT_STRING("load_custom_library - error:"), DLT_STRING(error)); + DLT_LOG(gPclDLTContext, DLT_LOG_WARN, DLT_STRING("lCusLib - err:"), DLT_STRING(error)); } // custom_plugin_open *(void **) (&customFuncts->custom_plugin_handle_open) = dlsym(handle, "plugin_handle_open"); if ((error = dlerror()) != NULL) { - DLT_LOG(gPclDLTContext, DLT_LOG_WARN, DLT_STRING("load_custom_library - error:"), DLT_STRING(error)); + DLT_LOG(gPclDLTContext, DLT_LOG_WARN, DLT_STRING("lCusLib - err:"), DLT_STRING(error)); } // custom_plugin_set_data *(void **) (&customFuncts->custom_plugin_handle_set_data) = dlsym(handle, "plugin_handle_set_data"); if ((error = dlerror()) != NULL) { - DLT_LOG(gPclDLTContext, DLT_LOG_WARN, DLT_STRING("load_custom_library - error:"), DLT_STRING(error)); + DLT_LOG(gPclDLTContext, DLT_LOG_WARN, DLT_STRING("lCusLib - err:"), DLT_STRING(error)); } // custom_plugin_set_data *(void **) (&customFuncts->custom_plugin_set_data) = dlsym(handle, "plugin_set_data"); if ((error = dlerror()) != NULL) { - DLT_LOG(gPclDLTContext, DLT_LOG_WARN, DLT_STRING("load_custom_library - error:"), DLT_STRING(error)); + DLT_LOG(gPclDLTContext, DLT_LOG_WARN, DLT_STRING("lCusLib - err:"), DLT_STRING(error)); } // custom_plugin_get_size_handle *(void **) (&customFuncts->custom_plugin_handle_get_size) = dlsym(handle, "plugin_handle_get_size"); if ((error = dlerror()) != NULL) { - DLT_LOG(gPclDLTContext, DLT_LOG_WARN, DLT_STRING("load_custom_library - error:"), DLT_STRING(error)); + DLT_LOG(gPclDLTContext, DLT_LOG_WARN, DLT_STRING("lCusLib - err:"), DLT_STRING(error)); } // custom_plugin_get_size *(void **) (&customFuncts->custom_plugin_get_size) = dlsym(handle, "plugin_get_size"); if ((error = dlerror()) != NULL) { - DLT_LOG(gPclDLTContext, DLT_LOG_WARN, DLT_STRING("load_custom_library - error:"), DLT_STRING(error)); + DLT_LOG(gPclDLTContext, DLT_LOG_WARN, DLT_STRING("lCusLib - err:"), DLT_STRING(error)); } // create backup *(void **) (&customFuncts->custom_plugin_create_backup) = dlsym(handle, "plugin_create_backup"); if ((error = dlerror()) != NULL) { - DLT_LOG(gPclDLTContext, DLT_LOG_WARN, DLT_STRING("load_custom_library - error:"), DLT_STRING(error)); + DLT_LOG(gPclDLTContext, DLT_LOG_WARN, DLT_STRING("lCusLib - err:"), DLT_STRING(error)); } // restore backup *(void **) (&customFuncts->custom_plugin_restore_backup) = dlsym(handle, "plugin_restore_backup"); if ((error = dlerror()) != NULL) { - DLT_LOG(gPclDLTContext, DLT_LOG_WARN, DLT_STRING("load_custom_library - error:"), DLT_STRING(error)); + DLT_LOG(gPclDLTContext, DLT_LOG_WARN, DLT_STRING("lCusLib - err:"), DLT_STRING(error)); } // restore backup *(void **) (&customFuncts->custom_plugin_get_backup) = dlsym(handle, "plugin_get_backup"); if ((error = dlerror()) != NULL) { - DLT_LOG(gPclDLTContext, DLT_LOG_WARN, DLT_STRING("load_custom_library - error:"), DLT_STRING(error)); + DLT_LOG(gPclDLTContext, DLT_LOG_WARN, DLT_STRING("lCusLib - err:"), DLT_STRING(error)); } // custom_plugin_get_status_notification_clbk *(void **) (&customFuncts->custom_plugin_get_status_notification_clbk) = dlsym(handle, "plugin_get_status_notification_clbk"); if ((error = dlerror()) != NULL) { - DLT_LOG(gPclDLTContext, DLT_LOG_WARN, DLT_STRING("load_custom_library - error:"), DLT_STRING(error)); + DLT_LOG(gPclDLTContext, DLT_LOG_WARN, DLT_STRING("lCusLib - err:"), DLT_STRING(error)); } // initialize plugin (non blocking) *(void **) (&customFuncts->custom_plugin_init_async) = dlsym(handle, "plugin_init_async"); if ((error = dlerror()) != NULL) { - DLT_LOG(gPclDLTContext, DLT_LOG_WARN, DLT_STRING("load_custom_library - error:"), DLT_STRING(error)); + DLT_LOG(gPclDLTContext, DLT_LOG_WARN, DLT_STRING("lCusLib - err:"), DLT_STRING(error)); } // clear all data *(void **) (&customFuncts->custom_plugin_clear_all_data) = dlsym(handle, "plugin_clear_all_data"); if ((error = dlerror()) != NULL) { - DLT_LOG(gPclDLTContext, DLT_LOG_WARN, DLT_STRING("load_custom_library - error:"), DLT_STRING(error)); + DLT_LOG(gPclDLTContext, DLT_LOG_WARN, DLT_STRING("lCusLib - error:"), DLT_STRING(error)); } // sync data *(void **) (&customFuncts->custom_plugin_sync) = dlsym(handle, "plugin_sync"); if ((error = dlerror()) != NULL) { - DLT_LOG(gPclDLTContext, DLT_LOG_WARN, DLT_STRING("load_custom_library - error:"), DLT_STRING(error)); + DLT_LOG(gPclDLTContext, DLT_LOG_WARN, DLT_STRING("lCusLib - err:"), DLT_STRING(error)); } // @@ -436,12 +436,12 @@ int load_custom_library(PersistenceCustomLibs_e customLib, Pers_custom_functs_s { if( (gPersCustomFuncs[customLib].custom_plugin_init) != NULL) { - DLT_LOG(gPclDLTContext, DLT_LOG_INFO, DLT_STRING("load_custom_library => (sync) : "), DLT_STRING(get_custom_client_lib_name(customLib))); + DLT_LOG(gPclDLTContext, DLT_LOG_INFO, DLT_STRING("lCusLib => (sync) : "), DLT_STRING(get_custom_client_lib_name(customLib))); gPersCustomFuncs[customLib].custom_plugin_init(); } else { - DLT_LOG(gPclDLTContext, DLT_LOG_ERROR, DLT_STRING("load_custom_library - could not load plugin functions: "), + DLT_LOG(gPclDLTContext, DLT_LOG_ERROR, DLT_STRING("lCusLib - Err load plug funct: "), DLT_STRING(get_custom_client_lib_name(customLib))); rval = EPERS_COMMON; } @@ -450,21 +450,21 @@ int load_custom_library(PersistenceCustomLibs_e customLib, Pers_custom_functs_s { if( (gPersCustomFuncs[customLib].custom_plugin_init_async) != NULL) { - DLT_LOG(gPclDLTContext, DLT_LOG_INFO, DLT_STRING("load_custom_library => (async) : "), + DLT_LOG(gPclDLTContext, DLT_LOG_INFO, DLT_STRING("lCusLib => (async) : "), DLT_STRING(get_custom_client_lib_name(customLib))); gPersCustomFuncs[customLib].custom_plugin_init_async(gPlugin_callback_async_t); } else { - DLT_LOG(gPclDLTContext, DLT_LOG_ERROR, DLT_STRING("load_custom_library - could not load plugin functions: "), + DLT_LOG(gPclDLTContext, DLT_LOG_ERROR, DLT_STRING("lCusLib - Err load plug funct: "), DLT_STRING(get_custom_client_lib_name(customLib))); rval = EPERS_COMMON; } } else { - DLT_LOG(gPclDLTContext, DLT_LOG_ERROR, DLT_STRING("load_custom_library - unknown init type "), + DLT_LOG(gPclDLTContext, DLT_LOG_ERROR, DLT_STRING("lCusLib - unknown init type "), DLT_STRING(get_custom_client_lib_name(customLib))); rval = EPERS_COMMON; } @@ -472,13 +472,13 @@ int load_custom_library(PersistenceCustomLibs_e customLib, Pers_custom_functs_s else { error = dlerror(); - DLT_LOG(gPclDLTContext, DLT_LOG_ERROR, DLT_STRING("load_custom_library - "), DLT_STRING(error)); + DLT_LOG(gPclDLTContext, DLT_LOG_ERROR, DLT_STRING("lCusLib - "), DLT_STRING(error)); rval = EPERS_DLOPENERROR; } } else { - DLT_LOG(gPclDLTContext, DLT_LOG_ERROR, DLT_STRING("load_custom_library - customLib out of bounds")); + DLT_LOG(gPclDLTContext, DLT_LOG_ERROR, DLT_STRING("lCusLib - customLib out of bounds")); rval = EPERS_DLOPENERROR; } @@ -535,7 +535,7 @@ int load_custom_plugins(plugin_callback_async_t pfInitCompletedCB) { if(load_custom_library(i, &gPersCustomFuncs[i] ) <= 0) { - DLT_LOG(gPclDLTContext, DLT_LOG_ERROR, DLT_STRING("load_custom_plugins - could not load plugin: "), + DLT_LOG(gPclDLTContext, DLT_LOG_ERROR, DLT_STRING("lCusPlug - could not load plugin: "), DLT_STRING(get_custom_client_lib_name(i))); rval = EPERS_COMMON; } @@ -549,7 +549,7 @@ int load_custom_plugins(plugin_callback_async_t pfInitCompletedCB) } else { - DLT_LOG(gPclDLTContext, DLT_LOG_WARN, DLT_STRING("load_custom_plugins - Failed to load custom library config table")); + DLT_LOG(gPclDLTContext, DLT_LOG_WARN, DLT_STRING("lCusPlug - Failed load cus lib conf table")); rval = EPERS_COMMON; } diff --git a/src/persistence_client_library_db_access.c b/src/persistence_client_library_db_access.c index cceb971..aedda39 100644 --- a/src/persistence_client_library_db_access.c +++ b/src/persistence_client_library_db_access.c @@ -108,12 +108,12 @@ static int database_get(PersistenceInfo_s* info, const char* dbPath, int dbType) } else { - DLT_LOG(gPclDLTContext, DLT_LOG_ERROR, DLT_STRING("database_get - persComDbOpen() failed")); + DLT_LOG(gPclDLTContext, DLT_LOG_ERROR, DLT_STRING("dbGet - persComDbOpen() failed")); } } else { - DLT_LOG(gPclDLTContext, DLT_LOG_ERROR, DLT_STRING("database_get - wrong policy! Cannot extend dbPath wit database.")); + DLT_LOG(gPclDLTContext, DLT_LOG_ERROR, DLT_STRING("dbGet - wrong policy! Cannot extend dbPath wit db.")); } } else @@ -123,7 +123,7 @@ static int database_get(PersistenceInfo_s* info, const char* dbPath, int dbType) } else { - DLT_LOG(gPclDLTContext, DLT_LOG_ERROR, DLT_STRING("database_get - invalid storage type"), DLT_STRING(dbPath)); + DLT_LOG(gPclDLTContext, DLT_LOG_ERROR, DLT_STRING("dbGet - inval storage type"), DLT_STRING(dbPath)); } return handleDB; } @@ -151,7 +151,7 @@ int pers_get_defaults(char* dbPath, char* key, PersistenceInfo_s* info, unsigned } else { - DLT_LOG(gPclDLTContext, DLT_LOG_ERROR, DLT_STRING("pers_get_defaults - unknown job")); + DLT_LOG(gPclDLTContext, DLT_LOG_ERROR, DLT_STRING("getDefaults - unknown job")); break; } @@ -172,7 +172,7 @@ int pers_get_defaults(char* dbPath, char* key, PersistenceInfo_s* info, unsigned { snprintf(dltMessage, DbPathMaxLen, "%s%s", dbPath, gLocalFactoryDefault); } - DLT_LOG(gPclDLTContext, DLT_LOG_INFO, DLT_STRING("pers_get_defaults - efault data will be used for Key"), DLT_STRING(key), + DLT_LOG(gPclDLTContext, DLT_LOG_INFO, DLT_STRING("getDefaults - default data will be used for Key"), DLT_STRING(key), DLT_STRING("from"), DLT_STRING(dltMessage)); break; } @@ -181,7 +181,7 @@ int pers_get_defaults(char* dbPath, char* key, PersistenceInfo_s* info, unsigned if (read_size < 0) { - DLT_LOG(gPclDLTContext, DLT_LOG_INFO, DLT_STRING("pers_get_defaults - default data not available for Key"), DLT_STRING(key), + DLT_LOG(gPclDLTContext, DLT_LOG_INFO, DLT_STRING("getDefaults - default data not available for Key"), DLT_STRING(key), DLT_STRING("Path:"), DLT_STRING(dbPath)); } @@ -226,7 +226,7 @@ void database_close_all() int iErrorCode = persComDbClose(gHandlesDB[i][j]); if (iErrorCode < 0) { - DLT_LOG(gPclDLTContext, DLT_LOG_ERROR, DLT_STRING("database_close_all - failed to close db")); + DLT_LOG(gPclDLTContext, DLT_LOG_ERROR, DLT_STRING("dbCloseAll - Err close db")); } else { @@ -289,7 +289,7 @@ int persistence_get_data(char* dbPath, char* key, const char* resourceID, Persis } else { - DLT_LOG(gPclDLTContext, DLT_LOG_INFO, DLT_STRING("persistence_get_data - Plugin not available, unknown loading type: "), + DLT_LOG(gPclDLTContext, DLT_LOG_INFO, DLT_STRING("getData - Plugin not avail, unknown loading type: "), DLT_INT(getCustomLoadingType(idx))); read_size = EPERS_COMMON; } @@ -329,7 +329,7 @@ int persistence_get_data(char* dbPath, char* key, const char* resourceID, Persis (void)get_db_path_and_key(info, key, NULL, dbPath); - DLT_LOG(gPclDLTContext, DLT_LOG_INFO, DLT_STRING("persistence_get_data - Plugin data not available - get default data of key:"), DLT_STRING(key)); + DLT_LOG(gPclDLTContext, DLT_LOG_INFO, DLT_STRING("getData - Plugin data not available - get default data of key:"), DLT_STRING(key)); ret_defaults = pers_get_defaults(dbPath, (char*)resourceID, info, buffer, buffer_size, PersGetDefault_Data); if (0 < ret_defaults) { @@ -366,7 +366,7 @@ int persistence_set_data(char* dbPath, char* key, const char* resource_id, Persi write_size = persComDbWriteKey(handleDB, dbInput, (char*)buffer, buffer_size) ; if(write_size < 0) { - DLT_LOG(gPclDLTContext, DLT_LOG_ERROR, DLT_STRING("persistence_set_data - persComDbWriteKey() failure")); + DLT_LOG(gPclDLTContext, DLT_LOG_ERROR, DLT_STRING("setData - persComDbWriteKey() failure")); } else { @@ -375,7 +375,7 @@ int persistence_set_data(char* dbPath, char* key, const char* resource_id, Persi int rval = pers_send_Notification_Signal(resource_id, &info->context, pclNotifyStatus_changed); if(rval <= 0) { - DLT_LOG(gPclDLTContext, DLT_LOG_ERROR, DLT_STRING("persistence_set_data - failed to send notification signal")); + DLT_LOG(gPclDLTContext, DLT_LOG_ERROR, DLT_STRING("setData - Err to send noty sig")); write_size = rval; } } @@ -384,7 +384,7 @@ int persistence_set_data(char* dbPath, char* key, const char* resource_id, Persi } else { - DLT_LOG(gPclDLTContext, DLT_LOG_ERROR, DLT_STRING("persistence_set_data - no resource config table"), DLT_STRING(dbPath), DLT_STRING(key)); + DLT_LOG(gPclDLTContext, DLT_LOG_ERROR, DLT_STRING("setData - no RCT"), DLT_STRING(dbPath), DLT_STRING(key)); write_size = EPERS_NOPRCTABLE; } } @@ -417,7 +417,7 @@ int persistence_set_data(char* dbPath, char* key, const char* resource_id, Persi } else { - DLT_LOG(gPclDLTContext, DLT_LOG_INFO, DLT_STRING("persistence_set_data - Plugin not available, unknown loading type: "), + DLT_LOG(gPclDLTContext, DLT_LOG_INFO, DLT_STRING("setData - Plugin not avail, unknown loading type: "), DLT_INT(getCustomLoadingType(idx))); write_size = EPERS_COMMON; } @@ -446,7 +446,7 @@ int persistence_set_data(char* dbPath, char* key, const char* resource_id, Persi int rval = pers_send_Notification_Signal(resource_id, &info->context, pclNotifyStatus_changed); if(rval <= 0) { - DLT_LOG(gPclDLTContext, DLT_LOG_ERROR, DLT_STRING("persistence_set_data - failed to send notification signal")); + DLT_LOG(gPclDLTContext, DLT_LOG_ERROR, DLT_STRING("setData - Err send noty sig")); write_size = rval; } } @@ -514,7 +514,7 @@ int persistence_get_data_size(char* dbPath, char* key, const char* resourceID, P } else { - DLT_LOG(gPclDLTContext, DLT_LOG_INFO, DLT_STRING("persistence_get_data_size - Plugin not available, unknown loading type: "), + DLT_LOG(gPclDLTContext, DLT_LOG_INFO, DLT_STRING("getDataSize - Plugin not avail, unknown loading type: "), DLT_INT(getCustomLoadingType(idx))); read_size = EPERS_COMMON; } @@ -552,7 +552,7 @@ int persistence_get_data_size(char* dbPath, char* key, const char* resourceID, P info->configKey.policy = PersistencePolicy_wc; /* Set the policy */ info->configKey.type = PersistenceResourceType_key; /* Set the type */ (void)get_db_path_and_key(info, key, NULL, dbPath); - DLT_LOG(gPclDLTContext, DLT_LOG_INFO, DLT_STRING("persistence_get_data_size - Plugin data not available, get size of default data for key:"), + DLT_LOG(gPclDLTContext, DLT_LOG_INFO, DLT_STRING("getDataSize - Plugin data not avail, get size of default data for key:"), DLT_STRING(key)); ret_defaults = pers_get_defaults(dbPath, (char*)resourceID, info, NULL, 0, PersGetDefault_Size); if (0 < ret_defaults) @@ -577,7 +577,7 @@ int persistence_delete_data(char* dbPath, char* key, const char* resource_id, Pe ret = persComDbDeleteKey(handleDB, key) ; if(ret < 0) { - DLT_LOG(gPclDLTContext, DLT_LOG_ERROR, DLT_STRING("persistence_delete_data - failed: "), DLT_STRING(key)); + DLT_LOG(gPclDLTContext, DLT_LOG_ERROR, DLT_STRING("deleteData - failed: "), DLT_STRING(key)); if(PERS_COM_ERR_NOT_FOUND == ret) { ret = EPERS_NOKEY ; @@ -595,7 +595,7 @@ int persistence_delete_data(char* dbPath, char* key, const char* resource_id, Pe } else { - DLT_LOG(gPclDLTContext, DLT_LOG_ERROR, DLT_STRING("persistence_delete_data - no resource config table"), DLT_STRING(dbPath), DLT_STRING(key)); + DLT_LOG(gPclDLTContext, DLT_LOG_ERROR, DLT_STRING("deleteData - no RCT"), DLT_STRING(dbPath), DLT_STRING(key)); ret = EPERS_NOPRCTABLE; } } @@ -628,7 +628,7 @@ int persistence_delete_data(char* dbPath, char* key, const char* resource_id, Pe } else { - DLT_LOG(gPclDLTContext, DLT_LOG_INFO, DLT_STRING("persistence_delete_data - Plugin not available, unknown loading type: "), + DLT_LOG(gPclDLTContext, DLT_LOG_INFO, DLT_STRING("deleteData - Plugin not available, unknown loading type: "), DLT_INT(getCustomLoadingType(idx))); ret = EPERS_COMMON; } @@ -700,7 +700,7 @@ int persistence_notify_on_change(const char* key, unsigned int ldbid, unsigned i if(-1 == deliverToMainloop(&data)) { - DLT_LOG(gPclDLTContext, DLT_LOG_ERROR, DLT_STRING("persistence_notify_on_change - failed to write to pipe"), DLT_INT(errno)); + DLT_LOG(gPclDLTContext, DLT_LOG_ERROR, DLT_STRING("notifyOnChange - Err to write to pipe"), DLT_INT(errno)); rval = -1; } } @@ -734,7 +734,7 @@ int pers_send_Notification_Signal(const char* key, PersistenceDbContext_s* conte if(-1 == deliverToMainloop(&data) ) { - DLT_LOG(gPclDLTContext, DLT_LOG_ERROR, DLT_STRING("pers_send_Notification_Signal - failed to write to pipe"), DLT_INT(errno)); + DLT_LOG(gPclDLTContext, DLT_LOG_ERROR, DLT_STRING("sendNotifySig - Err write to pipe"), DLT_INT(errno)); rval = EPERS_NOTIFY_SIG; } } @@ -758,7 +758,7 @@ void pers_rct_close_all() { if(persComRctClose(get_resource_cfg_table_by_idx(i)) != 0) { - DLT_LOG(gPclDLTContext, DLT_LOG_ERROR, DLT_STRING("process_prepare_shutdown - failed close db => index:"), DLT_INT(i)); + DLT_LOG(gPclDLTContext, DLT_LOG_ERROR, DLT_STRING("prepShtdwn - Err close db => index:"), DLT_INT(i)); } invalidate_resource_cfg_table(i); diff --git a/src/persistence_client_library_dbus_cmd.c b/src/persistence_client_library_dbus_cmd.c index 89c019c..1631d3d 100644 --- a/src/persistence_client_library_dbus_cmd.c +++ b/src/persistence_client_library_dbus_cmd.c @@ -73,14 +73,14 @@ void process_reg_notification_signal(DBusConnection* conn, unsigned int notifyLd dbus_bus_add_match(conn, ruleChanged, NULL); dbus_bus_add_match(conn, ruleDeleted, NULL); dbus_bus_add_match(conn, ruleCreated, NULL); - DLT_LOG(gPclDLTContext, DLT_LOG_VERBOSE, DLT_STRING("Registered for change notifications:"), DLT_STRING(ruleChanged)); + DLT_LOG(gPclDLTContext, DLT_LOG_VERBOSE, DLT_STRING("Reg for change notify:"), DLT_STRING(ruleChanged)); } else if(notifyPolicy == Notify_unregister) { dbus_bus_remove_match(conn, ruleChanged, NULL); dbus_bus_remove_match(conn, ruleDeleted, NULL); dbus_bus_remove_match(conn, ruleCreated, NULL); - DLT_LOG(gPclDLTContext, DLT_LOG_VERBOSE, DLT_STRING("Unregistered for change notifications:"), DLT_STRING(ruleChanged)); + DLT_LOG(gPclDLTContext, DLT_LOG_VERBOSE, DLT_STRING("unREg for change notify:"), DLT_STRING(ruleChanged)); } dbus_connection_flush(conn); // flush the connection to add the match @@ -150,22 +150,22 @@ void process_send_notification_signal(DBusConnection* conn, unsigned int notifyL } else { - DLT_LOG(gPclDLTContext, DLT_LOG_ERROR, DLT_STRING("process_send_Notification_Signal - failed to send dbus message!!")); + DLT_LOG(gPclDLTContext, DLT_LOG_ERROR, DLT_STRING("sendNotifySig - failed to send msg!!")); } } else { - DLT_LOG(gPclDLTContext, DLT_LOG_ERROR, DLT_STRING("process_send_Notification_Signal - C O N E C T I O N NULL!!")); + DLT_LOG(gPclDLTContext, DLT_LOG_ERROR, DLT_STRING("sendNotifySig - Con NULL")); } } else { - DLT_LOG(gPclDLTContext, DLT_LOG_ERROR, DLT_STRING("process_send_Notification_Signal - dbus_message_append_args")); + DLT_LOG(gPclDLTContext, DLT_LOG_ERROR, DLT_STRING("sendNotifySig - _append_args")); } } else { - DLT_LOG(gPclDLTContext, DLT_LOG_ERROR, DLT_STRING("process_send_Notification_Signal - invalid notification reason")); + DLT_LOG(gPclDLTContext, DLT_LOG_ERROR, DLT_STRING("sendNotifySig - Inval noty reason")); } } @@ -186,7 +186,7 @@ void process_prepare_shutdown(int complete) { int i = 0, rval = 0; - DLT_LOG(gPclDLTContext, DLT_LOG_INFO, DLT_STRING("process_prepare_shutdown - writing down all changed data and closing all handles")); + DLT_LOG(gPclDLTContext, DLT_LOG_INFO, DLT_STRING("prepShtdwn - writing all changed data / closing all handles")); // block write pers_lock_access(); @@ -218,7 +218,7 @@ void process_prepare_shutdown(int complete) #endif if(rval == -1) { - DLT_LOG(gPclDLTContext, DLT_LOG_ERROR, DLT_STRING("process_prepare_shutdown - failed to close file: "), DLT_STRING(strerror(errno)) ); + DLT_LOG(gPclDLTContext, DLT_LOG_ERROR, DLT_STRING("prepShtdwn - failed close file: "), DLT_STRING(strerror(errno)) ); } } @@ -275,7 +275,7 @@ void process_send_pas_request(DBusConnection* conn, unsigned int requestID, int if(!dbus_connection_send(conn, message, 0)) { - DLT_LOG(gPclDLTContext, DLT_LOG_ERROR, DLT_STRING("send_lifecycle_register - Access denied"), DLT_STRING(error.message) ); + DLT_LOG(gPclDLTContext, DLT_LOG_ERROR, DLT_STRING("sendLcmReg - Access denied"), DLT_STRING(error.message) ); } dbus_connection_flush(conn); @@ -283,12 +283,12 @@ void process_send_pas_request(DBusConnection* conn, unsigned int requestID, int } else { - DLT_LOG(gPclDLTContext, DLT_LOG_ERROR, DLT_STRING("send_pas_request - Invalid message") ); + DLT_LOG(gPclDLTContext, DLT_LOG_ERROR, DLT_STRING("sendLcmReg - Inval msg") ); } } else { - DLT_LOG(gPclDLTContext, DLT_LOG_ERROR, DLT_STRING("send_pas_request - Invalid connection") ); + DLT_LOG(gPclDLTContext, DLT_LOG_ERROR, DLT_STRING("sendLcmReg - Inval con") ); } } @@ -334,24 +334,24 @@ void process_send_pas_register(DBusConnection* conn, int regType, int notificati if(!dbus_pending_call_set_notify(pending, msg_pending_func, method, NULL)) { - DLT_LOG(gPclDLTContext, DLT_LOG_ERROR, DLT_STRING("process_send_pas_register - dbus_pending_call_set_notify: FAILED\n") ); + DLT_LOG(gPclDLTContext, DLT_LOG_ERROR, DLT_STRING("sendPasReg - _call_set_notify: FAILED\n") ); } dbus_pending_call_unref(pending); } else { - DLT_LOG(gPclDLTContext, DLT_LOG_ERROR, DLT_STRING("send_pas_register - Invalid message") ); + DLT_LOG(gPclDLTContext, DLT_LOG_ERROR, DLT_STRING("sendPasReg - Invalid message") ); } dbus_message_unref(message); } else { - DLT_LOG(gPclDLTContext, DLT_LOG_ERROR, DLT_STRING("send_pas_register - Invalid busname") ); + DLT_LOG(gPclDLTContext, DLT_LOG_ERROR, DLT_STRING("sendPasReg - Invalid busname") ); } } else { - DLT_LOG(gPclDLTContext, DLT_LOG_ERROR, DLT_STRING("send_pas_register - Invalid connection") ); + DLT_LOG(gPclDLTContext, DLT_LOG_ERROR, DLT_STRING("sendPasReg - Inval con") ); } } @@ -394,19 +394,19 @@ void process_send_lifecycle_register(DBusConnection* conn, int regType, int shut if(!dbus_connection_send(conn, message, 0)) { - DLT_LOG(gPclDLTContext, DLT_LOG_ERROR, DLT_STRING("send_lifecycle_register - Access denied"), DLT_STRING(error.message) ); + DLT_LOG(gPclDLTContext, DLT_LOG_ERROR, DLT_STRING("sendLcmReg - Access denied"), DLT_STRING(error.message) ); } dbus_connection_flush(conn); dbus_message_unref(message); } else { - DLT_LOG(gPclDLTContext, DLT_LOG_ERROR, DLT_STRING("send_lifecycle_register - Invalid message")); + DLT_LOG(gPclDLTContext, DLT_LOG_ERROR, DLT_STRING("sendLcmReg - Invalid msg")); } } else { - DLT_LOG(gPclDLTContext, DLT_LOG_ERROR, DLT_STRING("send_lifecycle_register - connection isn NULL")); + DLT_LOG(gPclDLTContext, DLT_LOG_ERROR, DLT_STRING("sendLcmReg - con is NULL")); } } @@ -432,7 +432,7 @@ void process_send_lifecycle_request(DBusConnection* conn, unsigned int requestId if(!dbus_connection_send(conn, message, 0)) { - DLT_LOG(gPclDLTContext, DLT_LOG_ERROR, DLT_STRING("send_lifecycle_request - Access denied"), DLT_STRING(error.message) ); + DLT_LOG(gPclDLTContext, DLT_LOG_ERROR, DLT_STRING("sendLcmRequest - Access denied"), DLT_STRING(error.message) ); } dbus_connection_flush(conn); @@ -440,12 +440,12 @@ void process_send_lifecycle_request(DBusConnection* conn, unsigned int requestId } else { - DLT_LOG(gPclDLTContext, DLT_LOG_ERROR, DLT_STRING("send_lifecycle_request - Invalid message")); + DLT_LOG(gPclDLTContext, DLT_LOG_ERROR, DLT_STRING("sendLcmRequest - Invalid msg")); } } else { - DLT_LOG(gPclDLTContext, DLT_LOG_ERROR, DLT_STRING("send_lifecycle_request - connection isn NULL")); + DLT_LOG(gPclDLTContext, DLT_LOG_ERROR, DLT_STRING("sendLcmRequest - con is NULL")); } } @@ -463,7 +463,7 @@ void msg_pending_func(DBusPendingCall *call, void *data) if (dbus_set_error_from_message(&err, message)) { - DLT_LOG(gPclDLTContext, DLT_LOG_ERROR, DLT_STRING("msg_pending_func - Access denied") ); + DLT_LOG(gPclDLTContext, DLT_LOG_ERROR, DLT_STRING("msgPendFunc - Access denied") ); } else { diff --git a/src/persistence_client_library_dbus_service.c b/src/persistence_client_library_dbus_service.c index 5f60264..4b487f3 100644 --- a/src/persistence_client_library_dbus_service.c +++ b/src/persistence_client_library_dbus_service.c @@ -128,7 +128,7 @@ static DBusHandlerResult handleObjectPathMessageFallback(DBusConnection * connec } else { - DLT_LOG(gPclDLTContext, DLT_LOG_ERROR, DLT_STRING("handleObjectPathMessageFallback - unknown signal:"), DLT_STRING(dbus_message_get_interface(message)) ); + DLT_LOG(gPclDLTContext, DLT_LOG_ERROR, DLT_STRING("handleObjPathMsgFback - unknown sig:"), DLT_STRING(dbus_message_get_interface(message)) ); } } } @@ -175,12 +175,12 @@ static DBusHandlerResult handleObjectPathMessageFallback(DBusConnection * connec if (reply == 0) { - DLT_LOG(gPclDLTContext, DLT_LOG_ERROR, DLT_STRING("handleObjectPathMessageFallback - DBus No memory"), DLT_STRING(dbus_message_get_interface(message)) ); + DLT_LOG(gPclDLTContext, DLT_LOG_ERROR, DLT_STRING("handleObjPathMsgFback - DBus No mem"), DLT_STRING(dbus_message_get_interface(message)) ); } if (!dbus_connection_send(connection, reply, 0)) { - DLT_LOG(gPclDLTContext, DLT_LOG_ERROR, DLT_STRING("handleObjectPathMessageFallback - DBus No memory"), DLT_STRING(dbus_message_get_interface(message)) ); + DLT_LOG(gPclDLTContext, DLT_LOG_ERROR, DLT_STRING("handleObjPathMsgFback - DBus No mem"), DLT_STRING(dbus_message_get_interface(message)) ); } result = DBUS_HANDLER_RESULT_NOT_YET_HANDLED;; @@ -199,7 +199,7 @@ static DBusHandlerResult handleObjectPathMessageFallback(DBusConnection * connec } else { - DLT_LOG(gPclDLTContext, DLT_LOG_ERROR, DLT_STRING("handleObjectPathMessageFallback - gChangeNotifyCallback is not set (possibly NULL)") ); + DLT_LOG(gPclDLTContext, DLT_LOG_ERROR, DLT_STRING("handleObjPathMsgFback - gChangeNotifyCallback not set (NULL?)") ); } result = DBUS_HANDLER_RESULT_HANDLED; } @@ -235,12 +235,12 @@ static DBusHandlerResult handleObjectPathMessageFallback(DBusConnection * connec } else { - DLT_LOG(gPclDLTContext, DLT_LOG_ERROR, DLT_STRING("handleObjectPathMessageFallback - unknown property:"), DLT_STRING(dbus_message_get_interface(message)) ); + DLT_LOG(gPclDLTContext, DLT_LOG_ERROR, DLT_STRING("handleObjPathMsgFback - unknown property:"), DLT_STRING(dbus_message_get_interface(message)) ); } } else { - DLT_LOG(gPclDLTContext, DLT_LOG_ERROR, DLT_STRING("handleObjectPathMessageFallback - not a signal:"), DLT_STRING(dbus_message_get_member(message)) ); + DLT_LOG(gPclDLTContext, DLT_LOG_ERROR, DLT_STRING("handleObjPathMsgFback - not a signal:"), DLT_STRING(dbus_message_get_member(message)) ); } } return result; @@ -252,7 +252,7 @@ static void unregisterObjectPathFallback(DBusConnection *connection, void *user { (void)connection; (void)user_data; - DLT_LOG(gPclDLTContext, DLT_LOG_INFO, DLT_STRING("unregisterObjectPathFallback\n")); + DLT_LOG(gPclDLTContext, DLT_LOG_INFO, DLT_STRING("unregObjPathFback")); } @@ -295,7 +295,7 @@ int setup_dbus_mainloop(void) // Connect to the bus and check for errors if(pAddress != NULL) { - DLT_LOG(gPclDLTContext, DLT_LOG_INFO, DLT_STRING("setup_dbus_mainloop - Use specific dbus address:"), DLT_STRING(pAddress) ); + DLT_LOG(gPclDLTContext, DLT_LOG_INFO, DLT_STRING("setupMainLoop - specific dbus address:"), DLT_STRING(pAddress) ); conn = dbus_connection_open_private(pAddress, &err); @@ -303,7 +303,7 @@ int setup_dbus_mainloop(void) { if(!dbus_bus_register(conn, &err)) { - DLT_LOG(gPclDLTContext, DLT_LOG_ERROR, DLT_STRING("dbus_bus_register() :"), DLT_STRING(err.message) ); + DLT_LOG(gPclDLTContext, DLT_LOG_ERROR, DLT_STRING("setupMainLoop - _register() :"), DLT_STRING(err.message) ); dbus_error_free (&err); pthread_mutex_unlock(&gDbusInitializedMtx); return -1; @@ -311,7 +311,7 @@ int setup_dbus_mainloop(void) } else { - DLT_LOG(gPclDLTContext, DLT_LOG_ERROR, DLT_STRING("dbus_connection_open_private() :"), DLT_STRING(err.message) ); + DLT_LOG(gPclDLTContext, DLT_LOG_ERROR, DLT_STRING("setupMainLoop - open_private() :"), DLT_STRING(err.message) ); dbus_error_free(&err); pthread_mutex_unlock(&gDbusInitializedMtx); return -1; @@ -319,7 +319,7 @@ int setup_dbus_mainloop(void) } else { - DLT_LOG(gPclDLTContext, DLT_LOG_INFO, DLT_STRING("Use default dbus bus (DBUS_BUS_SYSTEM)")); + DLT_LOG(gPclDLTContext, DLT_LOG_INFO, DLT_STRING("setupMainLoop - Use def bus (DBUS_BUS_SYSTEM)")); conn = dbus_bus_get_private(DBUS_BUS_SYSTEM, &err); } @@ -328,7 +328,7 @@ int setup_dbus_mainloop(void) rval = pthread_create(&gMainLoopThread, NULL, run_mainloop, conn); if(rval) { - DLT_LOG(gPclDLTContext, DLT_LOG_ERROR, DLT_STRING("pthread_create( DBUS run_mainloop ) returned an error:"), DLT_INT(rval) ); + DLT_LOG(gPclDLTContext, DLT_LOG_ERROR, DLT_STRING("pthread_create( DBUS run_mainloop ) ret err:"), DLT_INT(rval) ); pthread_mutex_unlock(&gDbusInitializedMtx); return -1; } @@ -439,12 +439,12 @@ static dbus_bool_t addTimeout(DBusTimeout *timeout, void *data) } else { - DLT_LOG(gPclDLTContext, DLT_LOG_ERROR, DLT_STRING("addTimeout - timerfd_settime() failed"), DLT_STRING(strerror(errno)) ); + DLT_LOG(gPclDLTContext, DLT_LOG_ERROR, DLT_STRING("addTimeout - _settime() failed"), DLT_STRING(strerror(errno)) ); } } else { - DLT_LOG(gPclDLTContext, DLT_LOG_ERROR, DLT_STRING("addTimeout - timerfd_create() failed"), DLT_STRING(strerror(errno)) ); + DLT_LOG(gPclDLTContext, DLT_LOG_ERROR, DLT_STRING("addTimeout - _create() failed"), DLT_STRING(strerror(errno)) ); } } } @@ -519,7 +519,7 @@ int mainLoop(DBusObjectPathVTable vtable, DBusObjectPathVTable vtable2, if (dbus_error_is_set(&err)) { - DLT_LOG(gPclDLTContext, DLT_LOG_ERROR, DLT_STRING("mainLoop - Connection Error:"), DLT_STRING(err.message) ); + DLT_LOG(gPclDLTContext, DLT_LOG_ERROR, DLT_STRING("mainLoop - Con Err:"), DLT_STRING(err.message) ); dbus_error_free(&err); } else if (NULL != conn) @@ -551,7 +551,7 @@ int mainLoop(DBusObjectPathVTable vtable, DBusObjectPathVTable vtable2, if( (TRUE!=dbus_connection_set_watch_functions(conn, addWatch, removeWatch, watchToggled, NULL, NULL)) || (TRUE!=dbus_connection_set_timeout_functions(conn, addTimeout, removeTimeout, timeoutToggled, NULL, NULL)) ) { - DLT_LOG(gPclDLTContext, DLT_LOG_ERROR, DLT_STRING("mainLoop - dbus_connection_set_watch_functions() failed")); + DLT_LOG(gPclDLTContext, DLT_LOG_ERROR, DLT_STRING("mainLoop - set_watch_functions() failed")); } else { @@ -596,7 +596,7 @@ int mainLoop(DBusObjectPathVTable vtable, DBusObjectPathVTable vtable2, if (FALSE==dbus_timeout_handle(gPollInfo.objects[i].timeout)) { - DLT_LOG(gPclDLTContext, DLT_LOG_ERROR, DLT_STRING("mainLoop - dbus_timeout_handle() failed!?")); + DLT_LOG(gPclDLTContext, DLT_LOG_ERROR, DLT_STRING("mainLoop - _timeout_handle() failed!?")); } bContinue = TRUE; } @@ -649,7 +649,7 @@ int mainLoop(DBusObjectPathVTable vtable, DBusObjectPathVTable vtable2, bQuit = TRUE; break; default: - DLT_LOG(gPclDLTContext, DLT_LOG_ERROR, DLT_STRING("mainLoop - command not handled"), DLT_INT(readData.message.cmd) ); + DLT_LOG(gPclDLTContext, DLT_LOG_ERROR, DLT_STRING("mainLoop - cmd not handled"), DLT_INT(readData.message.cmd) ); break; } pthread_cond_signal(&gMainLoopCond); @@ -736,7 +736,7 @@ int deliverToMainloop_NM(MainLoopData_u* payload) if(-1 == write(gPipeFd[1], payload->payload, length)) { - DLT_LOG(gPclDLTContext, DLT_LOG_ERROR, DLT_STRING("deliverToMainloop => failed to write to pipe"), DLT_INT(errno)); + DLT_LOG(gPclDLTContext, DLT_LOG_ERROR, DLT_STRING("toMainloop => failed write pipe"), DLT_INT(errno)); rval = -1; } return rval; diff --git a/src/persistence_client_library_file.c b/src/persistence_client_library_file.c index c2c1417..8a74a85 100644 --- a/src/persistence_client_library_file.c +++ b/src/persistence_client_library_file.c @@ -173,7 +173,7 @@ void* pclFileMapData(void* addr, long size, long offset, int fd) void* ptr = 0; #if USE_FILECACHE - DLT_LOG(gPclDLTContext, DLT_LOG_WARN, DLT_STRING("pclFileMapData not supported when using file cache")); + DLT_LOG(gPclDLTContext, DLT_LOG_WARN, DLT_STRING("fileMapData not supported when using file cache")); #else //DLT_LOG(gDLTContext, DLT_LOG_INFO, DLT_STRING("pclFileMapData fd: "), DLT_INT(fd)); @@ -235,16 +235,16 @@ int pclFileOpenRegular(PersistenceInfo_s* dbContext, const char* resource_id, ch wantBackup = 0; if((handle = pclVerifyConsistency(dbPath, backupPath, csumPath, flags)) == -1) { - DLT_LOG(gPclDLTContext, DLT_LOG_ERROR, DLT_STRING("pclFileOpen - file inconsistent, recovery N O T possible!")); + DLT_LOG(gPclDLTContext, DLT_LOG_ERROR, DLT_STRING("fileOpen - file inconsist, recov N O T possible!")); return -1; } } else { if(dbContext->configKey.permission == PersistencePermission_ReadOnly) - DLT_LOG(gPclDLTContext, DLT_LOG_INFO, DLT_STRING("pclFileOpen: No Backup - file is READ ONLY!"), DLT_STRING(dbKey)); + DLT_LOG(gPclDLTContext, DLT_LOG_INFO, DLT_STRING("fileOpen: NoBackup - file RONLY!"), DLT_STRING(dbKey)); else - DLT_LOG(gPclDLTContext, DLT_LOG_INFO, DLT_STRING("pclFileOpen: No Backup - file is in backup blacklist!"), DLT_STRING(dbKey)); + DLT_LOG(gPclDLTContext, DLT_LOG_INFO, DLT_STRING("fileOpen: NoBackup - file in blacklist!"), DLT_STRING(dbKey)); } #if USE_FILECACHE @@ -287,13 +287,13 @@ int pclFileOpenRegular(PersistenceInfo_s* dbContext, const char* resource_id, ch { if((handle = pclCreateFile(dbPath, cacheStatus)) == -1) { - DLT_LOG(gPclDLTContext, DLT_LOG_ERROR, DLT_STRING("pclFileOpen - failed to create file: "), DLT_STRING(dbPath)); + DLT_LOG(gPclDLTContext, DLT_LOG_ERROR, DLT_STRING("fileOpen - failed create file: "), DLT_STRING(dbPath)); } else { if(pclFileGetDefaultData(handle, resource_id, dbContext->configKey.policy) == -1) // try to get default data { - DLT_LOG(gPclDLTContext, DLT_LOG_WARN, DLT_STRING("pclFileOpen - no default data available: "), DLT_STRING(resource_id)); + DLT_LOG(gPclDLTContext, DLT_LOG_WARN, DLT_STRING("fileOpen - no def data avail: "), DLT_STRING(resource_id)); } } @@ -377,8 +377,6 @@ int pclFileOpenDefaultData(PersistenceInfo_s* dbContext, const char* resource_id // first check for c o n f i g u r a b l e default data snprintf(defaultPath, DbPathMaxLen, "%s%s/%s", pathPrefix, PERS_ORG_CONFIG_DEFAULT_DATA_FOLDER_NAME_, resource_id); - printf("The conf default path: %s\n", defaultPath); - return open(defaultPath, flags); } @@ -486,13 +484,13 @@ int pclFileRemove(unsigned int ldbid, const char* resource_id, unsigned int user rval = remove(dbPath); if(rval == -1) { - DLT_LOG(gPclDLTContext, DLT_LOG_ERROR, DLT_STRING("pclFileRemove - remove()"), DLT_STRING(strerror(errno)) ); + DLT_LOG(gPclDLTContext, DLT_LOG_ERROR, DLT_STRING("fileRemove - remove()"), DLT_STRING(strerror(errno)) ); } } else { rval = shared_DB; - DLT_LOG(gPclDLTContext, DLT_LOG_ERROR, DLT_STRING("pclFileRemove - no valid database context or resource not a file")); + DLT_LOG(gPclDLTContext, DLT_LOG_ERROR, DLT_STRING("fileRemove - no valid db context or res not a file")); } } else @@ -602,20 +600,20 @@ int pclFileWriteData(int fd, const void * buffer, int buffer_size) size = write(fd, buffer, buffer_size); if(fsync(fd) == -1) - DLT_LOG(gPclDLTContext, DLT_LOG_WARN, DLT_STRING("pclFileWriteData: Failed to fsync ==>!"), DLT_STRING(strerror(errno))); + DLT_LOG(gPclDLTContext, DLT_LOG_WARN, DLT_STRING("fileWriteData: Failed fsync ==>!"), DLT_STRING(strerror(errno))); } #else size = write(fd, buffer, buffer_size); if(get_file_cache_status(fd) == 1) { if(fsync(fd) == -1) - DLT_LOG(gPclDLTContext, DLT_LOG_WARN, DLT_STRING("pclFileWriteData - Failed to fsync ==>!"), DLT_STRING(strerror(errno))); + DLT_LOG(gPclDLTContext, DLT_LOG_WARN, DLT_STRING("fileWriteData - Failed fsync ==>!"), DLT_STRING(strerror(errno))); } #endif } else { - DLT_LOG(gPclDLTContext, DLT_LOG_INFO, DLT_STRING("pclFileWriteData - Failed to write ==> read only file!"), DLT_STRING(get_file_backup_path(fd))); + DLT_LOG(gPclDLTContext, DLT_LOG_INFO, DLT_STRING("fileWriteData - Failed write ==> read only file!"), DLT_STRING(get_file_backup_path(fd))); size = EPERS_RESOURCE_READ_ONLY; } } @@ -672,7 +670,7 @@ int pclFileCreatePath(unsigned int ldbid, const char* resource_id, unsigned int if((handle = pclVerifyConsistency(dbPath, backupPath, csumPath, flags)) == -1) { - DLT_LOG(gPclDLTContext, DLT_LOG_ERROR, DLT_STRING("pclFileCreatePath - file inconsistent, recovery N O T possible!")); + DLT_LOG(gPclDLTContext, DLT_LOG_ERROR, DLT_STRING("fileCreatePath - file inconsistent, recovery NOT possible!")); return -1; } // we don't need the file handle here @@ -682,7 +680,7 @@ int pclFileCreatePath(unsigned int ldbid, const char* resource_id, unsigned int } else { - DLT_LOG(gPclDLTContext, DLT_LOG_INFO, DLT_STRING("pclFileCreatePath - No Backup, read only OR in blacklist!"), DLT_STRING(dbKey)); + DLT_LOG(gPclDLTContext, DLT_LOG_INFO, DLT_STRING("fileCreatePath - No Backup, read only OR in blacklist!"), DLT_STRING(dbKey)); } handle = get_persistence_handle_idx(); @@ -717,13 +715,13 @@ int pclFileCreatePath(unsigned int ldbid, const char* resource_id, unsigned int if(handle == -1) { - DLT_LOG(gPclDLTContext, DLT_LOG_ERROR, DLT_STRING("pclFileCreatePath - failed to create file: "), DLT_STRING(*path)); + DLT_LOG(gPclDLTContext, DLT_LOG_ERROR, DLT_STRING("fileCreatePath - Err create file: "), DLT_STRING(*path)); } else { if(pclFileGetDefaultData(handle, resource_id, dbContext.configKey.policy) == -1) // try to get default data { - DLT_LOG(gPclDLTContext, DLT_LOG_WARN, DLT_STRING("pclFileCreatePath - no default data available: "), DLT_STRING(resource_id)); + DLT_LOG(gPclDLTContext, DLT_LOG_WARN, DLT_STRING("fileCreatePath - no def data avail: "), DLT_STRING(resource_id)); } close(handle); // don't need the open file } @@ -735,8 +733,8 @@ int pclFileCreatePath(unsigned int ldbid, const char* resource_id, unsigned int else { handle = EPERS_DESER_ALLOCMEM; - DLT_LOG(gPclDLTContext, DLT_LOG_ERROR, DLT_STRING("pclFileCreatePath: malloc() failed for path:"), - DLT_STRING(dbPath), DLT_STRING("With the size:"), DLT_UINT(*size)); + DLT_LOG(gPclDLTContext, DLT_LOG_ERROR, DLT_STRING("fileCreatePath: malloc() failed for path:"), + DLT_STRING(dbPath), DLT_STRING("With size:"), DLT_UINT(*size)); } } else @@ -868,7 +866,7 @@ int pclFileGetDefaultData(int handle, const char* resource_id, int policy) } else { - DLT_LOG(gPclDLTContext, DLT_LOG_WARN, DLT_STRING("pclFileGetDefaultData - failed to copy file "), DLT_STRING(strerror(errno))); + DLT_LOG(gPclDLTContext, DLT_LOG_WARN, DLT_STRING("fileGetDefaultData - Err copy file "), DLT_STRING(strerror(errno))); } close(defaultHandle); diff --git a/src/persistence_client_library_handle.c b/src/persistence_client_library_handle.c index 4ba7462..c136cb1 100644 --- a/src/persistence_client_library_handle.c +++ b/src/persistence_client_library_handle.c @@ -70,7 +70,7 @@ int get_persistence_handle_idx() else { handle = EPERS_MAXHANDLE; - DLT_LOG(gPclDLTContext, DLT_LOG_ERROR, DLT_STRING("get_persistence_handle_idx - max open handles: "), DLT_INT(MaxPersHandle)); + DLT_LOG(gPclDLTContext, DLT_LOG_ERROR, DLT_STRING("gPersHidx - max open handles: "), DLT_INT(MaxPersHandle)); } } pthread_mutex_unlock(&gMtx); @@ -128,7 +128,7 @@ int set_key_handle_data(int idx, const char* id, unsigned int ldbid, unsigned i } else { - DLT_LOG(gPclDLTContext, DLT_LOG_ERROR, DLT_STRING("set_key_handle_data - index out of bounds:"), DLT_INT(idx)); + DLT_LOG(gPclDLTContext, DLT_LOG_ERROR, DLT_STRING("sKeyHdata - idx out of bounds:"), DLT_INT(idx)); } pthread_mutex_unlock(&gKeyHandleAccessMtx); diff --git a/src/persistence_client_library_key.c b/src/persistence_client_library_key.c index 7ae7188..3834a71 100644 --- a/src/persistence_client_library_key.c +++ b/src/persistence_client_library_key.c @@ -77,7 +77,7 @@ int pclKeyHandleOpen(unsigned int ldbid, const char* resource_id, unsigned int u } else { - DLT_LOG(gPclDLTContext, DLT_LOG_ERROR, DLT_STRING("pclKeyHandleOpen - no database context or resource is not a key ")); + DLT_LOG(gPclDLTContext, DLT_LOG_ERROR, DLT_STRING("keyHandleOpen - no db context or res not a key ")); } } else @@ -219,7 +219,7 @@ int pclKeyHandleRegisterNotifyOnChange(int key_handle, pclChangeNotifyCallback_t } else { - DLT_LOG(gPclDLTContext, DLT_LOG_ERROR, DLT_STRING("pclKeyHandleRegisterNotifyOnChange - Only one callback is allowed for change notifications.")); + DLT_LOG(gPclDLTContext, DLT_LOG_ERROR, DLT_STRING("keyHandleRegNotOnChange - Only one cBack allowed for ch notiy.")); rval = EPERS_NOTIFY_NOT_ALLOWED; } return rval; @@ -446,7 +446,7 @@ int pclKeyReadData(unsigned int ldbid, const char* resource_id, unsigned int use } else { - DLT_LOG(gPclDLTContext, DLT_LOG_ERROR, DLT_STRING("pclKeyReadData - no database context or resource is not a key")); + DLT_LOG(gPclDLTContext, DLT_LOG_ERROR, DLT_STRING("keyReadData - no db context or res not a key")); } } else @@ -511,13 +511,13 @@ int pclKeyWriteData(unsigned int ldbid, const char* resource_id, unsigned int us } else { - DLT_LOG(gPclDLTContext, DLT_LOG_ERROR, DLT_STRING("pclKeyWriteData no database context or resource is not a key")); + DLT_LOG(gPclDLTContext, DLT_LOG_ERROR, DLT_STRING("keyWriteData no db context or res is not a key")); } } else { data_size = EPERS_BUFLIMIT; - DLT_LOG(gPclDLTContext, DLT_LOG_ERROR, DLT_STRING("pclKeyWriteData - buffer_size to big, limit is [bytes]:"), DLT_INT(gMaxKeyValDataSize)); + DLT_LOG(gPclDLTContext, DLT_LOG_ERROR, DLT_STRING("keyWriteData - buffer_size to big, limit is [bytes]:"), DLT_INT(gMaxKeyValDataSize)); } } else @@ -552,7 +552,7 @@ int pclKeyRegisterNotifyOnChange(unsigned int ldbid, const char* resource_id, un } else { - DLT_LOG(gPclDLTContext, DLT_LOG_ERROR, DLT_STRING("pclKeyRegisterNotifyOnChange - Only one callback is allowed for change notifications.")); + DLT_LOG(gPclDLTContext, DLT_LOG_ERROR, DLT_STRING("keyRegNotifyOnChange - Only one cBack is allowed for ch noti.")); rval = EPERS_NOTIFY_NOT_ALLOWED; } return rval; @@ -592,7 +592,7 @@ int regNotifyOnChange(unsigned int ldbid, const char* resource_id, unsigned int } else { - DLT_LOG(gPclDLTContext, DLT_LOG_ERROR, DLT_STRING("regNotifyOnChange - Not allowed! Resource is local or it is a file:"), + DLT_LOG(gPclDLTContext, DLT_LOG_ERROR, DLT_STRING("regNotifyOnChange - Not allowed! Res is local or it is a file:"), DLT_STRING(resource_id), DLT_STRING("LDBID:"), DLT_UINT(ldbid)); rval = EPERS_NOTIFY_NOT_ALLOWED; } diff --git a/src/persistence_client_library_lc_interface.c b/src/persistence_client_library_lc_interface.c index 5af3fca..651c736 100644 --- a/src/persistence_client_library_lc_interface.c +++ b/src/persistence_client_library_lc_interface.c @@ -52,7 +52,7 @@ int check_lc_request(unsigned int request, unsigned int requestID) if(-1 == deliverToMainloop_NM(&data) ) { - DLT_LOG(gPclDLTContext, DLT_LOG_ERROR, DLT_STRING("check_lc_request - failed to write to pipe"), DLT_INT(errno)); + DLT_LOG(gPclDLTContext, DLT_LOG_ERROR, DLT_STRING("lcCechkReq - failed write pipe"), DLT_INT(errno)); rval = NsmErrorStatus_Fail; } else @@ -63,7 +63,7 @@ int check_lc_request(unsigned int request, unsigned int requestID) } default: { - DLT_LOG(gPclDLTContext, DLT_LOG_ERROR, DLT_STRING("check_lc_request - Unknown lifecycle message"), DLT_INT(request)); + DLT_LOG(gPclDLTContext, DLT_LOG_ERROR, DLT_STRING("lcCechkReq - Unknown lcm message"), DLT_INT(request)); break; } } @@ -90,12 +90,12 @@ int msg_lifecycleRequest(DBusConnection *connection, DBusMessage *message) if (reply == 0) { - DLT_LOG(gPclDLTContext, DLT_LOG_ERROR, DLT_STRING("msg_lifecycleRequest - DBus No memory")); + DLT_LOG(gPclDLTContext, DLT_LOG_ERROR, DLT_STRING("msgLcReq - DBus No mem")); } if (!dbus_connection_send(connection, reply, 0)) { - DLT_LOG(gPclDLTContext, DLT_LOG_ERROR, DLT_STRING("msg_lifecycleRequest - DBus No memory")); + DLT_LOG(gPclDLTContext, DLT_LOG_ERROR, DLT_STRING("msgLcReq - DBus No mem")); } dbus_message_unref(reply); @@ -109,17 +109,17 @@ int msg_lifecycleRequest(DBusConnection *connection, DBusMessage *message) if (reply == 0) { - DLT_LOG(gPclDLTContext, DLT_LOG_ERROR, DLT_STRING("msg_lifecycleRequest - DBus No memory")); + DLT_LOG(gPclDLTContext, DLT_LOG_ERROR, DLT_STRING("msgLcReq - DBus No mem")); } if (!dbus_message_append_args(reply, DBUS_TYPE_INT32, &msgReturn, DBUS_TYPE_INVALID)) { - DLT_LOG(gPclDLTContext, DLT_LOG_ERROR, DLT_STRING("msg_lifecycleRequest - DBus No memory")); + DLT_LOG(gPclDLTContext, DLT_LOG_ERROR, DLT_STRING("msgLcReq - DBus No mem")); } if (!dbus_connection_send(connection, reply, 0)) { - DLT_LOG(gPclDLTContext, DLT_LOG_ERROR, DLT_STRING("msg_lifecycleRequest - DBus No memory")); + DLT_LOG(gPclDLTContext, DLT_LOG_ERROR, DLT_STRING("msgLcReq - DBus No mem")); } dbus_connection_flush(connection); @@ -138,14 +138,14 @@ DBusHandlerResult checkLifecycleMsg(DBusConnection * connection, DBusMessage * m if((0==strncmp(gDbusLcConsterface, dbus_message_get_interface(message), 46))) { - DLT_LOG(gPclDLTContext, DLT_LOG_INFO, DLT_STRING("checkLifecycleMsg - Received dbus message: "), DLT_STRING(dbus_message_get_member(message))); + DLT_LOG(gPclDLTContext, DLT_LOG_INFO, DLT_STRING("chLcMsg - Received dbus msg: "), DLT_STRING(dbus_message_get_member(message))); if((0==strncmp(gDbusLcConsMsg, dbus_message_get_member(message), 16))) { result = msg_lifecycleRequest(connection, message); } else { - DLT_LOG(gPclDLTContext, DLT_LOG_ERROR, DLT_STRING("checkLifecycleMsg - unknown message "), DLT_STRING(dbus_message_get_interface(message))); + DLT_LOG(gPclDLTContext, DLT_LOG_ERROR, DLT_STRING("chLcMsg - unknown msg "), DLT_STRING(dbus_message_get_interface(message))); } } return result; diff --git a/src/persistence_client_library_pas_interface.c b/src/persistence_client_library_pas_interface.c index 7a85429..704045e 100644 --- a/src/persistence_client_library_pas_interface.c +++ b/src/persistence_client_library_pas_interface.c @@ -60,7 +60,7 @@ int check_pas_request(unsigned int request, unsigned int requestID) data.message.params[1] = requestID; data.message.string[0] = '\0'; // no string parameter, set to 0 - DLT_LOG(gPclDLTContext, DLT_LOG_INFO, DLT_STRING("check_pas_request - case PasMsg_Block o. PasMsg_WriteBack")); + DLT_LOG(gPclDLTContext, DLT_LOG_INFO, DLT_STRING("chkPasReq - case PasMsg_Block o. PasMsg_WriteBack")); if(-1 == deliverToMainloop_NM(&data)) { DLT_LOG(gPclDLTContext, DLT_LOG_ERROR, DLT_STRING("write failed w/ errno "), DLT_INT(errno), DLT_STRING(strerror(errno))); @@ -74,7 +74,7 @@ int check_pas_request(unsigned int request, unsigned int requestID) } case PasMsg_Unblock: { - DLT_LOG(gPclDLTContext, DLT_LOG_INFO, DLT_STRING("check_pas_request - case PasMsg_Unblock")); + DLT_LOG(gPclDLTContext, DLT_LOG_INFO, DLT_STRING("chkPasReq - case PasMsg_Unblock")); pers_unlock_access(); rval = PasErrorStatus_OK; break; @@ -110,12 +110,12 @@ DBusHandlerResult msg_persAdminRequest(DBusConnection *connection, DBusMessage * if(reply == 0) { - DLT_LOG(gPclDLTContext, DLT_LOG_ERROR, DLT_STRING("msg_persAdminRequest - DBus No memory")); + DLT_LOG(gPclDLTContext, DLT_LOG_ERROR, DLT_STRING("msgPasReq - DBus No mem")); } if (!dbus_connection_send(connection, reply, 0)) { - DLT_LOG(gPclDLTContext, DLT_LOG_ERROR, DLT_STRING("msg_persAdminRequest - DBus No memory")); + DLT_LOG(gPclDLTContext, DLT_LOG_ERROR, DLT_STRING("msgPasReq - DBus No mem")); } dbus_message_unref(reply); @@ -129,17 +129,17 @@ DBusHandlerResult msg_persAdminRequest(DBusConnection *connection, DBusMessage * if (reply == 0) { - DLT_LOG(gPclDLTContext, DLT_LOG_ERROR, DLT_STRING("msg_persAdminRequest - DBus No memory")); + DLT_LOG(gPclDLTContext, DLT_LOG_ERROR, DLT_STRING("msgPasReq - DBus No mem")); } if (!dbus_message_append_args(reply, DBUS_TYPE_INT32, &errorReturn, DBUS_TYPE_INVALID)) { - DLT_LOG(gPclDLTContext, DLT_LOG_ERROR, DLT_STRING("msg_persAdminRequest - DBus No memory")); + DLT_LOG(gPclDLTContext, DLT_LOG_ERROR, DLT_STRING("msgPasReq - DBus No mem")); } if (!dbus_connection_send(connection, reply, 0)) { - DLT_LOG(gPclDLTContext, DLT_LOG_ERROR, DLT_STRING("msg_persAdminRequest - DBus No memory")); + DLT_LOG(gPclDLTContext, DLT_LOG_ERROR, DLT_STRING("msgPasReq - DBus No mem")); } dbus_connection_flush(connection); @@ -165,12 +165,12 @@ int signal_persModeChange(DBusConnection *connection, DBusMessage *message) if(reply == 0) { - DLT_LOG(gPclDLTContext, DLT_LOG_ERROR, DLT_STRING("signal_persModeChange - DBus No memory")); + DLT_LOG(gPclDLTContext, DLT_LOG_ERROR, DLT_STRING("sigPersMoChng - DBus No mem")); } if (!dbus_connection_send(connection, reply, 0)) { - DLT_LOG(gPclDLTContext, DLT_LOG_ERROR, DLT_STRING("signal_persModeChange - DBus No memory")); + DLT_LOG(gPclDLTContext, DLT_LOG_ERROR, DLT_STRING("sigPersMoChng - DBus No mem")); } dbus_message_unref(reply); @@ -182,17 +182,17 @@ int signal_persModeChange(DBusConnection *connection, DBusMessage *message) if (reply == 0) { - DLT_LOG(gPclDLTContext, DLT_LOG_ERROR, DLT_STRING("signal_persModeChange - DBus No memory")); + DLT_LOG(gPclDLTContext, DLT_LOG_ERROR, DLT_STRING("sigPersMoChng - DBus No mem")); } if (!dbus_message_append_args(reply, DBUS_TYPE_INT32, &errorCode, DBUS_TYPE_INVALID)) { - DLT_LOG(gPclDLTContext, DLT_LOG_ERROR, DLT_STRING("signal_persModeChange - DBus No memory")); + DLT_LOG(gPclDLTContext, DLT_LOG_ERROR, DLT_STRING("sigPersMoChng - DBus No mem")); } if (!dbus_connection_send(connection, reply, 0)) { - DLT_LOG(gPclDLTContext, DLT_LOG_ERROR, DLT_STRING("signal_persModeChange - DBus No memory")); + DLT_LOG(gPclDLTContext, DLT_LOG_ERROR, DLT_STRING("sigPersMoChng - DBus No mem")); } dbus_connection_flush(connection); @@ -210,7 +210,7 @@ DBusHandlerResult checkPersAdminMsg(DBusConnection * connection, DBusMessage * m if((0==strcmp(gDbusPersAdminConsInterface, dbus_message_get_interface(message)))) { - DLT_LOG(gPclDLTContext, DLT_LOG_INFO, DLT_STRING("checkPersAdminMsg - Received dbus message: "), DLT_STRING(dbus_message_get_member(message))); + DLT_LOG(gPclDLTContext, DLT_LOG_INFO, DLT_STRING("checkPasMsg - Received dbus msg: "), DLT_STRING(dbus_message_get_member(message))); if((0==strcmp(gDbusPersAdminConsMsg, dbus_message_get_member(message)))) { @@ -218,12 +218,12 @@ DBusHandlerResult checkPersAdminMsg(DBusConnection * connection, DBusMessage * m } else { - DLT_LOG(gPclDLTContext, DLT_LOG_ERROR, DLT_STRING("checkPersAdminMsg - unknown message"), DLT_STRING(dbus_message_get_member(message))); + DLT_LOG(gPclDLTContext, DLT_LOG_ERROR, DLT_STRING("checkPasMsg - unknown msg"), DLT_STRING(dbus_message_get_member(message))); } } else { - DLT_LOG(gPclDLTContext, DLT_LOG_ERROR, DLT_STRING("checkPersAdminMsg - unknown message"), DLT_STRING(dbus_message_get_interface(message))); + DLT_LOG(gPclDLTContext, DLT_LOG_ERROR, DLT_STRING("checkPasMsg - unknown msg"), DLT_STRING(dbus_message_get_interface(message))); } return result; } @@ -244,7 +244,7 @@ int register_pers_admin_service(void) if(-1 == deliverToMainloop(&data)) { - DLT_LOG(gPclDLTContext, DLT_LOG_ERROR, DLT_STRING("register_pers_admin_service - failed to write to pipe"), DLT_INT(errno)); + DLT_LOG(gPclDLTContext, DLT_LOG_ERROR, DLT_STRING("pegPas - failed write pipe"), DLT_INT(errno)); rval = -1; } else @@ -269,7 +269,7 @@ int unregister_pers_admin_service(void) if(-1 == deliverToMainloop(&data)) { - DLT_LOG(gPclDLTContext, DLT_LOG_ERROR, DLT_STRING("unregister_pers_admin_service - failed to write to pipe"), DLT_INT(errno)); + DLT_LOG(gPclDLTContext, DLT_LOG_ERROR, DLT_STRING("unregPas - failed write pipe"), DLT_INT(errno)); rval = -1; } else diff --git a/src/persistence_client_library_prct_access.c b/src/persistence_client_library_prct_access.c index 96db5cc..646e444 100644 --- a/src/persistence_client_library_prct_access.c +++ b/src/persistence_client_library_prct_access.c @@ -118,7 +118,7 @@ int get_resource_cfg_table(PersistenceRCT_e rct, int group) snprintf(filename, DbPathMaxLen, gSharedWtPathKey, gAppId, group, gResTableCfg); break; default: - DLT_LOG(gPclDLTContext, DLT_LOG_ERROR, DLT_STRING("get_resource_cfg_table - no valid PersistenceRCT_e")); + DLT_LOG(gPclDLTContext, DLT_LOG_ERROR, DLT_STRING("gRCT - no valid PersistenceRCT_e")); break; } @@ -127,7 +127,7 @@ int get_resource_cfg_table(PersistenceRCT_e rct, int group) if(gResource_table[arrayIdx] < 0) { gResourceOpen[arrayIdx] = 0; - DLT_LOG(gPclDLTContext, DLT_LOG_ERROR, DLT_STRING("get_resource_cfg_table - RCT problem"), DLT_INT(gResource_table[arrayIdx] )); + DLT_LOG(gPclDLTContext, DLT_LOG_ERROR, DLT_STRING("gRCT - RCT problem"), DLT_INT(gResource_table[arrayIdx] )); } else { @@ -178,13 +178,13 @@ int get_db_context(PersistenceInfo_s* dbContext, const char* resource_id, unsign } else { - DLT_LOG(gPclDLTContext, DLT_LOG_WARN, DLT_STRING("get_db_context - resource_table: no value for key:"), DLT_STRING(resource_id) ); + DLT_LOG(gPclDLTContext, DLT_LOG_WARN, DLT_STRING("gDBCtx - RCT: no value for key:"), DLT_STRING(resource_id) ); rval = EPERS_NOKEYDATA; } } // resource table else { - DLT_LOG(gPclDLTContext, DLT_LOG_ERROR, DLT_STRING("get_db_context - resource table")); + DLT_LOG(gPclDLTContext, DLT_LOG_ERROR, DLT_STRING("gDBCtx - RCT")); rval = EPERS_NOPRCTABLE; } @@ -210,7 +210,7 @@ int get_db_context(PersistenceInfo_s* dbContext, const char* resource_id, unsign memcpy(dbContext->configKey.reponsible, "default", strlen("default")); memcpy(dbContext->configKey.custom_name, "default", strlen("default")); - DLT_LOG(gPclDLTContext, DLT_LOG_INFO, DLT_STRING("get_db_context - create resource not in PRCT => key:"), DLT_STRING(resource_id) ); + DLT_LOG(gPclDLTContext, DLT_LOG_INFO, DLT_STRING("gDBCtx - create res not in PRCT => key:"), DLT_STRING(resource_id) ); rval = get_db_path_and_key(dbContext, resource_id, dbKey, dbPath); } diff --git a/test/persistence_client_library_test.c b/test/persistence_client_library_test.c index 5e3c416..4911455 100644 --- a/test/persistence_client_library_test.c +++ b/test/persistence_client_library_test.c @@ -1272,7 +1272,6 @@ START_TEST(test_WriteConfDefault) // -- file interface --- memset(readBuffer, 0, READ_SIZE); fd = pclFileOpen(PCL_LDBID_LOCAL, "media/mediaData.configurable", PCL_USER_DEFAULTDATA, 99); - printf("The FD: %d\n", fd); ret = pclFileWriteData(fd, writeBuffer, strlen((char*)writeBuffer)); pclFileSeek(fd, 0, SEEK_SET); ret = pclFileReadData(fd, readBuffer, READ_SIZE); -- cgit v1.2.1