ICU 64.2
64.2
|
C API: Definitions for ICU tracing/logging. More...
Go to the source code of this file.
Typedefs | |
typedef enum UTraceLevel | UTraceLevel |
Trace severity levels. More... | |
typedef enum UTraceFunctionNumber | UTraceFunctionNumber |
These are the ICU functions that will be traced when tracing is enabled. More... | |
typedef void | UTraceEntry(const void *context, int32_t fnNumber) |
Type signature for the trace function to be called when entering a function. More... | |
typedef void | UTraceExit(const void *context, int32_t fnNumber, const char *fmt, va_list args) |
Type signature for the trace function to be called when exiting from a function. More... | |
typedef void | UTraceData(const void *context, int32_t fnNumber, int32_t level, const char *fmt, va_list args) |
Type signature for the trace function to be called from within an ICU function to display data or messages. More... | |
Enumerations | |
enum | UTraceLevel { UTRACE_OFF =-1, UTRACE_ERROR =0, UTRACE_WARNING =3, UTRACE_OPEN_CLOSE =5, UTRACE_INFO =7, UTRACE_VERBOSE =9 } |
Trace severity levels. More... | |
enum | UTraceFunctionNumber { UTRACE_FUNCTION_START =0, UTRACE_U_INIT =UTRACE_FUNCTION_START, UTRACE_U_CLEANUP, UTRACE_FUNCTION_LIMIT, UTRACE_CONVERSION_START =0x1000, UTRACE_UCNV_OPEN =UTRACE_CONVERSION_START, UTRACE_UCNV_OPEN_PACKAGE, UTRACE_UCNV_OPEN_ALGORITHMIC, UTRACE_UCNV_CLONE, UTRACE_UCNV_CLOSE, UTRACE_UCNV_FLUSH_CACHE, UTRACE_UCNV_LOAD, UTRACE_UCNV_UNLOAD, UTRACE_CONVERSION_LIMIT, UTRACE_COLLATION_START =0x2000, UTRACE_UCOL_OPEN =UTRACE_COLLATION_START, UTRACE_UCOL_CLOSE, UTRACE_UCOL_STRCOLL, UTRACE_UCOL_GET_SORTKEY, UTRACE_UCOL_GETLOCALE, UTRACE_UCOL_NEXTSORTKEYPART, UTRACE_UCOL_STRCOLLITER, UTRACE_UCOL_OPEN_FROM_SHORT_STRING, UTRACE_UCOL_STRCOLLUTF8, UTRACE_COLLATION_LIMIT } |
These are the ICU functions that will be traced when tracing is enabled. More... | |
Functions | |
void | utrace_setLevel (int32_t traceLevel) |
Setter for the trace level. More... | |
int32_t | utrace_getLevel (void) |
Getter for the trace level. More... | |
void | utrace_setFunctions (const void *context, UTraceEntry *e, UTraceExit *x, UTraceData *d) |
Set ICU Tracing functions. More... | |
void | utrace_getFunctions (const void **context, UTraceEntry **e, UTraceExit **x, UTraceData **d) |
Get the currently installed ICU tracing functions. More... | |
int32_t | utrace_vformat (char *outBuf, int32_t capacity, int32_t indent, const char *fmt, va_list args) |
Trace output Formatter. More... | |
int32_t | utrace_format (char *outBuf, int32_t capacity, int32_t indent, const char *fmt,...) |
Trace output Formatter. More... | |
const char * | utrace_functionName (int32_t fnNumber) |
Get the name of a function from its trace function number. More... | |
C API: Definitions for ICU tracing/logging.
This provides API for debugging the internals of ICU without the use of a traditional debugger.
By default, tracing is disabled in ICU. If you need to debug ICU with tracing, please compile ICU with the –enable-tracing configure option.
Definition in file utrace.h.
typedef void UTraceData(const void *context, int32_t fnNumber, int32_t level, const char *fmt, va_list args) |
Type signature for the trace function to be called from within an ICU function to display data or messages.
context | value supplied at the time the trace functions are set. |
fnNumber | Enum value indicating the ICU function being exited. |
level | The current tracing level |
fmt | A format string describing the tracing data that is supplied as variable args |
args | The data being traced, passed as variable args. |
typedef void UTraceEntry(const void *context, int32_t fnNumber) |
typedef void UTraceExit(const void *context, int32_t fnNumber, const char *fmt, va_list args) |
Type signature for the trace function to be called when exiting from a function.
context | value supplied at the time the trace functions are set. |
fnNumber | Enum value indicating the ICU function being exited. |
fmt | A formatting string that describes the number and types of arguments included with the variable args. The fmt string has the same form as the utrace_vformat format string. |
args | A variable arguments list. Contents are described by the fmt parameter. |
typedef enum UTraceFunctionNumber UTraceFunctionNumber |
These are the ICU functions that will be traced when tracing is enabled.
typedef enum UTraceLevel UTraceLevel |
Trace severity levels.
Higher levels increase the verbosity of the trace output.
enum UTraceFunctionNumber |
These are the ICU functions that will be traced when tracing is enabled.
Enumerator | |
---|---|
UTRACE_FUNCTION_LIMIT | One more than the highest normal collation trace location.
|
UTRACE_CONVERSION_LIMIT | One more than the highest normal collation trace location.
|
UTRACE_UCOL_STRCOLLUTF8 |
|
UTRACE_COLLATION_LIMIT | One more than the highest normal collation trace location.
|
enum UTraceLevel |
Trace severity levels.
Higher levels increase the verbosity of the trace output.
Enumerator | |
---|---|
UTRACE_OFF | Disable all tracing.
|
UTRACE_ERROR | Trace error conditions only.
|
UTRACE_WARNING | Trace errors and warnings.
|
UTRACE_OPEN_CLOSE | Trace opens and closes of ICU services.
|
UTRACE_INFO | Trace an intermediate number of ICU operations.
|
UTRACE_VERBOSE | Trace the maximum number of ICU operations.
|
int32_t utrace_format | ( | char * | outBuf, |
int32_t | capacity, | ||
int32_t | indent, | ||
const char * | fmt, | ||
... | |||
) |
Trace output Formatter.
An application's UTraceData tracing functions may call this function to format any additional trace data, beyond that provided by default, in human readable form with the same formatting conventions used by utrace_vformat().
outBuf | pointer to a buffer to receive the formatted output. Output will be nul terminated if there is space in the buffer - if the length of the requested output < the output buffer size. |
capacity | Length of the output buffer. |
indent | Number of spaces to indent the output. Intended to allow data displayed from nested functions to be indented for readability. |
fmt | Format specification for the data to output |
... | Data to be formatted. |
const char* utrace_functionName | ( | int32_t | fnNumber | ) |
Get the name of a function from its trace function number.
fnNumber | The trace number for an ICU function. |
void utrace_getFunctions | ( | const void ** | context, |
UTraceEntry ** | e, | ||
UTraceExit ** | x, | ||
UTraceData ** | d | ||
) |
Get the currently installed ICU tracing functions.
Note that a null function pointer will be returned if no trace function has been set.
context | The currently installed tracing context. |
e | The currently installed UTraceEntry function. |
x | The currently installed UTraceExit function. |
d | The currently installed UTraceData function. |
int32_t utrace_getLevel | ( | void | ) |
void utrace_setFunctions | ( | const void * | context, |
UTraceEntry * | e, | ||
UTraceExit * | x, | ||
UTraceData * | d | ||
) |
Set ICU Tracing functions.
Installs application-provided tracing functions into ICU. After doing this, subsequent ICU operations will call back to the installed functions, providing a trace of the use of ICU. Passing a NULL pointer for a tracing function is allowed, and inhibits tracing action at points where that function would be called.
Tracing and Threads: Tracing functions are global to a process, and will be called in response to ICU operations performed by any thread. If tracing of an individual thread is desired, the tracing functions must themselves filter by checking that the current thread is the desired thread.
context | an uninterpreted pointer. Whatever is passed in here will in turn be passed to each of the tracing functions UTraceEntry, UTraceExit and UTraceData. ICU does not use or alter this pointer. |
e | Callback function to be called on entry to a a traced ICU function. |
x | Callback function to be called on exit from a traced ICU function. |
d | Callback function to be called from within a traced ICU function, for the purpose of providing data to the trace. |
void utrace_setLevel | ( | int32_t | traceLevel | ) |
int32_t utrace_vformat | ( | char * | outBuf, |
int32_t | capacity, | ||
int32_t | indent, | ||
const char * | fmt, | ||
va_list | args | ||
) |
Trace output Formatter.
An application's UTraceData tracing functions may call back to this function to format the trace output in a human readable form. Note that a UTraceData function may choose to not format the data; it could, for example, save it in in the raw form it was received (more compact), leaving formatting for a later trace analysis tool.
outBuf | pointer to a buffer to receive the formatted output. Output will be nul terminated if there is space in the buffer - if the length of the requested output < the output buffer size. |
capacity | Length of the output buffer. |
indent | Number of spaces to indent the output. Intended to allow data displayed from nested functions to be indented for readability. |
fmt | Format specification for the data to output |
args | Data to be formatted. |