You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@trafficserver.apache.org by jp...@apache.org on 2013/07/10 21:35:12 UTC
git commit: sphinx: add TSDebug man page
Updated Branches:
refs/heads/master b83facf1b -> cbe2fafeb
sphinx: add TSDebug man page
Project: http://git-wip-us.apache.org/repos/asf/trafficserver/repo
Commit: http://git-wip-us.apache.org/repos/asf/trafficserver/commit/cbe2fafe
Tree: http://git-wip-us.apache.org/repos/asf/trafficserver/tree/cbe2fafe
Diff: http://git-wip-us.apache.org/repos/asf/trafficserver/diff/cbe2fafe
Branch: refs/heads/master
Commit: cbe2fafebe8b714885f86d6d7832fd4a8e04ce4e
Parents: b83facf
Author: James Peach <jp...@apache.org>
Authored: Wed Jul 10 13:35:02 2013 -0600
Committer: James Peach <jp...@apache.org>
Committed: Wed Jul 10 13:35:02 2013 -0600
----------------------------------------------------------------------
doc/conf.py | 3 +-
doc/sdk/man/TSAPI.en.rst | 30 +++++------
doc/sdk/man/TSDebug.en.rst | 111 ++++++++++++++++++++++++++++++++++++++++
doc/sdk/man/index.en.rst | 1 +
4 files changed, 129 insertions(+), 16 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/trafficserver/blob/cbe2fafe/doc/conf.py
----------------------------------------------------------------------
diff --git a/doc/conf.py b/doc/conf.py
index 7b91c4a..99f71ba 100644
--- a/doc/conf.py
+++ b/doc/conf.py
@@ -213,7 +213,8 @@ latex_documents = [
# One entry per manual page. List of tuples
# (source start file, name, description, authors, manual section).
man_pages = [
- ('sdk/man/TSAPI', 'TSAPI', u'Introduction to the Apache Traffic Server API', None, u'3ts')
+ ('sdk/man/TSAPI.en', 'TSAPI', u'Introduction to the Apache Traffic Server API', None, u'3ts'),
+ ('sdk/man/TSDebug.en', 'TSDebug', u'Traffic Server Debugging APIs', None, u'3ts'),
]
# If true, show URL addresses after external links.
http://git-wip-us.apache.org/repos/asf/trafficserver/blob/cbe2fafe/doc/sdk/man/TSAPI.en.rst
----------------------------------------------------------------------
diff --git a/doc/sdk/man/TSAPI.en.rst b/doc/sdk/man/TSAPI.en.rst
index 73b4a3d..e56e2a4 100644
--- a/doc/sdk/man/TSAPI.en.rst
+++ b/doc/sdk/man/TSAPI.en.rst
@@ -1,18 +1,18 @@
-.. Licensed to the Apache Software Foundation (ASF) under one .\"
- or more contributor license agreements. See the NOTICE file .\"
- distributed with this work for additional information .\"
- regarding copyright ownership. The ASF licenses this file .\"
- to you under the Apache License, Version 2.0 (the .\"
- "License"); you may not use this file except in compliance .\"
- with the License. You may obtain a copy of the License at .\"
- \"
- http://www.apache.org/licenses/LICENSE-2.0 .\"
- \"
- Unless required by applicable law or agreed to in writing, software .\"
- distributed under the License is distributed on an "AS IS" BASIS, .\"
- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. .\"
- See the License for the specific language governing permissions and .\"
- limitations under the License. .\"
+.. Licensed to the Apache Software Foundation (ASF) under one
+ or more contributor license agreements. See the NOTICE file
+ distributed with this work for additional information
+ regarding copyright ownership. The ASF licenses this file
+ to you under the Apache License, Version 2.0 (the
+ "License"); you may not use this file except in compliance
+ with the License. You may obtain a copy of the License at
+
+ http://www.apache.org/licenses/LICENSE-2.0
+
+ Unless required by applicable law or agreed to in writing, software
+ distributed under the License is distributed on an "AS IS" BASIS,
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ See the License for the specific language governing permissions and
+ limitations under the License.
=========
``TSAPI``
http://git-wip-us.apache.org/repos/asf/trafficserver/blob/cbe2fafe/doc/sdk/man/TSDebug.en.rst
----------------------------------------------------------------------
diff --git a/doc/sdk/man/TSDebug.en.rst b/doc/sdk/man/TSDebug.en.rst
new file mode 100644
index 0000000..d202a75
--- /dev/null
+++ b/doc/sdk/man/TSDebug.en.rst
@@ -0,0 +1,111 @@
+.. Licensed to the Apache Software Foundation (ASF) under one
+ or more contributor license agreements. See the NOTICE file
+ distributed with this work for additional information
+ regarding copyright ownership. The ASF licenses this file
+ to you under the Apache License, Version 2.0 (the
+ "License"); you may not use this file except in compliance
+ with the License. You may obtain a copy of the License at
+
+ http://www.apache.org/licenses/LICENSE-2.0
+
+ Unless required by applicable law or agreed to in writing, software
+ distributed under the License is distributed on an "AS IS" BASIS,
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ See the License for the specific language governing permissions and
+ limitations under the License.
+
+==========
+``TSDebug``
+==========
+
+.Nm TSDebug,
+.Nm TSError,
+.Nm TSIsDebugTagSet,
+.Nm TSDebugSpecific,
+.Nm TSHttpTxnDebugSet,
+.Nm TSHttpSsnDebugSet,
+.Nm TSHttpTxnDebugGet,
+.Nm TSHttpSsnDebugGet,
+.Nm TSAssert,
+.Nm TSReleaseAssert
+
+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``\(`expression`\)
+|
+| void
+| ``TSReleaseAssert``\(`expression`\)
+
+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
+========
+
+This example uses ``TSDebugSpecific``\(\) to log a message when a specific
+debugging flag is enabled::
+
+ #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
+========
+:manpage:`TSAPI(3ts)`
http://git-wip-us.apache.org/repos/asf/trafficserver/blob/cbe2fafe/doc/sdk/man/index.en.rst
----------------------------------------------------------------------
diff --git a/doc/sdk/man/index.en.rst b/doc/sdk/man/index.en.rst
index ac4ed6b..55f4b09 100644
--- a/doc/sdk/man/index.en.rst
+++ b/doc/sdk/man/index.en.rst
@@ -22,4 +22,5 @@ API Reference
:maxdepth: 2
TSAPI.en
+ TSDebug.en