gobj_log_add_handler()
#
Registers a new log handler with the specified name, type, options, and handler object. The function ensures that the handler name is unique and associates it with a registered handler type.
Prototype
int gobj_log_add_handler(
const char *handler_name,
const char *handler_type,
log_handler_opt_t handler_options,
void *h
);
Parameters
Key |
Type |
Description |
---|---|---|
|
|
The unique name of the log handler to be added. |
|
|
The type of the log handler, which must be previously registered. |
|
|
Bitmask of options that configure the behavior of the log handler. |
|
|
A pointer to the handler-specific data structure. |
Return Value
Returns 0 on success, or -1 if the handler name already exists or the handler type is not found.
Notes
The function checks if the handler name is already registered and ensures that the handler type exists before adding the handler. If the handler type is not found, the function returns an error.
Prototype
// Not applicable in JS
Prototype
# Not applicable in Python
Examples
// TODO C examples
// TODO JS examples
# TODO Python examples