stumpless 2.2.0
|
Chains allow logs to be sent to a group of targets. More...
Go to the source code of this file.
Functions | |
STUMPLESS_PUBLIC_FUNCTION struct stumpless_target * | stumpless_add_target_to_chain (struct stumpless_target *chain, struct stumpless_target *target) |
Adds a target to an existing chain target. | |
STUMPLESS_PUBLIC_FUNCTION void | stumpless_close_chain_and_contents (struct stumpless_target *chain) |
Closes a chain of targets. | |
STUMPLESS_PUBLIC_FUNCTION void | stumpless_close_chain_only (struct stumpless_target *chain) |
Closes a chain target. | |
STUMPLESS_PUBLIC_FUNCTION size_t | stumpless_get_chain_length (const struct stumpless_target *chain) |
Gets the number of targets currently in a chain. | |
STUMPLESS_PUBLIC_FUNCTION struct stumpless_target * | stumpless_new_chain (const char *name) |
Creates a new target chain. | |
Chains allow logs to be sent to a group of targets.
Thread Safety: MT-Safe Logging to chains is thread safe. A lock is used to prevent changes to the chain during a logging operation. Note that the thread safety of each target in the chain must also be considered when determining the thread safety of an operation on a chain.
Async Signal Safety: AS-Unsafe lock Logging to chains is not signal safe, as a non-reentrant lock is used to coordinate changes to the chain.
Async Cancel Safety: AC-Unsafe lock Logging to chains is not safe to call from threads that may be asynchronously cancelled, as the cleanup of the lock may not be completed.
STUMPLESS_PUBLIC_FUNCTION struct stumpless_target * stumpless_add_target_to_chain | ( | struct stumpless_target * | chain, |
struct stumpless_target * | target ) |
Adds a target to an existing chain target.
Thread Safety: MT-Safe This function is thread safe.
Async Signal Safety: AS-Unsafe lock heap This function is not safe to call from signal handlers due to the use of a non-reentrant lock as well as the use of memory allocation functions when the static target array is not big enough. If the chain has space for the new target in its static array, then the heap constraint is not present.
Async Cancel Safety: AC-Unsafe lock heap This function is not safe to call from threads that may be asynchronously cancelled, as the lock may not be released, and the memory allocation functions may not be AC-Safe. If the chain has space for the new target in its static array, then the heap constraint is not present.
chain | The chain target to add the target to. |
target | The new target to add to the chain. |
STUMPLESS_PUBLIC_FUNCTION void stumpless_close_chain_and_contents | ( | struct stumpless_target * | chain | ) |
Closes a chain of targets.
This function closes each target in the chain, and then destroys all memory allocated for the chain itself.
Thread Safety: MT-Unsafe This function is not thread safe as it destroys resources that other threads would use if they tried to reference this target.
Async Signal Safety: AS-Unsafe lock heap This function is not safe to call from signal handlers due to the destruction of a lock that may be in use as well as the use of the memory deallocation function to release memory.
Async Cancel Safety: AC-Unsafe lock heap This function is not safe to call from threads that may be asynchronously cancelled, as the cleanup of the lock may not be completed, and the memory deallocation function may not be AC-Safe itself.
chain | The chain of targets to close. |
STUMPLESS_PUBLIC_FUNCTION void stumpless_close_chain_only | ( | struct stumpless_target * | chain | ) |
Closes a chain target.
This function destroys all memory allocated for the chain itself. The targets in the chain are not closed or modified.
Thread Safety: MT-Unsafe This function is not thread safe as it destroys resources that other threads would use if they tried to reference this target.
Async Signal Safety: AS-Unsafe lock heap This function is not safe to call from signal handlers due to the destruction of a lock that may be in use as well as the use of the memory deallocation function to release memory.
Async Cancel Safety: AC-Unsafe lock heap This function is not safe to call from threads that may be asynchronously cancelled, as the cleanup of the lock may not be completed, and the memory deallocation function may not be AC-Safe itself.
chain | The chain to close. |
STUMPLESS_PUBLIC_FUNCTION size_t stumpless_get_chain_length | ( | const struct stumpless_target * | chain | ) |
Gets the number of targets currently in a chain.
Thread Safety: MT-Safe This function is thread safe.
Async Signal Safety: AS-Unsafe lock This function is not safe to call from signal handlers due to the use of a non-reentrant lock.
Async Cancel Safety: AC-Unsafe lock This function is not safe to call from threads that may be asynchronously cancelled, as the lock may not be released.
chain | The chain to get the length of. |
STUMPLESS_PUBLIC_FUNCTION struct stumpless_target * stumpless_new_chain | ( | const char * | name | ) |
Creates a new target chain.
Thread Safety: MT-Safe This function is thread safe.
Async Signal Safety: AS-Unsafe heap This function is not safe to call from signal handlers due to the use of memory allocation functions.
Async Cancel Safety: AC-Unsafe heap This function is not safe to call from threads that may be asynchronously cancelled, as the memory allocation function may not be AC-Safe itself.
name | The name of the logging target, as well as the name of the file to open. |