Skip to content

Commit

Permalink
Fix nasa#1349, remove unneeded CFE_ES_SYSLOG_APPEND macro
Browse files Browse the repository at this point in the history
Replace remaining uses of this internal macro with the
CFE_ES_WriteToSysLog API.
  • Loading branch information
jphickey committed Apr 16, 2021
1 parent e80aae9 commit 7406d50
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 23 deletions.
2 changes: 1 addition & 1 deletion modules/es/fsw/src/cfe_es_cds.c
Original file line number Diff line number Diff line change
Expand Up @@ -922,7 +922,7 @@ int32 CFE_ES_DeleteCDS(const char *CDSName, bool CalledByTblServices)
/* Output the message to syslog once the CDS registry resource is unlocked */
if (LogMessage[0] != 0)
{
CFE_ES_SYSLOG_APPEND(LogMessage);
CFE_ES_WriteToSysLog("%s", LogMessage);
}

return Status;
Expand Down
4 changes: 2 additions & 2 deletions modules/es/fsw/src/cfe_es_cds_mempool.c
Original file line number Diff line number Diff line change
Expand Up @@ -255,7 +255,7 @@ int32 CFE_ES_CDSBlockWrite(CFE_ES_CDSHandle_t Handle, const void *DataToWrite)
/* Do the actual syslog if something went wrong */
if (LogMessage[0] != 0)
{
CFE_ES_SYSLOG_APPEND(LogMessage);
CFE_ES_WriteToSysLog("%s", LogMessage);
}

return Status;
Expand Down Expand Up @@ -348,7 +348,7 @@ int32 CFE_ES_CDSBlockRead(void *DataRead, CFE_ES_CDSHandle_t Handle)
/* Do the actual syslog if something went wrong */
if (LogMessage[0] != 0)
{
CFE_ES_SYSLOG_APPEND(LogMessage);
CFE_ES_WriteToSysLog("%s", LogMessage);
}

return Status;
Expand Down
20 changes: 0 additions & 20 deletions modules/es/fsw/src/cfe_es_log.h
Original file line number Diff line number Diff line change
Expand Up @@ -85,26 +85,6 @@
*/
#define CFE_ES_SYSLOG_READ_BUFFER_SIZE (3 * CFE_ES_MAX_SYSLOG_MSG_SIZE)

/**
* \brief Self-synchronized macro to call CFE_ES_SysLogAppend_Unsync
*
* Calls CFE_ES_SysLogAppend_Unsync() with appropriate synchronization.
* It will acquire the shared data lock and release it after appending the log.
*
* This is implemented as a macro such that the "__func__" and "__LINE__" directives
* will reflect the actual place that the append was done, rather than where this
* wrapper was defined.
*
* \sa CFE_ES_SysLogAppend_Unsync()
*/
#define CFE_ES_SYSLOG_APPEND(LogString) \
{ \
CFE_ES_LockSharedData(__func__, __LINE__); \
CFE_ES_SysLogAppend_Unsync(LogString); \
CFE_ES_UnlockSharedData(__func__, __LINE__); \
OS_printf("%s", LogString); \
}

/**
* \brief Indicates no context information Error Logs
*
Expand Down

0 comments on commit 7406d50

Please sign in to comment.