|
file | afw_log.h |
| Adaptive Framework afw_log interface helpers header.
|
|
|
#define | afw_log_release afw_log_destroy |
|
#define | AFW_LOG(priority, message, xctx) |
| Log an afw_utf8_t message to environment's log. More...
|
|
#define | AFW_LOG_Z(priority, message_z, xctx) |
| Log an afw_utf8_z_t message to environment's log. More...
|
|
#define | AFW_LOG_VZ(priority, format_z, ap, xctx) |
| Log an message to environment's log using a printf style format and va_list. More...
|
|
#define | AFW_LOG_FZ(priority, xctx, format_z, ...) |
| Log an message to environment's log using a printf style format and parameters. More...
|
|
|
const afw_log_priority_id_map_entry_t * | afw_log_get_priority_id_map () |
|
afw_log_priority_t | afw_log_priority_id_to_priority (const afw_utf8_t *priority_id) |
| Convert a log priority id to priority. More...
|
|
const afw_utf8_t * | afw_log_priority_to_priority_id (afw_log_priority_t priority) |
| Convert a log priority to priority id. More...
|
|
afw_log_priority_mask_t | afw_log_priority_mask (afw_log_priority_t priority) |
| Get the priority mask for a log priority. More...
|
|
afw_log_priority_mask_t | afw_log_up_to_priority_mask (afw_log_priority_t priority) |
| Get the priority mask for all equal or higher log priorities. More...
|
|
afw_boolean_t | afw_log_priority_in_mask (afw_log_priority_mask_t mask, afw_log_priority_t priority) |
| Determined if log priority corresponding bit is on in mask. More...
|
|
void | afw_log_set_priority_in_mask (afw_log_priority_mask_t *mask, afw_log_priority_t priority, afw_boolean_t value) |
| Set the corresponding bit for a priority in a mask. More...
|
|
void | afw_log_write_z (const afw_log_t *instance, afw_log_priority_t priority, const afw_utf8_z_t *source_z, const afw_utf8_z_t *message_z, afw_xctx_t *xctx) |
| Log an afw_utf8_z_t message. More...
|
|
void | afw_log_write_vz (const afw_log_t *instance, afw_log_priority_t priority, const afw_utf8_z_t *source_z, const afw_utf8_z_t *format_z, va_list ap, afw_xctx_t *xctx) |
| Log an message using a printf style format and va_list. More...
|
|
void | afw_log_write_fz (const afw_log_t *instance, afw_log_priority_t priority, const afw_utf8_z_t *source_z, afw_xctx_t *xctx, const afw_utf8_z_t *format_z,...) |
| Log an message using a printf style format and parameters. More...
|
|
const afw_log_factory_t * | afw_log_file_factory_get () |
| Get the factory for log type file. More...
|
|
const afw_log_factory_t * | afw_log_standard_factory_get () |
| Get the factory for log type standard. More...
|
|
void | afw_log_add_to_environment (const afw_log_t *instance, afw_xctx_t *xctx) |
| Add a log to the list of logs called by environment log. More...
|
|
void | afw_log_set_mask (const afw_log_t *instance, afw_log_priority_mask_t mask, afw_xctx_t *xctx) |
|
Adaptive Framework Log Support.
Log priorities are defined in enum afw_log_priority_t in afw_interface.h. The AFW_LOG macros accept the last part of the enum value name as the priority parameter.
Log priority trace1-8 are not logged, but instead goes to stderr or the configured trace destination.
priority | Description |
none | Priorities will be set individually |
emerg | System unusable |
alert | Immediate action required |
crit | Critical conditions |
err | Error conditions |
warning | Warning, errors may occur |
notice | Normal but significant |
info | Informational |
debug | Debug |
trace1 | Trace level 1 message |
trace2 | Trace level 2 message |
trace3 | Trace level 3 message |
trace4 | Trace level 4 message |
trace5 | Trace level 5 message |
trace6 | Trace level 6 message |
trace7 | Trace level 7 message |
trace8 | Trace level 8 message |
◆ AFW_LOG
#define AFW_LOG |
( |
|
priority, |
|
|
|
message, |
|
|
|
xctx |
|
) |
| |
Value:
#define AFW__FILE_LINE__
file:line
#define afw_log_write(instance, priority, source_z, message, xctx)
Call method write of interface afw_log.
Log an afw_utf8_t message to environment's log.
- Parameters
-
priority | of message. See table above. |
message | to log. |
xctx | of caller. |
Definition at line 158 of file afw_log.h.
◆ AFW_LOG_FZ
#define AFW_LOG_FZ |
( |
|
priority, |
|
|
|
xctx, |
|
|
|
format_z, |
|
|
|
... |
|
) |
| |
Value:
void afw_log_write_fz(const afw_log_t *instance, afw_log_priority_t priority, const afw_utf8_z_t *source_z, afw_xctx_t *xctx, const afw_utf8_z_t *format_z,...)
Log an message using a printf style format and parameters.
Log an message to environment's log using a printf style format and parameters.
- Parameters
-
priority | of message. See table above. |
xctx | of caller. |
format_z | for message to log. |
... | parameters for format. |
Definition at line 192 of file afw_log.h.
◆ afw_log_release
- Todo:
- FIXME: In middle of implementation.
Definition at line 56 of file afw_log.h.
◆ AFW_LOG_VZ
#define AFW_LOG_VZ |
( |
|
priority, |
|
|
|
format_z, |
|
|
|
ap, |
|
|
|
xctx |
|
) |
| |
Value:
void afw_log_write_vz(const afw_log_t *instance, afw_log_priority_t priority, const afw_utf8_z_t *source_z, const afw_utf8_z_t *format_z, va_list ap, afw_xctx_t *xctx)
Log an message using a printf style format and va_list.
Log an message to environment's log using a printf style format and va_list.
- Parameters
-
priority | of message. See table above. |
format_z | for message to log. |
ap | va_list for format. |
xctx | of caller. |
Definition at line 180 of file afw_log.h.
◆ AFW_LOG_Z
#define AFW_LOG_Z |
( |
|
priority, |
|
|
|
message_z, |
|
|
|
xctx |
|
) |
| |
Value:
void afw_log_write_z(const afw_log_t *instance, afw_log_priority_t priority, const afw_utf8_z_t *source_z, const afw_utf8_z_t *message_z, afw_xctx_t *xctx)
Log an afw_utf8_z_t message.
Log an afw_utf8_z_t message to environment's log.
- Parameters
-
priority | of message. See table above. |
message | to log. |
xctx | of caller. |
Definition at line 168 of file afw_log.h.
◆ afw_log_priority_id_map_entry_t
priority_id/priority map entry.
◆ afw_log_add_to_environment()
Add a log to the list of logs called by environment log.
- Parameters
-
instance | log to add. |
xctx | of caller. |
- Todo:
- FIXME: Need to use a "log anchor" with id in it.
- Todo:
- FIXME: runtime object might be accessing on another thread. afw_log_destroy(e->log, xctx);
Definition at line 290 of file afw_log.c.
◆ afw_log_file_factory_get()
Get the factory for log type file.
- Returns
- factory singleton instance.
Definition at line 45 of file afw_log_file.c.
◆ afw_log_get_priority_id_map()
Get priority_id/priority map array.
Definition at line 250 of file afw_log.c.
◆ afw_log_priority_id_to_priority()
Convert a log priority id to priority.
- Parameters
-
id | of log priority to convert |
- Returns
- enum corresponding to log priority or -1 if not found.
Definition at line 258 of file afw_log.c.
◆ afw_log_priority_in_mask()
Determined if log priority corresponding bit is on in mask.
- Parameters
-
mask | to check. |
priority | to test. |
- Returns
- true or false.
Definition at line 124 of file afw_log.h.
◆ afw_log_priority_mask()
Get the priority mask for a log priority.
- Parameters
-
- Returns
- priority_mask.
Definition at line 99 of file afw_log.h.
◆ afw_log_priority_to_priority_id()
Convert a log priority to priority id.
- Parameters
-
priority | of log priority enum to convert |
- Returns
- priority_id or NULL if invalid.
Definition at line 273 of file afw_log.c.
◆ afw_log_set_priority_in_mask()
Set the corresponding bit for a priority in a mask.
- Parameters
-
mask | to check. |
priority | to test. |
value | true or false. |
- Returns
- true or false.
Definition at line 138 of file afw_log.h.
◆ afw_log_standard_factory_get()
Get the factory for log type standard.
- Returns
- factory singleton instance.
Definition at line 45 of file afw_log_standard.c.
◆ afw_log_up_to_priority_mask()
Get the priority mask for all equal or higher log priorities.
- Parameters
-
priority | enum of lowest priority for mask. |
- Returns
- priority_mask.
Definition at line 111 of file afw_log.h.
◆ afw_log_write_fz()
Log an message using a printf style format and parameters.
- Parameters
-
instance | of log |
priority | afw_log_priority_t |
source_z | file:line. |
xctx | of caller. |
format_z | for message to log. |
... | parameters for format. |
Definition at line 249 of file afw_log.h.
◆ afw_log_write_vz()
Log an message using a printf style format and va_list.
- Parameters
-
instance | of log |
priority | afw_log_priority_t |
source_z | file:line. |
format_z | for message to log. |
ap | va_list for format. |
xctx | of caller. |
Definition at line 374 of file afw_log.c.
◆ afw_log_write_z()
Log an afw_utf8_z_t message.
- Parameters
-
instance | of log |
priority | afw_log_priority_t |
source_z | file:line. |
message_z | message to log. |
xctx | of caller. |
Definition at line 206 of file afw_log.h.