/*
*******************************************************************************
*
-* Copyright (C) 2003-2004, International Business Machines
+* Copyright (C) 2003-2006, International Business Machines
* Corporation and others. All Rights Reserved.
*
*******************************************************************************
#include <stdarg.h>
#include "unicode/utypes.h"
+/**
+ * \file
+ * \brief 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.
+ */
+
U_CDECL_BEGIN
-#ifndef U_HIDE_DRAFT_API
-
/**
* Trace severity levels. Higher levels increase the verbosity of the trace output.
* @see utrace_setLevel
- * @draft ICU 2.8
+ * @stable ICU 2.8
*/
typedef enum UTraceLevel {
- /** Disable all tracing @draft ICU 2.8*/
+ /** Disable all tracing @stable ICU 2.8*/
UTRACE_OFF=-1,
- /** Trace error conditions only @draft ICU 2.8*/
+ /** Trace error conditions only @stable ICU 2.8*/
UTRACE_ERROR=0,
- /** Trace errors and warnings @draft ICU 2.8*/
+ /** Trace errors and warnings @stable ICU 2.8*/
UTRACE_WARNING=3,
- /** Trace opens and closes of ICU services @draft ICU 2.8*/
+ /** Trace opens and closes of ICU services @stable ICU 2.8*/
UTRACE_OPEN_CLOSE=5,
- /** Trace an intermediate number of ICU operations @draft ICU 2.8*/
+ /** Trace an intermediate number of ICU operations @stable ICU 2.8*/
UTRACE_INFO=7,
- /** Trace the maximum number of ICU operations @draft ICU 2.8*/
+ /** Trace the maximum number of ICU operations @stable ICU 2.8*/
UTRACE_VERBOSE=9
} UTraceLevel;
/**
* These are the ICU functions that will be traced when tracing is enabled.
- * @draft ICU 2.8
+ * @stable ICU 2.8
*/
typedef enum UTraceFunctionNumber {
UTRACE_FUNCTION_START=0,
UTRACE_COLLATION_LIMIT
} UTraceFunctionNumber;
-#endif /*U_HIDE_DRAFT_API*/
-
/**
* Setter for the trace level.
* @param traceLevel A UTraceLevel value.
- * @draft ICU 2.8
+ * @stable ICU 2.8
*/
-U_DRAFT void U_EXPORT2
+U_STABLE void U_EXPORT2
utrace_setLevel(int32_t traceLevel);
/**
* Getter for the trace level.
* @return The UTraceLevel value being used by ICU.
- * @draft ICU 2.8
+ * @stable ICU 2.8
*/
-U_DRAFT int32_t U_EXPORT2
+U_STABLE int32_t U_EXPORT2
utrace_getLevel(void);
/* Trace function pointers types ----------------------------- */
* Type signature for the trace function to be called when entering a function.
* @param context value supplied at the time the trace functions are set.
* @param fnNumber Enum value indicating the ICU function being entered.
- * @draft ICU 2.8
+ * @stable ICU 2.8
*/
typedef void U_CALLCONV
UTraceEntry(const void *context, int32_t fnNumber);
* @param args A variable arguments list. Contents are described by
* the fmt parameter.
* @see utrace_vformat
- * @draft ICU 2.8
+ * @stable ICU 2.8
*/
typedef void U_CALLCONV
UTraceExit(const void *context, int32_t fnNumber,
* @param fmt A format string describing the tracing data that is supplied
* as variable args
* @param args The data being traced, passed as variable args.
- * @draft ICU 2.8
+ * @stable ICU 2.8
*/
typedef void U_CALLCONV
UTraceData(const void *context, int32_t fnNumber, int32_t level,
* traced ICU function, for the purpose of providing
* data to the trace.
*
- * @draft ICU 2.8
+ * @stable ICU 2.8
*/
-U_DRAFT void U_EXPORT2
+U_STABLE void U_EXPORT2
utrace_setFunctions(const void *context,
UTraceEntry *e, UTraceExit *x, UTraceData *d);
* @param e The currently installed UTraceEntry function.
* @param x The currently installed UTraceExit function.
* @param d The currently installed UTraceData function.
- * @draft ICU 2.8
+ * @stable ICU 2.8
*/
-U_DRAFT void U_EXPORT2
+U_STABLE void U_EXPORT2
utrace_getFunctions(const void **context,
UTraceEntry **e, UTraceExit **x, UTraceData **d);
* @param args Data to be formatted.
* @return Length of formatted output, including the terminating NUL.
* If buffer capacity is insufficient, the required capacity is returned.
- * @draft ICU 2.8
+ * @stable ICU 2.8
*/
-U_DRAFT int32_t U_EXPORT2
+U_STABLE int32_t U_EXPORT2
utrace_vformat(char *outBuf, int32_t capacity,
int32_t indent, const char *fmt, va_list args);
* @param ... Data to be formatted.
* @return Length of formatted output, including the terminating NUL.
* If buffer capacity is insufficient, the required capacity is returned.
- * @draft ICU 2.8
+ * @stable ICU 2.8
*/
-U_DRAFT int32_t U_EXPORT2
+U_STABLE int32_t U_EXPORT2
utrace_format(char *outBuf, int32_t capacity,
int32_t indent, const char *fmt, ...);
* @return The name string for the function.
*
* @see UTraceFunctionNumber
- * @draft ICU 2.8
+ * @stable ICU 2.8
*/
-U_DRAFT const char * U_EXPORT2
+U_STABLE const char * U_EXPORT2
utrace_functionName(int32_t fnNumber);
U_CDECL_END