#ifndef _aplmt_logging_traceapi_h_
#define _aplmt_logging_traceapi_h_
/*----------------------------------------------------------------------------
** SUMMARY: Thread-Safe Run-Time Tracing API (TRACEMT)
**
** DESCRIPTION:
**  This file provides a thread-safe version of the TRACE interface. This 
**  interface is built on-top of the single-threaded implementation.  
**  
**  THREAD SAFETY
**  -------------
**  All of the methods in this interface are thread safe.  However, when
**  making consecutive TRACEMT calls, there is no guaranty about what happens
**  between the individual calls.  
**
**
** CONFIGURATION 
** -------------
**  COMPILE:        see src/apl/logging/traceapi.h
**
**  APPLICATION:    see src/apl/logging/traceapi.h
**
**  PLATFORM:       see src/apl/logging/traceapi.h
**
**  NOTES:
**  1. Unless explicitly stated, NONE of the following methods may be called
**     from interrtup service routines.
**  2. For efficency/optimization some methods are 'inlined'.  The inlining
**     is done by using the preprocessor/macros.  The application should
**     treat all methods as function calls and not rely on the fact they may
**     be currently defined as macros.
----------------------------------------------------------------------------*/
                    
#include "apl/logging/traceapi.h"       /* For: base implementation */
#include "aplmt/logging/trace.h"        /* For: inline implementation */


#ifdef __cplusplus
extern "C" {
#endif


/*-------------- PUBLIC/PUBLISHED API --------------------------------------*/
/** This macro is use to turn on tracing at RUNTIME.  On start-up, the 
    default is tracing-enabled.
 */
#define APLMT_TRACE_ON()                    _APLMT_TRACE_ON()

/** This macro is use to turn off tracing at RUNTIME. 
 */
#define APLMT_TRACE_OFF()                   _APLMT_TRACE_OFF()

/** This macro is used to output a trace message WITH a trailing NEWLINE
    character.  It has printf semantics.  See interface description above 
    for example usage.
 */
#define APLMT_TRACE_OUTLINE( var_args )     _APLMT_TRACE_OUTLINE( var_args )

/** This macro is used to output a trace message WITHOUT a trailing NEWLINE
    character.  It has printf semantics.  See interface description above 
    for example usage.
 */
#define APLMT_TRACE_OUT( var_args )         _APLMT_TRACE_OUT( var_args )

/** This macro is used to output a trace message containing ONLY a 
    NEWLINE character.
 */
#define APLMT_TRACE_NEWLINE()               _APLMT_TRACE_NEWLINE()


/*-------------- PUBLIC/PUBLISHED API --------------------------------------*/
/** This macro is very similar to  APLMT_TRACE_OUTLINE(), except that it
    prepends the current thread ID to the raw message text.
 */
#define APLMT_TRACE_MSGLINE( var_args )     _APLMT_TRACE_MSGLINE( var_args )

/** This macro is very similar to  APLMT_TRACE_OUT(), except that it
    prepends the current thread ID to the raw message text.
 */
#define APLMT_TRACE_MSG( var_args )         _APLMT_TRACE_MSG( var_args )


#ifdef __cplusplus
}
#endif
/*--------------------------------------------------------------------------*/
#endif  /* end _apl_logging_xslogapi_h_ */
