TSDebug(3ts)

NAME
TSDebug, TSError, TSIsDebugTagSet, TSDebugSpecific, TSHttpTxnDebugSet, TSHttpSsnDebugSet, TSHttpTxnDebugGet, TSHttpSsnDebugGet, TSAssert, TSReleaseAssert - Traffic Server debugging APIs

LIBRARY
Apache Traffic Server plugin API

SYNOPSIS
#include <ts/ts.h>
void
TSDebug(const char * tag, const char * format, ...);
void
TSError(const char * tag, const char * format, ...);
int
TSIsDebugTagSet(const char * tag);
void
TSDebugSpecific(int debug_flag, const char * tag, const char * format, ...);
void
TSHttpTxnDebugSet(TSHttpTxn txnp, int on);
void
TSHttpSsnDebugSet(TSHttpSsn ssn, int on);
int
TSHttpTxnDebugGet(TSHttpTxn txnp);
int
TSHttpSsnDebugGet(TSHttpSsn ssn);
void
TSAssert(expr);
void
TSReleaseAssert(expr);

DESCRIPTION
TSError() is similar to printf() except that instead of writing the output to the C standard output, it writes output to the Traffic Server error log.

TSDebug() is the same as TSError() except that it only logs the debug message if the given debug tag is enabled. It writes output to the Traffic Server debug log.

TSIsDebugSet() returns non-zero if the given debug tag is enabled.

In debug mode, TSAssert() Traffic Server to prints the file name, line number and expression, and then aborts. In release mode, the expression is not removed but the effects of printing an error message and aborting are. TSReleaseAssert() prints an error message and aborts in both release and debug mode.

TSDebugSpecific() emits a debug line even if the debug tag is turned off, as long as debug flag is enabled. This can be used in conjuction with TSHttpTxnDebugSet,() TSHttpSsnDebugSet,() TSHttpTxnDebugGet,() and TSHttpSsnDebugGet() to enable debugging on specific session and transaction objects.

EXAMPLES
#include <ts/ts.h>
// Emit debug message if "tag" is enabled or the txn debug flag is set.
TSDebugSpecifc(TSHttpTxnDebugGet(txn), "tag" ,
        "Hello World from transaction %p", txn);

SEE ALSO
TSAPI(3ts)