stumpless_trace_entry

Function stumpless_trace_entry 

Source
pub unsafe extern "C" fn stumpless_trace_entry(
    target: *mut stumpless_target,
    entry: *mut stumpless_entry,
    file: *const c_char,
    line: c_int,
    func: *const c_char,
) -> c_int
Expand description

Adds an entry into a given target. The entry has a structured data element added to it with the file, line, and function information specified.

The trace information is added in an element named trace with params named file, line, and function for the respective pieces of information.

Thread Safety: MT-Safe env locale This function is thread safe. Different target types handle thread safety differently, as some require per-target locks and others can rely on system libraries to log safely, but all targets support thread safe logging in some manner. For target-specific information on how thread safety is supported and whether AS or AC safety can be assumed, refer to the documentation for the target’s header file (in the stumpless/target include folder). For all targets, the environment variables and locale will be used during some of the string formatting of the message.

Async Signal Safety: AS-Unsafe lock This function is not safe to call from signal handlers as some targets make use of non-reentrant locks to coordinate access.

Async Cancel Safety: AC-Unsafe lock This function is not safe to call from threads that may be asynchronously cancelled, due to the use of locks in some targets that could be left locked.

@since release v2.1.0

@param target The target to send the message to.

@param entry The entry to send to the target.

@param file The name of the source file the entry should be tied to.

@param line The line in the source file that the entry should be tied to.

@param func The name of the function that the entry should be tied to.

@return A non-negative value if no error is encountered. If an error is encountered, then a negative value is returned and an error code is set appropriately. If the entry was rejected by the target’s filter, then 0 is returned.