.\" Man page generated from reStructuredText. . .TH "TSDEBUG" "3ts" "January 24, 2017" "7.0" "Apache Traffic Server" .SH NAME TSDebug \- traffic Server Debugging APIs . .nr rst2man-indent-level 0 . .de1 rstReportMargin \\$1 \\n[an-margin] level \\n[rst2man-indent-level] level margin: \\n[rst2man-indent\\n[rst2man-indent-level]] - \\n[rst2man-indent0] \\n[rst2man-indent1] \\n[rst2man-indent2] .. .de1 INDENT .\" .rstReportMargin pre: . RS \\$1 . nr rst2man-indent\\n[rst2man-indent-level] \\n[an-margin] . nr rst2man-indent-level +1 .\" .rstReportMargin post: .. .de UNINDENT . RE .\" indent \\n[an-margin] .\" old: \\n[rst2man-indent\\n[rst2man-indent-level]] .nr rst2man-indent-level -1 .\" new: \\n[rst2man-indent\\n[rst2man-indent-level]] .in \\n[rst2man-indent\\n[rst2man-indent-level]]u .. .SH SYNOPSIS .sp \fI#include \fP .INDENT 0.0 .TP .B void TSDebug(const char *\fI\ tag\fP, const char *\fI\ format\fP, \&...) .UNINDENT .INDENT 0.0 .TP .B void TSError(const char *\fI\ tag\fP, const char *\fI\ format\fP, \&...) .UNINDENT .INDENT 0.0 .TP .B int TSIsDebugTagSet(const char *\fI\ tag\fP) .UNINDENT .INDENT 0.0 .TP .B void TSDebugSpecific(int\fI\ debug_flag\fP, const char *\fI\ tag\fP, const char *\fI\ format\fP, \&...) .UNINDENT .INDENT 0.0 .TP .B void TSHttpTxnDebugSet(TSHttpTxn\fI\ txnp\fP, int\fI\ on\fP) .UNINDENT .INDENT 0.0 .TP .B void TSHttpSsnDebugSet(TSHttpSsn\fI\ ssn\fP, int\fI\ on\fP) .UNINDENT .INDENT 0.0 .TP .B int TSHttpTxnDebugGet(TSHttpTxn\fI\ txnp\fP) .UNINDENT .INDENT 0.0 .TP .B int TSHttpSsnDebugGet(TSHttpSsn\fI\ ssn\fP) .UNINDENT .INDENT 0.0 .TP .B const char* TSHttpServerStateNameLookup(TSServerState\fI\ state\fP) .UNINDENT .INDENT 0.0 .TP .B const char* TSHttpHookNameLookup(TSHttpHookID\fI\ hook\fP) .UNINDENT .INDENT 0.0 .TP .B const char* TSHttpEventNameLookup(TSEvent\fI\ event\fP) .UNINDENT .INDENT 0.0 .TP .B void TSAssert(\&...) .UNINDENT .INDENT 0.0 .TP .B void TSReleaseAssert(\&...) .UNINDENT .SH DESCRIPTION .sp \fI\%TSError()\fP is similar to \fBprintf\fP except that instead of writing the output to the C standard output, it writes output to the Traffic Server error log. .sp \fI\%TSDebug()\fP is the same as \fI\%TSError()\fP except that it only logs the debug message if the given debug \fItag\fP is enabled. It writes output to the Traffic Server debug log. .sp \fI\%TSIsDebugTagSet()\fP returns non\-zero if the given debug \fItag\fP is enabled. .sp In debug mode, \fI\%TSAssert\fP 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. \fI\%TSReleaseAssert\fP prints an error message and aborts in both release and debug mode. .sp \fI\%TSDebugSpecific()\fP emits a debug line even if the debug \fItag\fP is turned off, as long as debug flag is enabled. This can be used in conjunction with \fI\%TSHttpTxnDebugSet()\fP, \fI\%TSHttpSsnDebugSet()\fP, \fI\%TSHttpTxnDebugGet()\fP and \fI\%TSHttpSsnDebugGet()\fP to enable debugging on specific session and transaction objects. .sp \fI\%TSHttpServerStateNameLookup()\fP, \fI\%TSHttpHookNameLookup()\fP and \fI\%TSHttpEventNameLookup()\fP converts the respective internal state to a string representation. This can be useful in debugging (\fI\%TSDebug()\fP), logging and other types notifications. .SH EXAMPLES .sp This example uses \fI\%TSDebugSpecific()\fP to log a message when a specific debugging flag is enabled: .INDENT 0.0 .INDENT 3.5 .sp .nf .ft C #include // Produce information about a hook receiving an event TSDebug(PLUGIN_NAME, "Entering hook=%s, event=%s", TSHttpHookNameLookup(hook), TSHttpEventNameLookup(event)); // Emit debug message if "tag" is enabled or the txn debug // flag is set. TSDebugSpecifc(TSHttpTxnDebugGet(txn), "tag" , "Hello World from transaction %p", txn); .ft P .fi .UNINDENT .UNINDENT .SH SEE ALSO .sp \fITSAPI(3ts)\fP, \fIprintf(3)\fP .SH COPYRIGHT 2015, dev@trafficserver.apache.org .\" Generated by docutils manpage writer. .