Insert a log message into the activity log of a HAM
#include <ha/ham.h> int ham_action_fail_log( ham_action_t *ahdl, const char *aname, const char *msg, unsigned attachprefix, int verbosity, unsigned flags);
libham
You can use the ham_action_fail_log() function to insert log messages into the activity log stream that a HAM maintains. This action is executed when the corresponding action that it is associated with fails.
The handle (ahdl) is obtained either:
or:
The log message to be inserted is specified by msg, and will be generated if the verbosity of the HAM is greater than or equal to the value specified in verbosity. Also, if attachprefix is non-zero, a prefix will be added to the log message that contains the current entity/condition/action that this message is related to.
The connection to the HAM is invalid. This happens when the process that opened the connection (using ham_connect()) and the process that's calling ham_action_restart() aren't the same.
In addition to the above errors, the HAM returns any error it encounters while servicing this request.
Safety: | |
---|---|
Cancellation point | No |
Interrupt handler | No |
Signal handler | No |
Thread | Yes |
ham_action_execute(), ham_action_fail_execute(), ham_action_handle(), ham_action_handle_free(), ham_action_heartbeat_healthy(), ham_action_log(), ham_action_notify_pulse(), ham_action_notify_signal(), ham_action_remove(), ham_action_restart(), ham_action_waitfor(), ham_condition(), ham_condition_handle()