diff options
author | cliechti <cliechti@f19166aa-fa4f-0410-85c2-fa1106f25c8a> | 2009-08-12 00:05:33 +0000 |
---|---|---|
committer | cliechti <cliechti@f19166aa-fa4f-0410-85c2-fa1106f25c8a> | 2009-08-12 00:05:33 +0000 |
commit | a5240e5b5bd8c67f6b7e46ec783f6acd6f0efd63 (patch) | |
tree | 8678cdf4a1866a4bcde0afa758d149c86d1a43b2 /documentation/pyserial_api.rst | |
parent | 05d8f4f2ff1256aeb45dffe9c8180429b9d084da (diff) | |
download | pyserial-a5240e5b5bd8c67f6b7e46ec783f6acd6f0efd63.tar.gz |
- update docs
- remove "critical" from log level choices in URL
git-svn-id: http://svn.code.sf.net/p/pyserial/code/trunk/pyserial@339 f19166aa-fa4f-0410-85c2-fa1106f25c8a
Diffstat (limited to 'documentation/pyserial_api.rst')
-rw-r--r-- | documentation/pyserial_api.rst | 18 |
1 files changed, 14 insertions, 4 deletions
diff --git a/documentation/pyserial_api.rst b/documentation/pyserial_api.rst index e634de3..70ff78f 100644 --- a/documentation/pyserial_api.rst +++ b/documentation/pyserial_api.rst @@ -569,7 +569,8 @@ Native ports :param serial_port: a :class:`Serial` instance that is managed. :param connection: an object implementing :meth:`write`, used to write to the network. - :param debug_output: used for development please set for False + :param debug_output: enables debug messages: a :class:`logging.Logger` + instance or None. Initializes the Manager and starts negotiating with client in Telnet and :rfc:`2217` protocol. The negotiation starts immediately so that @@ -586,6 +587,11 @@ Native ports raw form (:meth:`escape` must not be used) as it is used to send Telnet and :rfc:`2217` control commands. + For diagnostics of the connection or the implementation, *debug_output* + can be set to an instance of a :class:`logging.Logger` (e.g. + ``logging.getLogger('rfc2217.server')``). The caller should configure + the logger using ``setLevel`` for the desired detail level of the logs. + .. method:: escape(data) :param data: data to be sent over the network. @@ -700,7 +706,7 @@ Functions: .. function:: serial_for_url(url, \*args, \*\*kwargs) - :param url: Device name, number or URL_ + :param url: Device name, number or :ref:`URL <URLs>` :param do_not_open: When set to true, the serial port is not opened. :return: an instance of :class:`Serial` or a compatible object. @@ -717,7 +723,7 @@ Functions: .. versionadded:: 2.5 -.. _URL: URLs_ +.. _URLs: URLs ---- @@ -751,7 +757,11 @@ accept the following types URL: timeout applies to the initial Telnet / :rfc:`2271` negotiation as well as changing port settings or control line change commands. - - ``debug``: Prints diagnostic messages (not useful for end users). + - ``logging=[debug|info|warning|error]``: Prints diagnostic messages (not + useful for end users). It uses the logging module so that the application + can setup up logging handlers etc. It will call + :meth:`logging.basicConfig` which initializes for output on + ``sys.stderr`` (if no logging was set up already). ``socket://`` The purpose of this connection type is that applications using pySerial can |