Synesis Software STLSoft - ... Robust, Lightweight, Cross-platform, Template Software ...

Pantheios Tracing API


Detailed Description

Pantheios Tracing API.

If your compiler supports variadic macros, you may use this to log by "tracing", where your log statement is preceded by "<file>(<line>): ", or "<file>: ", and so on, or a custom value.

The Pantheios Tracing API consists of:

By default, support for variadic macros is via the STLSoft preprocessor symbol, STLSOFT_CF_SUPPORTS_VARIADIC_MACROS. If that is defined, and you have *not* defined PANTHEIOS_NO_USE_VARIADIC_MACROS, then the symbol PANTHEIOS_USES_VARIADIC_MACROS will be defined, and the various aspects of the Pantheios tracing api described above will be available to you.

If you _know_ that your compiler supports variadics even when STLSoft thinks that it does not, you can just define PANTHEIOS_USES_VARIADIC_MACROS yourself.

By default, the prefix is of the form "<file>(<line>): ", but you can override it to whatever you want by redefining PANTHEIOS_TRACE_PREFIX.


Defines

#define PANTHEIOS_FILELINE_A   __FILE__ "(" PANTHEIOS_STRINGIZE(__LINE__) "): "
 Default file+line format for Pantheios Tracing API.
#define PANTHEIOS_FILELINE   PANTHEIOS_FILELINE_A
 Default file+line format for Pantheios Tracing API.
#define PANTHEIOS_TRACE_PREFIX   PANTHEIOS_FILELINE
 The file-line prefix uses by the Pantheios Tracing API for C constructs.
#define PANTHEIOS_TRACE_LOG_PREFIX   ::pantheios::pan_slice_t(PANTHEIOS_FILELINE, STLSOFT_NUM_ELEMENTS(PANTHEIOS_FILELINE) - 1)
 The file-line prefix uses by the Pantheios Tracing API for C++ constructs.
#define PANTHEIOS_TRACE_PRINTF(sev, fmt,...)   ::pantheios::pantheios_logprintf((sev), "%s" fmt, stlsoft_static_cast(PANTHEIOS_NS_QUAL(pan_char_t) const*, PANTHEIOS_TRACE_PREFIX), __VA_ARGS__)
 Logs a printf()-formatted statement with a file+line prefix, at the given severity level.
#define PANTHEIOS_TRACE(sev,...)   ::pantheios::log((sev), PANTHEIOS_TRACE_LOG_PREFIX, __VA_ARGS__)
 Logs a multi-argument statement with a file+line prefix, at the given severity level.
#define PANTHEIOS_TRACE_EMERGENCY(...)   ::pantheios::log(PANTHEIOS_SEV_EMERGENCY, PANTHEIOS_TRACE_LOG_PREFIX, __VA_ARGS__)
 Logs a multi-argument statement with a file+line prefix, at the pantheios::EMERGENCY severity level.
#define PANTHEIOS_TRACE_ALERT(...)   ::pantheios::log(PANTHEIOS_SEV_ALERT, PANTHEIOS_TRACE_LOG_PREFIX, __VA_ARGS__)
 Logs a multi-argument statement with a file+line prefix, at the pantheios::ALERT severity level.
#define PANTHEIOS_TRACE_CRITICAL(...)   ::pantheios::log(PANTHEIOS_SEV_CRITICAL, PANTHEIOS_TRACE_LOG_PREFIX, __VA_ARGS__)
 Logs a multi-argument statement with a file+line prefix, at the pantheios::CRITICAL severity level.
#define PANTHEIOS_TRACE_ERROR(...)   ::pantheios::log(PANTHEIOS_SEV_ERROR, PANTHEIOS_TRACE_LOG_PREFIX, __VA_ARGS__)
 Logs a multi-argument statement with a file+line prefix, at the pantheios::ERROR severity level.
#define PANTHEIOS_TRACE_WARNING(...)   ::pantheios::log(PANTHEIOS_SEV_WARNING, PANTHEIOS_TRACE_LOG_PREFIX, __VA_ARGS__)
 Logs a multi-argument statement with a file+line prefix, at the pantheios::WARNING severity level.
#define PANTHEIOS_TRACE_NOTICE(...)   ::pantheios::log(PANTHEIOS_SEV_NOTICE, PANTHEIOS_TRACE_LOG_PREFIX, __VA_ARGS__)
 Logs a multi-argument statement with a file+line prefix, at the pantheios::NOTICE severity level.
#define PANTHEIOS_TRACE_INFORMATIONAL(...)   ::pantheios::log(PANTHEIOS_SEV_INFORMATIONAL, PANTHEIOS_TRACE_LOG_PREFIX, __VA_ARGS__)
 Logs a multi-argument statement with a file+line prefix, at the pantheios::INFORMATIONAL severity level.
#define PANTHEIOS_TRACE_DEBUG(...)   ::pantheios::log(PANTHEIOS_SEV_DEBUG, PANTHEIOS_TRACE_LOG_PREFIX, __VA_ARGS__)
 Logs a multi-argument statement with a file+line prefix, at the pantheios::DEBUG severity level.


Define Documentation

#define PANTHEIOS_FILELINE   PANTHEIOS_FILELINE_A

Default file+line format for Pantheios Tracing API.

Remarks:
Because Pantheios is currently multibyte-only, this resolves to PANTHEIOS_FILELINE_A

