*.exe
packages
binaries
+documentation/
*.ipk
*~
.deps/
--- /dev/null
+# Crucial stuff
+PROJECT_NAME = "dlog"
+PROJECT_BRIEF = "Logging framework"
+OUTPUT_DIRECTORY = "documentation"
+INPUT = doc/ src/shared src/logutil src/logger src/loginit src/libdlog src/logctrl include/
+RECURSIVE = YES
+
+# Misc optimisation
+OPTIMIZE_OUTPUT_FOR_C = YES
+INLINE_GROUPED_CLASSES = NO
+INLINE_SIMPLE_STRUCTS = NO
+EXTRACT_ALL = YES
+EXTRACT_PRIVATE = YES
+EXTRACT_STATIC = YES
+REFERENCED_BY_RELATION = NO
+REFERENCES_RELATION = NO
+REPEAT_BRIEF = NO
+SEARCHENGINE = YES
+GENERATE_LATEX = NO # 2kinky4me
+CASE_SENSE_NAMES = NO
+ENUM_VALUES_PER_LINE = 1
+HAVE_DOT = NO
+QUIET = YES
+
pkgconfigdir = $(libdir)/pkgconfig
pkgconfig_DATA = dlog.pc
+
+dox::
+ doxygen
+
+.PHONY: dox
#define __TIZEN_SYSTEM_DLOG_DOC_H__
/**
- * @defgroup CAPI_SYSTEM_DLOG dlog
+ * @defgroup DLOG_IMPLEMENTATION DLog internal implementation
+ * @brief The internals of DLog
+ * @details This group collects the infernal implementation of the various programs the DLog framework consists of.
+ *
+ * @defgroup SHARED_FUNCTIONS Shared functions
+ * @ingroup DLOG_IMPLEMENTATION
+ * @brief Miscellaneous functions
+ * @details A loose collection of functions used across multiple DLog programs.
+ */
+
+/**
+ * @defgroup DLOG_COMMAND_LINE_UTILITIES DLog command line utilities
+ * @brief Interface utilities for the framework
+ * @details A collection of utilities for communicating with the framework so as to manipulate it.
+ */
+
+/**
+ * @defgroup CAPI_SYSTEM_DLOG DLog Public CAPI
* @brief The Dlog API provides functions for sending log output.
* @ingroup CAPI_SYSTEM_FRAMEWORK
* @section CAPI_SYSTEM_DLOG_HEADER Required Header
} while (0); })
@endcode
-<h1 class="pg">dlogutil</h1>
-<h2 class="pg">Introduction</h2>
-You can use dlogutil command to view and follow the contents of the log buffers. The general usage is :
-@code
-dlogutil [<option>] ... [<filter-spec>] ...
-@endcode
-
-<h2 class="pg">Filtering log output</h2>
-Every log message has a <I>tag</I> and a <I>priority</I> associated with it.
-Filter expression follows this format <B><I>tag:priority</I></B> where <I>tag</I> indicates the tag of interest and <I>priority</I> indicates the minimum level of priority to report for that tag. You can add any number of tag:priority specifications in a single filter expression.
-The tag of a log message is a short indicating the system component from which the message originates
-The <I>priority</I> is one of the following character values, orderd from lowest to highest priority:<br>
-D - debug<br>
-I - info<br>
-W - warning<br>
-E - Error<br>
-
-for example, if you want to see MY_APP tag and above of debug priority,
-@code
-# dlogutil MY_APP:D
-@endcode
-if you want to see all log message above of info priority.
-@code
-# dlogutil *:I
-@endcode
-
-<h2 class="pg">List of logutil command options</h2>
-
-<table>
-<tr>
- <th>Option</th>
- <th>Description</th>
-</tr>
-<tr>
- <td>-b \<buffer\> </td>
- <td>Alternate log buffer. The main buffer is used by default buffer. </td>
-</tr>
-<tr>
- <td>-c</td>
- <td>Clears the entire log and exits</td>
-</tr>
-<tr>
- <td>-d</td>
- <td>Dumps the log and exits.</td>
-</tr>
-<tr>
- <td>-f \<filename\></td>
- <td>Writes log to filename. The default is stdout</td>
-</tr>
-<tr>
- <td>-g</td>
- <td>Print the size of the specified log buffer and exits.</td>
-</tr>
-<tr>
- <td>-n \<count\></td>
- <td>Sets the maximum number of rotated logs to count. The default value is 4. Requires the -r option</td>
-</tr>
-<tr>
- <td>-r \<Kbytes\></td>
- <td>Rotates the log file every Kbytes of output. The default value is 16. Requires the -f option.</td>
-</tr>
-<tr>
- <td>-s</td>
- <td>Sets the default filter spec to silent.</td>
-</tr>
-<tr>
- <td>-v \<format\></td>
- <td>Sets the output format for log messages. The default is brief format. </td>
-</tr>
-
-</table>
->>>>>>> mobile
*
**/
+
+/**
+ * @addtogroup DLOG_COMMAND_LINE_UTILITIES
+ *
+ * Most CLI allow you to specify buffers. These are:
+ *
+ * name | remarks
+ * -------|---------
+ * main | the default, for general platform logging
+ * system | for system logs
+ * radio | for radio logs
+ * apps | for applications
+ * kmsg | a copy of kernel messages (dmesg)
+ *
+ * There are also priorities to be specified. These are one letter abbreviations of the following levels:
+ *
+ * Abbr | Level
+ * -----|-------
+ * V | verbose
+ * D | debug
+ * I | info
+ * W | warning
+ * E | error
+ * F | fatal
+ * S | silent
+ *
+ * Formats, and what they look like:
+ *
+ * name | specification | example
+ * -----------|------------------------------------------|-------------
+ * brief | PRI/TAG(PID): MSG | E/TEST_APP(123): FOO
+ * process | PRI(PID) MSG (TAG) | E(123) FOO (TEST_APP)
+ * tag | PRI/TAG: MSG | E/TEST_APP: FOO
+ * thread | PRI('P'PID, 'T'TID) MSG | E(P123, T456) FOO
+ * raw | MSG | FOO
+ * time | REALTIME PRI/TAG(PID): MSG | 12-31 23:59:59.999 +0200 E/TEST_APP(123): FOO
+ * threadtime | REALTIME PRI/TAG('P'PID, 'T'TID): MSG | 12-31 23:59:59.999 +0200 E/TEST_APP(P123, T456): FOO
+ * kerneltime | BOOTTIME PRI/TAG('P'PID, 'T'TID): MSG | 0.123 E/TEST_APP(P123, T456): FOO
+ * long | [REALTIME PRI/TAG 'P'PID, 'T'TID]<br>MSG<br> | [12-31 23:59:59.999 +0200 E/TEST_APP P123, T456]<br>FOO<br>
+ */
+
#endif /* __TIZEN_SYSTEM_DLOG_DOC_H__ */
--- /dev/null
+/** @mainpage Logging framework
+
+DLog is a logging framework. It allows applications to create log messages for later retrieval.
+
+Each log has a priority level and a tag for easier access. When reading logs, one can filter by these two values.
+
+Applications using the public API can only write to a common application buffer. Platform code also has access to three additional buffers: main, radio and system.
+
+Under the hood, dlog can use one of multiple back-ends. The CAPI stays the same for each backend but there might be slight differences when retrieving the logs.
+
+DLog had been introduced gradually and its earliest availability varies by profile:
+
+Profile | Version
+---------|----------
+Mobile | 2.3
+Wearable | 2.3.1
+TV | 3.0
+
+*/
/**
* @internal
* @brief log id
- * @since_tizen @if MOBILE 2.3 @elseif WEARABLE 2.3.1 @elseif TV 3.0 @endif
*/
typedef enum {
LOG_ID_INVALID = -1,
/**
* @brief Enumeration for Dlog Error.
- * @since_tizen @if MOBILE 2.3 @elseif WEARABLE 2.3.1 @elseif TV 3.0 @endif
*/
typedef enum {
DLOG_ERROR_NONE = TIZEN_ERROR_NONE, /**< Successful */
/**
* @brief Enumeration for log priority values in ascending priority order.
- * @since_tizen @if MOBILE 2.3 @elseif WEARABLE 2.3.1 @elseif TV 3.0 @endif
*/
typedef enum {
DLOG_UNKNOWN = 0, /**< Keep this always at the start */
/**
* @brief Sends log with priority and tag.
* @details for application.
- * @since_tizen @if MOBILE 2.3 @elseif WEARABLE 2.3.1 @elseif TV 3.0 @endif
- * @param[in] prio log_priority
- * @param[in] tag Tag
- * @param[in] fmt Format string
+ * @param[in] prio priority level of type #log_priority
+ * @param[in] tag tag - a null-terminated string
+ * @param[in] fmt format string - same as printf
* @return On success, the function returns the number of bytes written.
* On error, a negative errno-style error code
* @retval #DLOG_ERROR_INVALID_PARAMETER Invalid parameter
/**
* @brief Sends log with priority, tag, and va_list.
* @details for application.
- * @since_tizen @if MOBILE 2.3 @elseif WEARABLE 2.3.1 @elseif TV 3.0 @endif
- * @param[in] prio log_priority
- * @param[in] tag Tag
- * @param[in] fmt Format string
+ * @param[in] prio priority level of type #log_priority
+ * @param[in] tag tag - a null-terminated string
+ * @param[in] fmt format string - same as printf
* @param[in] ap va_list
* @return On success, the function returns the number of bytes written.
* On error, a negative errno-style error code
%description -n dlogutil
Utilities for print log data
+%package -n dlog-doc
+Summary: Dox
+BuildRequires: doxygen
+
+%description -n dlog-doc
+Documentation for dlog
%prep
%setup -q
make check
+make dox
+
%install
rm -rf %{buildroot}
%make_install
mkdir -p %{buildroot}/usr/bin/
+
+mkdir -p %{buildroot}/usr/share/doc/dlog
+cp -r documentation/* %{buildroot}/usr/share/doc/dlog
+
mkdir -p %{buildroot}%{TZ_SYS_ETC}
install -m 0644 configs/dlog.conf.pipe %{buildroot}%{TZ_SYS_ETC}/dlog.conf.pipe
install -m 0644 configs/dlog.conf.kmsg %{buildroot}%{TZ_SYS_ETC}/dlog.conf.kmsg
%attr(664,log,log) %{TZ_SYS_ETC}/dlog.conf.logger
# For upgrade
%{upgrade_file_path}/data/dlog.conf.logger
+
+%files -n dlog-doc
+/usr/share/doc/dlog
/**
* @brief Null handler
- * @description Ignores a log
+ * @details Ignores a log
* @param[in] log_id ID of the buffer to log to. Belongs to (LOG_ID_INVALID, LOG_ID_MAX) non-inclusive
* @param[in] prio Priority of the message.
* @param[in] tag The message tag, identifies the sender.
return ret;
}
-/**
- * @brief Print log
- * @details Print a log line
- * @param[in] prio Priority
- * @param[in] tag tag
- * @param[in] fmt Format (same as printf)
- * @param[in] ap Argument list
- * @return Bytes written, or negative error
- */
int dlog_vprint(log_priority prio, const char *tag, const char *fmt, va_list ap)
{
char buf[LOG_MAX_SIZE];
return write_to_log(LOG_ID_APPS, prio, tag, buf);
}
-/**
- * @brief Print log
- * @details Print a log line
- * @param[in] prio Priority
- * @param[in] tag tag
- * @param[in] fmt Format (same as printf)
- * @return Bytes written, or negative error
- */
int dlog_print(log_priority prio, const char *tag, const char *fmt, ...)
{
va_list ap;
/**
* @brief Write to log
- * @description Writes a log
+ * @details Writes a log
* @param[in] log_id ID of the buffer to log to. Belongs to (LOG_ID_INVALID, LOG_ID_MAX) non-inclusive
* @param[in] prio Priority of the message.
* @param[in] tag The message tag, identifies the sender.
/**
* @brief Initialize the backend
- * @description Prepares the backend for proper and fruitful work
+ * @details Prepares the backend for proper and fruitful work
*/
void __dlog_init_android()
{
/**
* @brief Write to log
- * @description Writes a log
+ * @details Writes a log
* @param[in] log_id ID of the buffer to log to. Belongs to (LOG_ID_INVALID, LOG_ID_MAX) non-inclusive
* @param[in] prio Priority of the message.
* @param[in] tag The message tag, identifies the sender.
/**
* @brief Initialize the backend
- * @description Prepares the backend for proper and fruitful work
+ * @details Prepares the backend for proper and fruitful work
*/
void __dlog_init_kmsg()
{
/**
* @brief Write to log
- * @description Writes a log
+ * @details Writes a log
* @param[in] log_id ID of the buffer to log to. Belongs to (LOG_ID_INVALID, LOG_ID_MAX) non-inclusive
* @param[in] prio Priority of the message.
* @param[in] tag The message tag, identifies the sender.
/**
* @brief Initialize the backend
- * @description Prepares the backend for proper and fruitful work
+ * @details Prepares the backend for proper and fruitful work
*/
void __dlog_init_pipe()
{
#include <logconfig.h>
#include "logctrl_doc.h"
+/**
+ * @addtogroup DLOG_IMPLEMENTATION
+ * @{
+ * @defgroup DLOG_CTRL Control
+ * @brief The config controller
+ * @details The controller responsible for manipulation of the configuration.
+ * @{
+ */
+
struct options {
int print_all;
int has_key;
log_config_free(&conf_etc);
return 1;
}
+
+/**
+ * @}
+ * @}
+ */
+/**
+ @defgroup CLI_DLOGCTRL dlogctrl usage
+ @ingroup DLOG_COMMAND_LINE_UTILITIES
+ @brief Configuration manipulation application
+ @details dlogctrl is an application that helps configure the logging framework.
+
+The program accepts the following arguments:
+
+Argument | Requirements | Meaning
+---------|-------------------------------------------|-------------
+-p | conflicts with -ki | Print all config values.
+-i | conflicts with -pk | Show extended information.
+-k key | conflicts with -ip, requires one of -gsc | Choose a key for -gsc
+-c | conflicts with -gs, requires -k | Clear the value associated with the key
+-g | conflicts with -sc, requires -k | Print the value associated with the key
+-s value | conflicts with -gc, requires - k | Set the value associated with the key
+
+Important config entries:
+
+Key | Value | Meaning
+--------|-------|----
+plog | 0 or 1 | Enable platform logging. Else, only app logs are collected.
+limiter | 0 or 1 | Enable log limiting. See limiter rules for details.
+limiter\|\<TAG\>\|\<PRIORITY\> | "allow", "deny" or integers | A series of entries to control limiting of apps with given TAG and PRIORITY. "allow" and values < 0 mean no filtering, "deny" or values > 10000 mean no logging allowed, and values between 0 and 10000 mean this many logs per minute are allowed.
+util_sorting_time_window | >= 0 | Sorting time window (in ms) for dlogutil. dlogutil can achieve logs out of order so it waits a bit to make sure unsorted logs have had time to arrive and get sorted.
+dlog_logger_conf_# | dlogutil invocations | The keys should be consecutive numbers from 0. The logger daemon will behave as if dlogutil was invoked for each of these.
+\<BUFFER\> | path | Specifies the path to given buffer. Only for android-logger and kmsg backends. Do not change because these are usually hardcoded in the kernel.
+\<BUFFER\>_{ctl,write}_sock | path | Pipe backend only. Specifies a path to the control/write socket for given buffer.
+\<BUFFER\>_{ctl,write}_sock_owner | username | Pipe backend only. Specifies the owner of the control/write socket for given buffer.
+\<BUFFER\>_{ctl,write}_sock_group | path | Pipe only. Specifies the group of the control/write socket for given buffer.
+\<BUFFER\>_{ctl,write}_sock_rights | file permissions | Pipe backend only. Specifies file permissions of the control/write socket for given buffer (in the usual octal format).
+\<BUFFER\>_size | > 0 | Size of given buffer
+debugmode | 0 or 1 | If 0, logs of DEBUG priority are dropped
+util_sorting_buffer_size | > 0 | How large of a buffer dlogutil keeps for sorting.
+
+*/
+
+
+
void print_help()
{
printf("dlogctrl - provides control over dlog configuration. Options:\n"
- "\t-p Precludes -kh. Prints all entries in the config.\n"
- "\t-k key Precludes -ph and requires one of -gs. Specifies a config key.\n"
+ "\t-p Precludes -ki. Prints all entries in the config.\n"
+ "\t-k key Precludes -pi and requires one of -gs. Specifies a config key.\n"
"\t-g Requires -k, precludes -cs. Gets and prints the value of the entry assigned to the key.\n"
"\t-s value Requires -k, precludes -cg. Sets the value of the entry associated with the key.\n"
"\t-c Requires -k, precludes -gs. Clears the entry.\n"
#include <logconfig.h>
#include <systemd/sd-daemon.h>
+/**
+ * @addtogroup DLOG_IMPLEMENTATION
+ * @{
+ * @defgroup DLOG_LOGGER Logger
+ * @brief Logger daemon
+ * @details The logger is the core component of the logging framework. It is responsible for collecting, processing and exposing logs.
+ * @{
+ */
+
/* supported main() return codes */
enum {
DLOG_EXIT_SUCCESS = 0,
/**
* @brief Get numerical ids for specified user and group
- * @detail Converts user and group strings to proper uid and gid identifiers
+ * @details Converts user and group strings to proper uid and gid identifiers
* @param[in] user The new user
* @param[in] group The new group
* @param[out] uid The uid for user
/**
* @brief Change file owners
- * @detail Changes user and group ownership of a file
+ * @details Changes user and group ownership of a file
* @param[in] file Filename of the file to change
* @param[in] user The new user
* @param[in] group The new group
* @param[in] socket The FD of the socket
* @param[in] wr_pipe The pipe to send over the socket
* @param[in] type The type of the pipe (DLOG_FLAG_READ or DLOG_FLAG_WRITE)
- * @return 0 on success, else negative error
+ * @return 0 on success, else -errno
*/
static int send_pipe(int socket, int wr_pipe, int type)
{
/**
* @brief Writer close FD
- * @description Close a writer's connections
+ * @details Close a writer's connections
* @param[in] server The logger server
* @param[in] wr The writer whose connections to close
*/
/**
* @brief Service util request
- * @description Handle a request from util
+ * @details Handle a request from util
* @param[in] server The logger server
* @param[in] wr The writer who sent the request
* @param[in] msg The message containing the request
/**
* @brief Service clear request
- * @description Handle a clear-buffer request
+ * @details Handle a clear-buffer request
* @param[in] server The logger server
* @param[in] wr The writer who sent the request
* @param[in] msg The message containing the request
/**
* @brief Service a pipe acquisition request
- * @description Handle a pipe request
+ * @details Handle a pipe request
* @param[in] server The logger server
* @param[in] wr The writer who sent the request
* @param[in] msg The message containing the request
/**
* @brief Service a socket request
- * @description Handle a socket request
+ * @details Handle a socket request
* @param[in] server The logger server
* @param[in] wr The writer who sent the request
* @param[in] event The event containing the request
/**
* @brief Service pipe log data
- * @description Handle log messages incoming through a pipe
+ * @details Handle log messages incoming through a pipe
* @param[in] server The logger server
* @param[in] wr The writer who sent the logs
* @param[in] event The event associated with the data
/**
* @brief Service /dev/kmsg
- * @description Read from the /dev/kmsg device
+ * @details Read from the /dev/kmsg device
* @param[in] server The logger server
* @param[in] wr The writer who sent the request
* @param[in] event The relevant event
- * @return 0 on success, else errno
+ * @return 0 on success, else -errno
*/
static int service_writer_kmsg(struct logger* server, struct writer* wr, struct epoll_event* event)
{
/**
* @brief Service a writer
- * @description Relegates the event to specific handlers
+ * @details Relegates the event to specific handlers
* @param[in] server The logger server
* @param[in] wr The writer who sent the request
* @param[in] event The relevant event
logger_free(&server);
return ret;
}
+
+/**
+ * @}
+ * @}
+ */
remove_kmsg_devs(kmsg_fd);
exit(EXIT_FAILURE);
}
+
+/**
+ @defgroup CLI_DLOGINIT dloginit usage
+ @ingroup DLOG_COMMAND_LINE_UTILITIES
+ @brief KMSG buffer creator
+ @details dloginit provides a way to create buffers in the KMSG backend. It works in three simple steps:
+
+ 1) read requested size values from the config
+
+ 2) create buffers
+
+ 3) write final size values and buffer paths back to the config
+
+It accepts no parameters. To read more about the config, see dlogctrl documentation.
+*/
+
#include "logutil_doc.h"
#include <dlog_ioctl.h>
+/**
+ * @addtogroup DLOG_IMPLEMENTATION
+ * @{
+ * @defgroup DLOG_UTIL Util
+ * @brief The log retrieval utility
+ * @details The utility responsible for reading and processing logs for the user.
+ * @{
+ */
+
/* should fit a whole command line with concatenated arguments (reasonably) */
#define MAX_LOGGER_REQUEST_LEN 127
/**
* @brief Clear request
* @details Send a CLEAR request to the logger daemon
- * @param[in] The socket to send the request over
+ * @param[in] sock_fd The socket to send the request over
* @return 1 on success, 0 on failure
*/
static int do_clear_pipe(int sock_fd)
* @brief Get buffer size
* @details Print the size of the working buffer
* @param[in] conf The configuration
+ * @param[in] names Buffers to process
+ * @param[in] cnt Buffer count
* @return 0 on success, 1 on failure
*/
static int do_getsize(struct log_config * conf, char ** names, int cnt)
* @details Send a logging request to the daemon
* @param[in] argc Argument count
* @param[in] argv Argument values
- * @preturn 1 on success, 0 on failure
+ * @param[in] sock_fd Socket file descriptor
+ * @return 1 on success, 0 on failure
*/
static int send_logger_request(int argc, char ** argv, int sock_fd)
{
/**
* @brief Filter buffer names
* @details Purges invalid buffer names from the table
- * @param[in/out] names The buffer names
- * @param[in/out] cnt The table size
+ * @param[in,out] names The buffer names
+ * @param[in,out] cnt The table size
*/
void filter_buffer_names(char ** names, int * cnt)
{
printf("Error: -%c requires a numerical parameter\n", option);
return 1;
}
+
+/**
+ * @}
+ * @}
+ */
+/**
+ @defgroup CLI_DLOGUTIL dlogutil usage
+ @ingroup DLOG_COMMAND_LINE_UTILITIES
+ @brief Log reading utility
+ @details dlogutil is a utility that can be utilised to read stored logs.
+
+The most rudimentary way to use it is to run it with no parameters; it then prints all stored logs to the standard output and awaits more.
+
+Parameters exist to change this behaviour:
+
+Parameter | Description
+----------------|---------------------------------
+-s | Set default filter to *:s (see later for details)
+-f filename | Output to given file instead of stdout
+-r kbytes | Rotate log file every this many kilobytes.
+-n files | Keep this many old rotations
+-v | Set log output format.
+-b buffer | Select another buffer
+-c | Clear the selected buffers
+-d | Exit when no more logs are currently available
+-t count | Similar to -d, except only print this many logs from the end
+-g | Get the size of selected buffers instead of printing logs
+-h, --help | Show help info
+--dumpfile file | Parse a binary file generated by the logger daemon
+
+Additionally, you can specify filters. Filters go behind the parameters and are used to decide which logs are shown.
+
+Each log line has priority and a tag. Filters are specified in the format TAG[:PRIO]. Only logs with given tags and priorities are shown.
+
+You can specify * as the tag to match anything. Beware: only a single asterisk works that way, asterisk is not otherwise expanded. For example, "T*G" filter will NOT match "TAG", only literal "T*G".
+
+If you don't specify any filter, it defaults to *:I
+If you specify just * as the tag, without priority, its priority defaults to D
+If you specify any other tag without priority, the priority defaults to V
+
+*/
+
static void show_help(const char *cmd)
{
fprintf(stderr,
#include <limits.h>
/**
+ * @addtogroup SHARED_FUNCTIONS
+ * @{
+ */
+
+/**
* @brief Open a log file
* @details Open a log file into the passed structure.
- * @param[in] logfile The file structure to contain the opened file descriptor
+ * @param[in] file The file structure to contain the opened file descriptor
* @remarks Creates the file if it does not exist, else appends to it.
*/
void open_logfile(struct log_file *file)
/**
* @brief Rotate log files
* @details Opens a new file and moves existing files further back
- * @param[in] logfile The file structure to contain the currently opened file
+ * @param[in] file The file structure to contain the currently opened file
*/
void rotate_logs(struct log_file *file)
{
open_logfile(file);
file->size = 0;
}
+
+/**
+ * @}
+ */
#include <fcntl.h>
#include <logcommon.h>
+/**
+ * @addtogroup SHARED_FUNCTIONS
+ * @{
+ */
+
#define MAX_PREFIX_SIZE 32
#define LINE_MAX (MAX_PREFIX_SIZE+PATH_MAX)
/**
* @brief Receive a file descriptor from a socket
* @details Receives a message from given socket fd and retrieves another fd from inside
- * @param[in] sock_fd The socket's file descriptor
+ * @param[in] socket The socket's file descriptor
* @return The file descriptor received from the socket, -errno on failure
* @retval -EIO No descriptor was received from the socket
*/
} else
return -EIO;
}
+
+/**
+ * @}
+ */
#include <errno.h>
/**
+ * @addtogroup SHARED_FUNCTIONS
+ * @{
+ */
+
+/**
* @brief A singular config entry list element.
*/
struct log_conf_entry {
/**
* @brief Get a config value
* @details Returns a value with the given key from the given config
- * @param[in] config The config to work with
+ * @param[in] c The config to work with
* @param[in] key The key of the value entry to get
* @return The value of the entry if such exists, else NULL
* @see log_config_set, log_config_push, log_config_remove
/**
* @brief Set a config value
* @details Sets the entry with the given key in the given config to the given value
- * @param[in] config The config to work with
+ * @param[in] c The config to work with
* @param[in] key The key of the value entry to set
* @param[in] value The value to set
* @remarks The entry must already exist
* @brief Save the config to a file
* @details Saves the given config under the given filename
* @param[in] config The config whose contents to save
+ * @param[in] filename The name of the file
* @see log_config_read
* @return 0 on success, -errno on failure
*/
* @brief Remove an entry
* @details Remove the entry under the given key from the given config
* @param[in] config The config to work with
- * @param[in] key The key of the entry to create
- * @param[in] value The value of the new entry
+ * @param[in] key The key of the entry to remove
* @return 1 if the entry existed and was removed, else 0
* @see log_config_set, log_config_get, log_config_push
*/
}
return r;
}
+
+/**
+ * @}
+ */
#include <logprint.h>
+/**
+ * @addtogroup SHARED_FUNCTIONS
+ * @{
+ */
+
typedef struct FilterInfo_t {
char *mTag;
log_priority mPri;
/**
* @brief Set print format
- * @detail Sets a log format's print format
+ * @details Sets a log format's print format
* @param[in] p_format The log format whose print format to set
* @param[in] format The print format
*/
* @brief Add filter string
* @details Adds multiple tag/priority filtering rule from a string
* @param[in] p_format The log format to add the filter rules to
- * @param[in] filterstring A filter string containing multiple filter rules delimited by spaces, tabs or commas
+ * @param[in] filterString A filter string containing multiple filter rules delimited by spaces, tabs or commas
* @return 0 on success, else -1
* @remarks Assumes single threaded execution
*/
return ret;
}
+
+/**
+ * @}
+ */
#include <assert.h>
/**
+ * @addtogroup SHARED_FUNCTIONS
+ * @{
+ */
+
+/**
* @brief Create pipe message
* @details Prepares a pipe message structure by filling its members appropriately
* @param[out] buf The pointer to (the buffer containing) the struct
/**
* @brief Parse KMSG message
* @details Parses a raw KMSG message into the internal format
- * @param[in/out] buffer The buffer which contains the message and will contain the entry afterwards
+ * @param[in,out] buffer The buffer which contains the message and will contain the entry afterwards
* @param[in] prime Whether this is the primary /dev/kmsg or an extra numbered device /dev/kmsg##
* @param[in] buffer_size The size of the input buffer
* @return 1 on success, 0 on failure.
le->sec_recv_real = ts.tv_sec;
le->nsec_recv_real = ts.tv_nsec;
}
+
+/**
+ * @}
+ */