Insert a log message into the activity log of a HAM
Synopsis:
#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);
Arguments:
- ahdl
- The HAM action handle.
- aname
- The name of the action.
- msg
- The message to be inserted into the activity log stream.
- attachprefix
-
If non-zero, the log action owner's name will be attached to the inserted message as a prefix.
- verbosity
-
The action's verbosity that will be compared with the verbosity of the HAM.
The inserted message will be generated if the verbosity of the HAM is greater
than or equal to the value specified in verbosity.
- flags
- Currently not used.
Description:
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:
- from one of the ham_action*() functions to add actions
or:
- by calling any of the ham_action_handle() functions
to request a handle to a specific action.
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.
Returns:
- 0
- Success.
- -1
- An error occurred (errno is set).
Errors:
- EBADF
- Couldn't connect to the HAM.
- EINVAL
- The name given in aname is invalid (e.g., it
contains the / character) or is NULL.
- ENAMETOOLONG
- The name given (in aname) is too long, i.e.
it exceeds _POSIX_PATH_MAX (defined in <limits.h>).
Note that the combined length of an entity/condition/action
name is also limited by _POSIX_PATH_MAX.
- ENOENT
- There's no entity or condition specified by the given
handle (ahdl).
- ENOMEM
- Not enough memory to create a new handle.
In addition to the above errors, the HAM returns any error
it encounters while servicing this request.
Classification:
QNX Neutrino
Safety: |
|
Cancellation point |
No |
Interrupt handler |
No |
Signal handler |
No |
Thread |
Yes |