#define PANTHEIOS_FILELINE_A   __FILE__ "(" PANTHEIOS_STRINGIZE(__LINE__) "): "

Default file+line format for Pantheios Tracing API.

#define PANTHEIOS_TRACE ( sev,
...   )     ::pantheios::log((sev), PANTHEIOS_TRACE_LOG_PREFIX, __VA_ARGS__)

Logs a multi-argument statement with a file+line prefix, at the given severity level.

Parameters:
sev The severity level

#define PANTHEIOS_TRACE_ALERT ( ...   )     ::pantheios::log(PANTHEIOS_SEV_ALERT, PANTHEIOS_TRACE_LOG_PREFIX, __VA_ARGS__)

Logs a multi-argument statement with a file+line prefix, at the pantheios::ALERT severity level.

Examples:
cpp/tracing/example.cpp.tracing.standard/example.cpp.tracing.standard.cpp, and cpp/tracing/example.cpp.tracing.with_function/example.cpp.tracing.with_function.cpp.

#define PANTHEIOS_TRACE_CRITICAL ( ...   )     ::pantheios::log(PANTHEIOS_SEV_CRITICAL, PANTHEIOS_TRACE_LOG_PREFIX, __VA_ARGS__)

Logs a multi-argument statement with a file+line prefix, at the pantheios::CRITICAL severity level.

#define PANTHEIOS_TRACE_DEBUG ( ...   )     ::pantheios::log(PANTHEIOS_SEV_DEBUG, PANTHEIOS_TRACE_LOG_PREFIX, __VA_ARGS__)

Logs a multi-argument statement with a file+line prefix, at the pantheios::DEBUG severity level.

#define PANTHEIOS_TRACE_EMERGENCY ( ...   )     ::pantheios::log(PANTHEIOS_SEV_EMERGENCY, PANTHEIOS_TRACE_LOG_PREFIX, __VA_ARGS__)

Logs a multi-argument statement with a file+line prefix, at the pantheios::EMERGENCY severity level.

#define PANTHEIOS_TRACE_ERROR ( ...   )     ::pantheios::log(PANTHEIOS_SEV_ERROR, PANTHEIOS_TRACE_LOG_PREFIX, __VA_ARGS__)

Logs a multi-argument statement with a file+line prefix, at the pantheios::ERROR severity level.

#define PANTHEIOS_TRACE_INFORMATIONAL ( ...   )     ::pantheios::log(PANTHEIOS_SEV_INFORMATIONAL, PANTHEIOS_TRACE_LOG_PREFIX, __VA_ARGS__)

Logs a multi-argument statement with a file+line prefix, at the pantheios::INFORMATIONAL severity level.

Examples:
cpp/tracing/example.cpp.tracing.standard/example.cpp.tracing.standard.cpp, and cpp/tracing/example.cpp.tracing.with_function/example.cpp.tracing.with_function.cpp.

#define PANTHEIOS_TRACE_LOG_PREFIX   ::pantheios::pan_slice_t(PANTHEIOS_FILELINE, STLSOFT_NUM_ELEMENTS(PANTHEIOS_FILELINE) - 1)

The file-line prefix uses by the Pantheios Tracing API for C++ constructs.

It defaults to pantheios::pan_slice_t(PANTHEIOS_FILELINE), but may be #define'd by the user to be something else, as desired.

#define PANTHEIOS_TRACE_NOTICE ( ...   )     ::pantheios::log(PANTHEIOS_SEV_NOTICE, PANTHEIOS_TRACE_LOG_PREFIX, __VA_ARGS__)

Logs a multi-argument statement with a file+line prefix, at the pantheios::NOTICE severity level.

Examples:
cpp/tracing/example.cpp.tracing.standard/example.cpp.tracing.standard.cpp, and cpp/tracing/example.cpp.tracing.with_function/example.cpp.tracing.with_function.cpp.

#define PANTHEIOS_TRACE_PREFIX   PANTHEIOS_FILELINE

The file-line prefix uses by the Pantheios Tracing API for C constructs.

It defaults to PANTHEIOS_FILELINE, but may be #define'd by the user to be something else, as desired.

#define PANTHEIOS_TRACE_PRINTF ( sev,
fmt,
...   )     ::pantheios::pantheios_logprintf((sev), "%s" fmt, stlsoft_static_cast(PANTHEIOS_NS_QUAL(pan_char_t) const*, PANTHEIOS_TRACE_PREFIX), __VA_ARGS__)

Logs a printf()-formatted statement with a file+line prefix, at the given severity level.

Parameters:
sev The severity level
fmt The format string
Examples:
cpp/tracing/example.cpp.tracing.standard/example.cpp.tracing.standard.cpp, and cpp/tracing/example.cpp.tracing.with_function/example.cpp.tracing.with_function.cpp.

#define PANTHEIOS_TRACE_WARNING ( ...   )     ::pantheios::log(PANTHEIOS_SEV_WARNING, PANTHEIOS_TRACE_LOG_PREFIX, __VA_ARGS__)

Logs a multi-argument statement with a file+line prefix, at the pantheios::WARNING severity level.

Examples:
cpp/tracing/example.cpp.tracing.standard/example.cpp.tracing.standard.cpp, and cpp/tracing/example.cpp.tracing.with_function/example.cpp.tracing.with_function.cpp.


pantheios Library documentation © Matthew Wilson & Synesis Software, 2006-2011 SourceForge.net Logo