Adaptive Framework  0.9.0
All Data Structures Files Functions Variables Typedefs Enumerations Enumerator Macros Modules Pages
Files | Data Structures | Functions

Files

file  afw_log_impl.h
 Helpers for log implementation development.
 

Data Structures

struct  afw_log_impl_s
 Struct for afw_log_impl_t. More...
 

Functions

afw_log_tafw_log_impl_create_cede_p (const afw_log_inf_t *inf, afw_size_t instance_size, const afw_object_t *properties, const afw_pool_t *p, afw_xctx_t *xctx)
 Developers should call this in all create functions for afw_log. More...
 
void afw_log_impl_throw_property_invalid (const afw_log_t *log, const afw_utf8_t *property_name, afw_xctx_t *xctx)
 Developers should call this for configuration property errors. More...
 
void afw_log_impl_throw_property_required (const afw_log_t *log, const afw_utf8_t *property_name, afw_xctx_t *xctx)
 Developers should call this for missing required configuration property. More...
 

Detailed Description

Interface log implementation helpers.

Function Documentation

◆ afw_log_impl_create_cede_p()

afw_log_t* afw_log_impl_create_cede_p ( const afw_log_inf_t inf,
afw_size_t  instance_size,
const afw_object_t properties,
const afw_pool_t p,
afw_xctx_t xctx 
)

Developers should call this in all create functions for afw_log.

Parameters
infafw_log_inf_t pointer for implementation.
instance_size0 or size greater than sizeof(afw_log_t).
propertiesconfig object.
pceded for use by pool resources. Log release, releases it.
xctxof caller.

This function creates and initializes an afw_log instance. This should be called in the beginning of each log create function. Afterwards, the afw_log implementation can process additional properties, if needed.

An instance_size can be specified to get a larger instance than sizeof(afw_log_t) for private use.

A new pool is created in the environment's pool for use by the log.

Properties from config that are processed:

log_id This is the log's id and can be used to reference this log, for example, to change its logging priority or report on on problems with the log. It will default to log_type, but must be unique.

priority This is a string containing a <priority> from the table below. This priority and higher that will be logged in this log. This parameter can also have a value of "none" if all logging is to be controlled by <priority> properties. The default is notice.

<priority> Any <priority> can be set to true or false, overriding what is set or defaulted to by the priority property.

filter expression – future –

format expression – future —

debug expression – future — Note: maybe filter will do, but this might do priority="none",debug=true. Maybe any of the <priority> can be true/false or a filter expression???

<priority> in table below are listed highest priority to lowest. <priority> trace1-8 are not available in many log configurations, such as syslog.

<priority> Description
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

Definition at line 769 of file afw_log.c.

◆ afw_log_impl_throw_property_invalid()

void afw_log_impl_throw_property_invalid ( const afw_log_t log,
const afw_utf8_t property_name,
afw_xctx_t xctx 
)

Developers should call this for configuration property errors.

Parameters
log.
property_namethis is in error.
xctxof caller.

Definition at line 740 of file afw_log.c.

◆ afw_log_impl_throw_property_required()

void afw_log_impl_throw_property_required ( const afw_log_t log,
const afw_utf8_t property_name,
afw_xctx_t xctx 
)

Developers should call this for missing required configuration property.

Parameters
log.
property_namethis is in error.
xctxof caller.

Definition at line 754 of file afw_log.c.