Mstdlib-1.24.0
Android Module

Functions

M_log_error_t M_log_module_add_android (M_log_t *log, const char *product, size_t max_queue_bytes, M_log_module_t **out_mod)
 
M_log_error_t M_log_module_android_set_tag_priority (M_log_t *log, M_log_module_t *module, M_uint64 tags, M_android_log_priority_t priority)
 

Detailed Description

Functions to enable logging to Android logging subsystem (__android_log_write).

Only available when building for the Android platform.

Function Documentation

◆ M_log_module_add_android()

M_log_error_t M_log_module_add_android ( M_log_t log,
const char *  product,
size_t  max_queue_bytes,
M_log_module_t **  out_mod 
)

Add a module to output to Android logging subsystem (if we're building for Android).

Note: Android logging messages may be truncated by the subsystem to an implementation-specific line length limit (usually 1023 chars).

Android logging allows passing a NULL or empty string for the product name - in this case, the "global" product name is used, not the name of the program like in syslog.

If the library wasn't compiled for Android, this function will return M_LOG_MODULE_UNSUPPORTED when called, and no module will be added to the logger.

Parameters
[in]loglogger object
[in]productshort tag string: name of program, or NULL to use "global" tag
[in]max_queue_bytesmax size of queue used to buffer asynchronous writes to android log
[out]out_modhandle for created module, or NULL if there was an error
Returns
error code

◆ M_log_module_android_set_tag_priority()

M_log_error_t M_log_module_android_set_tag_priority ( M_log_t log,
M_log_module_t module,
M_uint64  tags,
M_android_log_priority_t  priority 
)

Associate the given user-defined tag(s) with an Android log priority.

If you don't associate a tag with an Android log priority, the default priority of M_ANDROID_LOG_INFO will be used for that tag.

See also
M_LOG_ALL_TAGS
M_log_all_tags_lt
M_log_all_tags_lte
M_log_all_tags_gt
M_log_all_tags_gte
Parameters
[in]loglogger object
[in]modulehandle of module to operate on
[in]tagsuser-defined power-of-two tag (or multiple power-of-two tags, OR'd together)
[in]prioritysingle priority value to associate with the given tags
Returns
error code