Crate stumpless_sys
source ·Expand description
FFI bindings for the Stumpless logging library.
These wrappings are intended to be the bare minimum to use Stumpless from a Rust application.
§Create Features
Stumpless provides a number of build configuration options that can be used to enable or disable different functionality. This crate exposes these options as the following features.
§Target Features
- journald - Enables targets that can send logs to a systemd journald daemon.
- network - Enables targets that can send logs to a server over a network connection.
- socket - Enables targets that can send logs to Unix sockets.
- wel - Enables targets that can send logs to the Windows Event Log.
Structs§
- An element of structured data.
- A log entry.
- Information describing an error encountered by the library.
- A parameter within a structured data element.
- A target that log entries can be sent to.
- A description of a library version. This project follows semantic versioning.
Constants§
- < Internet Protocol version 4, RFC 791
- < Internet Protocl version 6, RFC 8200
- < TCP, RFC 793
- < UDP, RFC 768
Functions§
- Logs a message to the default target.
- Logs a message to the default target.
- Logs a message to the default target, along with the file, line, and function information specified in a structured data element.
- Logs a message to the default target, along with the file, line, and function information specified in a structured data element.
- Adds an element to an entry. The element is appended to the end of the list of elements in this entry.
- Adds an entry into a given target. This is the primary logging function of stumpless; all other logging functions call this one after performing any setup specific to themselves.
- Adds a log message with a priority to a given target.
- Adds a log message with a priority to a given target.
- Adds a message to a given target.
- Adds a string message to a given target.
- Creates a new element with the given name and adds it to this entry.
- Creates a new param and adds it to the given element.
- Creates a new param and adds it to the given element in the given entry. If an element with the given name does not exist in the given entry, then one will be created with the new param added to it.
- Adds a param to an element.
- Closes a buffer target.
- Closes a file target.
- Closes a function target.
- Closes a network target.
- Closes a stream target.
- Closes a target.
- Creates a copy of an element.
- Creates a copy of an entry.
- Creates a copy of a param.
- An alias for stumpless_destroy_element_and_contents.
- Destroys an element as well as all params that it contains, freeing any allocated memory.
- Destroys an element, freeing any allocated memory. Associated params are left untouched, and must be destroyed separately.
- An alias for stumpless_destroy_entry_and_contents.
- Destroys an entry as well as all elements and params that it contains, freeing any allocated memory.
- Destroys an entry, freeing any allocated memory. Associated elements and params are left untouched, and must be destroyed separately.
- Destroys a param, freeing any allocated memory.
- True if the given element has a param with the given name, false otherwise.
- Returns name and params from element as a formatted string. The character buffer should be freed when no longer is needed by the caller.
- True if the given entry has an element with the given name, false otherwise.
- Closes the default target if it has been opened, frees all memory allocated internally, and performs any other necessary cleanup.
- Frees all memory allocated internally to the calling thread, and performs any other thread-specific cleanup.
- Gets the current target.
- Gets the default facility of a target.
- Gets the default target.
- Gets the destination of a network target. The character buffer returned must be freed by the caller when it is no longer needed to avoid memory leaks.
- Returns the element at the given index in this Entry.
- Returns the element with the given name in this entry, if it is found.
- Returns the number of elements in the given entry.
- Returns the index of the element with the given name in this entry, if it is found.
- Returns the name of the given element. The character buffer must be freed by the caller when it is no longer needed to avoid memory leaks.
- Returns the app name of the given entry. The character buffer returned must be freed by the caller when it is no longer needed to avoid memory leaks.
- Returns the facility code of the given entry.
- Returns the hostname of a given entry. If hostname is not set it will return the machine hostname. The result character buffer must be freed by the caller when it is no longer needed to avoid memory leaks.
- Returns the message of the given entry. The character buffer returned must be freed by the caller when it is no longer needed to avoid memory leaks.
- Returns the msgid of the given entry. The character buffer returned must be freed by the caller when it is no longer needed to avoid memory leaks.
- Gets the param from the element at the given index in an entry.
- Gets the first param from the element with the given name in an entry.
- Gets the value of the param from the element at the given index in an entry. The result character buffer must be freed by the caller when it is no longer needed to avoid memory leaks.
- Gets the value of the first param from the element with the given name in an entry. The result character buffer must be freed by the caller when it is no longer needed to avoid memory leaks.
- Returns the prival of the given entry, as defined in RFC 5424.
- Returns the procid of a given entry. If procid is not set it will return the ProcessID. The result character buffer must be freed by the caller when it is no longer needed to avoid memory leaks.
- Returns the severity code of the given entry.
- Retrieves the error encountered by the last library call.
- Gets the error id of the given error.
- Gets the error string of the given error id.
- Gets the current stream that errors are written to.
- Gets the enum value corresponding to the given facility string.
- Gets the string representation of the given facility.
- Gets the network protocol of a network target.
- Gets a given option of a target.
- Returns the param in the given element at the specified index.
- Returns the first occurrence of a param with the given name in element, if it is found.
- Returns the number of params in the given element.
- Gives the index of the first occurrence of a param with the given name in the given element.
- Returns the name of the given param. The character buffer must be freed by the caller when it is no longer needed to avoid memory leaks.
- Gets the name of the param with the given index in this element. The result character buffer must be freed by the caller when it is no longer needed to avoid memory leaks.
- Gives the number of params with the given name found in the given element.
- Returns the value of the given param. The character buffer must be freed by the caller when it is no longer needed to avoid memory leaks.
- Returns the value of the param at the given index in the given element. The result character buffer must be freed by the caller when it is no longer needed to avoid memory leaks.
- Returns the value of the first param with the given name in the given element. The result character buffer must be freed by the caller when it is no longer needed to avoid memory leaks.
- Gets the enum value corresponding to the given severity string.
- Gets the string representation of the given severity.
- Returns the default app name of the given target. The character buffer must be freed by the caller when it is no longer needed to avoid memory leaks.
- Returns the default msgid of the given target. The character buffer must be freed by the caller when it is no longer needed to avoid memory leaks.
- Returns the current filter used by the given target to determine if entries should be allowed through it.
- Gets the log mask of a target.
- Returns the name of the given target. The character buffer must be freed by the caller when it is no longer needed to avoid memory leaks.
- Gets the string representation of the given target_type.
- Gets the transport port number of a network target. The character buffer returned must be freed by the caller when it is no longer needed to avoid memory leaks.
- Gets the transport protocol of a network target.
- Gets the current maximum message size of a UDP network target.
- Gets the version of code the library was built with. This version must be freed by the caller when it is no longer needed to avoid a memory leak.
- True if the last call to a stumpless function encountered an error. To get the error itself, use the stumpless_get_error function.
- Loads a provided element with the given name.
- Loads an entry struct with the given characteristics.
- Creates a new entry with the given characteristics.
- Loads a provided param with the given values.
- Compares the severity of the entry to the current mask of the target, and only passes the entry if the mask bit corresponding to the severity is set.
- Creates a new element with the given name.
- Creates a new entry with the given characteristics.
- Creates a new entry with the given characteristics.
- Creates a network target, but does not open it.
- Creates a new param with the given name and value.
- Creates a network target for logging over IPv4 and TCP, but does not open it.
- Creates a network target for logging over IPv6 and TCP, but does not open it.
- Creates a network target for logging over IPv4 and UDP, but does not open it.
- Creates a network target for logging over IPv6 and UDP, but does not open it.
- Creates a buffer target for the given buffer.
- Opens a file target.
- Opens a function target.
- Opens a network target.
- Opens a stream target for the stderr stream.
- Opens a stream target for the stdout stream.
- Opens a stream target for the given stream.
- Opens a target that has already been created and configured.
- Opens a network target for remote logging over IPv4 and TCP.
- Opens a network target for remote logging over IPv6 and TCP.
- Opens a network target for remote logging over IPv4 and UDP.
- Opens a network target for remote logging over IPv6 and UDP.
- Returns the name and the value from param as a formatted string. The character buffer should be freed when no longer is needed by the caller.
- Prints information about the current error to the error stream.
- Reads the next message from the provided buffer target and writes it into the given buffer.
- Sets the console stream to write logs to.
- Sets the target used when one is not provided.
- Sets the default facility of a target.
- Sets the destination of a network target.
- Puts the element at the given index in the given entry.
- Sets the name of the given element.
- Sets the app name for an entry.
- Sets the facility of an entry.
- Sets the hostname of a given entry. If hostname is NULL it will set hostname to be the Machine hostname.
- Sets the message of a given entry.
- Sets the message of a given entry.
- Sets the msgid for an entry.
- Puts the param in the element at the given index of an entry.
- Sets the value of the param in the element at the given index of an entry.
- Sets the value of the first param in the named element an entry.
- Sets the facility and severity of an entry.
- Sets the prival of an entry, as defined in RFC 5424.
- Sets the procid of a given entry. If procid is NULL it will set procid to be the ProcessID.
- Sets the severity of an entry.
- Sets the stream to write errors to.
- Sets the function used by the library to free memory.
- Sets the function used by the library to allocate memory.
- Sets an option on a target.
- Puts the param at the given index in the given element.
- Sets the name of the given param.
- Sets the value of the given param.
- Sets the value of the param at the given index in the given element.
- Sets the value of the first param with the given name in the given element.
- Sets the function used by the library to reallocate memory.
- Sets the default app name for a given target.
- Sets the default msgid for a given target.
- Sets the filter used to determine whether entries should be logged by a given target.
- Sets the log mask of a target.
- Sets the transport port number of a network target.
- Sets the maximum message size of a UDP network target.
- Checks to see if the given target is open.
- 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.
- Adds a log message with a priority to a given target, along with the file, line, and function information specified in a structured data element.
- Adds a log message with a priority to a given target, along with the file, line, and function information specified in a structured data element.
- Adds a message to a given target, along with the file, line, and function information specified in a structured data element.
- Adds a message to a given target, along with the file, line, and function information specified in a structured data element.
- Unloads an element as well as all params that it contains.
- Unloads an element, freeing any allocated memory. Associated params are left untouched, and must be unloaded separately.
- Unloads an entry as well as all elements that it contains.
- Unloads an entry, freeing any allocated memory. Associated elements are left untouched, and must be unloaded separately.
- Unloads a param.
- Unsets an option on a target.
- Compares the version of two given stumpless_version struct.
- Creates a string representation of the given version.
- Logs a message to the current target with the given priority.
- Sets the log mask of the current target.
- Logs a message to the current target with the given priority.
- Logs a message to the default target with the given priority, along with the file, line, and function information specified in a structured data element.
- Logs a message to the default target with the given priority, along with the file, line, and function information specified in a structured data element.
Type Aliases§
- An (enum) identifier of the types of errors that might be encountered.
- All possible facility codes available to log entries.
- A function that determines whether a given entry should be sent to a given target.
- A handler for entries sent to a function target.
- Network protocols used by a network target.
- All possible severity codes available to log entries.
- Types of targets that may be created.
- Transport protocols used by a network target.