The core has two main responsibilities:
The core consists of the following components:
The core API functions are primarily invoked by the application layer to implement its functionality, but some core elements may also be directly invoked by application code. For example, the core API function pantheios_isSeverityLogged() (or pantheios::isSeverityLogged() for C++ compilation units) may be used to determine whether to logging of a given severity level is enabled before doing any significant amount of log statement preparation.
if(pantheios::isSeverityLogged(pantheios::debug)) { std::string stringFormOfSomethingExpensive = . . . // pantheios::log_DEBUG("Something expensive: ", stringFormOfSomethingExpensive); }
Furthermore, Pantheios logging facilities are available from C client code via the core API directly, via the pantheios_printf() and pantheios_vprintf() functions:
int i; float f; pantheios_printf( PANTHEIOS_SEV_INFORMATIONAL, "int=%d, float=%g" , i, f);
However, it should be noted that the C functions in the core API do not offer either the type-safety or the genericity of the application layer, and so should be eschewed in C++ compilation code.
Modules | |
Generated N-ary Core Functions | |
Auto-generated functions that constitute the Type Tunnel, which acts as the bridge between the Pantheios Core API and the Pantheios Application Layer API. | |
Classes | |
struct | pantheios::pan_slice_t |
String slice used by the Pantheios Application Layer API to communicate with the Pantheios Core API. More... | |
Enumerations | |
enum | pantheios::pan_severity_t { pantheios::PANTHEIOS_SEV_EMERGENCY = 0, pantheios::PANTHEIOS_SEV_ALERT = 1, pantheios::PANTHEIOS_SEV_CRITICAL = 2, pantheios::PANTHEIOS_SEV_ERROR = 3, pantheios::PANTHEIOS_SEV_WARNING = 4, pantheios::PANTHEIOS_SEV_NOTICE = 5, pantheios::PANTHEIOS_SEV_INFORMATIONAL = 6, pantheios::PANTHEIOS_SEV_DEBUG = 7 } |
API Severity level. More... | |
Functions | |
int | pantheios::pantheios_init (void) |
Initialises the pantheios library. | |
void | pantheios::pantheios_uninit (void) |
Uninitialises the pantheios library. | |
int | pantheios::pantheios_isSeverityLogged (pan_sev_t severity) |
Indicates whether a given severity is currently being logged by the process. | |
char const * | pantheios::pantheios_getSeverityString (pan_sev_t severity) |
Returns a constant pointer to a non-modifiable nul-terminated string representing the severity level. | |
int | pantheios::pantheios_log_n (pan_sev_t severity, size_t numSlices, pantheios::pan_slice_t const *slices) |
Core logging function, which receives a severity and an array of string slices, and outputs them to the back-end. | |
int | pantheios::pantheios_printf (pan_sev_t severity, char const *format,...) |
printf()-form of logging function, passing the formatted result to the back-end | |
int | pantheios::pantheios_vprintf (pan_sev_t severity, char const *format, va_list args) |
vprintf()-form of logging function, passing the formatted result to the back-end | |
int | pantheios::pantheios_getNextBackEndId (void) |
Returns a (thread-safe) unique back-end identifier. | |
void | pantheios::pantheios_puts (pan_sev_t severity, char const *message) |
A functional equivalent to puts() , incorporating a severity level. | |
int | pantheios::isSeverityLogged (pan_sev_t severity) |
Equivalent to pantheios_isSeverityLogged(). | |
char const * | pantheios::getSeverityString (pan_sev_t severity) |
Equivalent to pantheios_getSeverityString(). | |
void | pantheios::puts (pan_sev_t severity, char const *message) |
Equivalent to pantheios_puts(). |
|
API Severity level.
|
|
Equivalent to pantheios_getSeverityString().
|
|
Equivalent to pantheios_isSeverityLogged().
|
|
Returns a (thread-safe) unique back-end identifier. This function provides back-end identiers, useful with custom use of Pantheios back-ends, that are guaranteed unique throughout a given process, even in the case where it is invoked by multiple threads concurrently.
|
|
Returns a constant pointer to a non-modifiable nul-terminated string representing the severity level.
|
|
Initialises the pantheios library.
|
|
Indicates whether a given severity is currently being logged by the process.
|
|
Core logging function, which receives a severity and an array of string slices, and outputs them to the back-end.
|
|
printf()-form of logging function, passing the formatted result to the back-end
|
|
A functional equivalent to
Using this function skips the application layer entirely, and goes straight to the core. It is therefore more suitable for use in emergency bail-out situations, such as in an application-level
|
|
Uninitialises the pantheios library. Should be called for every call to pantheios_init() that returns a non-negative code
|
|
vprintf()-form of logging function, passing the formatted result to the back-end
|
|
|
|
pantheios Library documentation © Matthew Wilson, 2006 |
|