*/
/**
- * @brief Enumeration for sorting orders.
+ * @brief Enumeration for timestamp-based log sorting orderings
* @since_tizen 6.0
* @remarks For information on the timestamp documentation, refer to @ref CAPI_SYSTEM_DLOGUTIL_OVERVIEW.
*/
} dlogutil_sorting_order_e;
/**
- * @brief A struct containing a single log entry.
+ * @brief A struct containing the metadata and contents for a single dlog entry.
* @since_tizen 6.0
*/
typedef struct dlogutil_entry dlogutil_entry_s;
/**
- * @brief Retrieves the TID of the log sender.
+ * @brief Retrieves the TID (thread identificator) of the log sender.
* @since_tizen 6.0
* @remarks If LOG_ID_KMSG is used as the buffer, this function will always return
* TIZEN_ERROR_NO_DATA. This is because the KMSG buffer contains no TID information.
int dlogutil_entry_get_tid(const dlogutil_entry_s *entry, pid_t *tid);
/**
- * @brief Retrieves the PID of the log sender.
+ * @brief Retrieves the PID (process identificator) of the log sender.
* @since_tizen 6.0
* @remarks If LOG_ID_KMSG is used as the buffer, this function will always return
* TIZEN_ERROR_NO_DATA. This is because the KMSG buffer contains no PID information.
int dlogutil_entry_get_pid(const dlogutil_entry_s *entry, pid_t *pid);
/**
- * @brief Retrieves the tag of the log entry.
+ * @brief Retrieves the tag (arbitrary label) of the log entry.
* @since_tizen 6.0
* @remarks The tag is owned by the entry so do not free nor modify it.
* In some rare cases the entry may be malformed and the message may turn out to be unavailable.
int dlogutil_entry_get_tag(const dlogutil_entry_s *entry, const char **tag);
/**
- * @brief Retrieves the message of the log entry.
+ * @brief Retrieves the message (without any metadata) of the log entry.
* @since_tizen 6.0
* @remarks The message is owned by the entry so do not free nor modify it.
* In some rare cases the entry may be malformed and the message may turn out to be unavailable.
int dlogutil_entry_get_message(const dlogutil_entry_s *entry, const char **msg);
/**
- * @brief Retrieves the timestamp of the log entry.
+ * @brief Retrieves the timestamp of given type from the log entry.
* @since_tizen 6.0
* @remarks The information about timestamp availability can be retrieved using the dlogutil_buffer_check_ts_type_available() function.
* For information on the timespec struct, refer to the clock_gettime(2) manpage.
int dlogutil_entry_get_timestamp(const dlogutil_entry_s *entry, dlogutil_sorting_order_e order, struct timespec *ts);
/**
- * @brief Retrieves the priority of the log entry.
+ * @brief Retrieves the priority level metadata of the log entry.
* @since_tizen 6.0
* @param[in] entry Log entry
* @param[out] prio Log priority
int dlogutil_entry_get_priority(const dlogutil_entry_s *entry, log_priority *prio);
/**
- * @brief A struct containing libdlogutil configuration.
+ * @brief A struct containing libdlogutil initialisation configuration.
* @since_tizen 6.0
*/
typedef struct dlogutil_config dlogutil_config_s;
/**
- * @brief Creates a new #dlogutil_config_s struct.
+ * @brief Creates a new #dlogutil_config_s struct to be filled with configuration.
* @since_tizen 6.0
- * @remarks Needs to be freed using dlogutil_config_destroy()
+ * @remarks Needs to be freed using dlogutil_config_destroy().
* @return A handle to the new struct, or NULL if out of memory
* @see dlogutil_config_destroy()
*/
dlogutil_config_s *dlogutil_config_create(void);
/**
- * @brief Destroys the #dlogutil_config_s struct.
+ * @brief Destroys the #dlogutil_config_s struct and cleans up its memory.
* @since_tizen 6.0
* @param[in] config A handle to the settings struct
* @see dlogutil_config_create()
/**
* @brief Enables retrieving only those logs that are logged by the thread with the given TID.
+ * @remarks Useful for dumping the logs of a specific thread in a multithreaded process.
* @since_tizen 6.0
* @param[in] config A handle to the settings struct
* @param[in] tid The TID value
/**
* @brief Enables retrieving only those logs that are logged by the process with the given PID.
+ * @remarks Useful for dumping the logs of a specific process.
* @since_tizen 6.0
* @param[in] config A handle to the settings struct.
* @param[in] pid The PID value.
int dlogutil_config_filter_filterspec(dlogutil_config_s *config, const char *query);
/**
- * @brief Disables log sorting.
+ * @brief Disables log sorting for given log retrieval request.
+ * @remarks Logs are still received in some order that is usually largely sorted,
+ * but if sorting is disabled logutil-side there may be cases where a log
+ * with a later timestamp is in front of a log with an earlier one.
+ * The use case here is performance, since the failure case above is rare.
* @since_tizen 6.0
* @param[in] config A handle to the settings struct
* @return An error code
int dlogutil_config_sorting_disable(dlogutil_config_s *config);
/**
- * @brief Enables sorting.
+ * @brief Enables log sorting for given log retrieval request.
* @since_tizen 6.0
- * @remarks This is the default.
+ * @remarks This is the default and generally makes sure that logs are in order,
+ * but has a modest performance cost.
* @param[in] config A handle to the settings struct
* @return An error code
* @retval TIZEN_ERROR_NONE Success
int dlogutil_config_sorting_enable_with_size(dlogutil_config_s *config, unsigned int entry_count);
/**
- * @brief Chooses a timestamp type to sort by.
+ * @brief Chooses a timestamp type by which returned logs are sorted by
* @since_tizen 6.0
* @remarks If the chosen timestamp is missing in the logs, currently they will not be sorted at all.
* This should, however, still become a reasonable order, since logs are usually stored
int dlogutil_config_order_set(dlogutil_config_s *config, dlogutil_sorting_order_e sort_by);
/**
- * @brief Adds a buffer to be handled
+ * @brief Adds a buffer whence logs will be taken to a request.
* @since_tizen 6.0
* @param[in] config A handle to the settings struct
* @param[in] buf The buffer ID to add to the handled set
int dlogutil_config_buffer_add(dlogutil_config_s *config, log_id_t buf);
/**
- * @brief Enables full dump mode.
+ * @brief Enables the full dump mode which prints every stored log
* @since_tizen 6.0
* @see dlogutil_config_mode_set_dump()
*/
#define DLOGUTIL_MAX_DUMP_SIZE UINT_MAX
/**
- * @brief A struct containing log getting state.
+ * @brief A struct containing the state of a log handling request
* @since_tizen 6.0
*/
typedef struct dlogutil_state dlogutil_state_s;
/**
- * @brief Destroys the #dlogutil_state_s struct.
+ * @brief Destroys the #dlogutil_state_s struct and frees its memory
* @since_tizen 6.0
* @param[in] state A handle to the state struct
* @see dlogutil_config_connect()
int dlogutil_config_connect(dlogutil_config_s *config, dlogutil_state_s **state_out);
/**
- * @brief Gets a single log.
+ * @brief Retrieves a single log according to a dump request
* @since_tizen 6.0
* @remarks If the calling process doesn't have CAP_SYSLOG and is not in the log group, you will only get
* some of the logs. Also, you must set the mode (dlogutil_config_mode_set_*).
int dlogutil_get_log(dlogutil_state_s *state, int timeout, dlogutil_entry_s **entry_out);
/**
- * @brief Clears a log buffer.
+ * @brief Irreversibly clears a log buffer from any logs inside
* @since_tizen 6.0
* @remarks You can't use one of the log-getting modes (dlogutil_config_mode_set_*).
* @param[in] state A handle to the state struct
int dlogutil_buffer_clear(dlogutil_state_s *state, log_id_t buffer);
/**
- * @brief Gets the name of a buffer.
+ * @brief Gets the human-readable, constant name of a buffer
* @since_tizen 6.0
* @remarks The returned string will have the static lifetime.
* @param[in] buffer A buffer to be inspected
int dlogutil_buffer_get_name(log_id_t buffer, const char **name);
/**
- * @brief Gets the capacity of a buffer.
+ * @brief Gets the data storage capacity of a log buffer in bytes
* @since_tizen 6.0
* @remarks Either CAP_SYSLOG or being in the log group is required.
* Also, you can't use one of the log-getting modes (dlogutil_config_mode_set_*).
int dlogutil_buffer_get_capacity(dlogutil_state_s *state, log_id_t buffer, unsigned int *capacity);
/**
- * @brief Gets the usage of a buffer.
+ * @brief Gets the storage data usage of a log buffer, in bytes
* @since_tizen 6.0
* @remarks Either CAP_SYSLOG or being in the log group is required.
* Also, you can't use one of the log-getting modes (dlogutil_config_mode_set_*).
int dlogutil_buffer_get_usage(dlogutil_state_s *state, log_id_t buffer, unsigned int *usage);
/**
- * @brief Gets the default timestamp type of a buffer.
+ * @brief Gets the default sorting timestamp type of a buffer.
* @since_tizen 6.0
* @remarks This is the timestamp type that will be used for sorting by default.
* We assume that it is always available and the input is sorted by it.
int dlogutil_buffer_check_ts_type_available(log_id_t buffer, dlogutil_sorting_order_e type, bool *available);
/**
- * @brief Gets the buffer aliasing information
+ * @brief Gets the buffer aliasing (same storage) information
* @since_tizen 6.0
* @remarks Sometimes, multiple buffers will be backed by a single log storage (for example, by the same
* kernel device). In such cases, the storage will only be opened once. This function allows you