commit 9217bb1b4bfe07235604cd2ac94d41995b8cbd33 Author: Damian Johnson atagar@torproject.org Date: Sat Oct 27 15:28:28 2012 -0700
Revised API docs for stem.util.log --- docs/api.rst | 1 + docs/contents.rst | 1 + docs/util/log.rst | 5 +++++ stem/util/log.py | 10 +++++----- 4 files changed, 12 insertions(+), 5 deletions(-)
diff --git a/docs/api.rst b/docs/api.rst index 3296228..7a2392a 100644 --- a/docs/api.rst +++ b/docs/api.rst @@ -27,5 +27,6 @@ Utilities * `stem.util.conf <util/conf.html>`_ - Configuration file handling. * `stem.util.connection <util/connection.html>`_ - Connection and IP related utilities. * `stem.util.enum <util/enum.html>`_ - Enumeration class. +* `stem.util.log <util/log.html>`_ - Logging utilities. * `stem.util.str_tools <util/str_tools.html>`_ - String utilities.
diff --git a/docs/contents.rst b/docs/contents.rst index f937e77..3cc8928 100644 --- a/docs/contents.rst +++ b/docs/contents.rst @@ -23,5 +23,6 @@ Contents util/conf util/connection util/enum + util/log util/str_tools
diff --git a/docs/util/log.rst b/docs/util/log.rst new file mode 100644 index 0000000..1b7e2b1 --- /dev/null +++ b/docs/util/log.rst @@ -0,0 +1,5 @@ +Logging +======= + +.. automodule:: stem.util.log + diff --git a/stem/util/log.py b/stem/util/log.py index 9caa462..b9dd988 100644 --- a/stem/util/log.py +++ b/stem/util/log.py @@ -79,7 +79,7 @@ def get_logger(): """ Provides the stem logger.
- :return: logging.Logger for stem + :return: **logging.Logger** for stem """
return LOGGER @@ -88,7 +88,7 @@ def logging_level(runlevel): """ Translates a runlevel into the value expected by the logging module.
- :param Runlevel runlevel: runlevel to be returned, no logging if None + :param Runlevel runlevel: runlevel to be returned, no logging if **None** """
if runlevel: return LOG_VALUES[runlevel] @@ -112,7 +112,7 @@ def log(runlevel, message): """ Logs a message at the given runlevel.
- :param Runlevel runlevel: runlevel to log the message at, logging is skipped if None + :param Runlevel runlevel: runlevel to log the message at, logging is skipped if **None** :param str message: message to be logged """
@@ -125,10 +125,10 @@ def log_once(message_id, runlevel, message): been logged then this is a no-op.
:param str message_id: unique message identifier to deduplicate on - :param Runlevel runlevel: runlevel to log the message at, logging is skipped if None + :param Runlevel runlevel: runlevel to log the message at, logging is skipped if **None** :param str message: message to be logged
- :returns: True if we log the message, False otherwise + :returns: **True** if we log the message, **False** otherwise """
if not runlevel or message_id in DEDUPLICATION_MESSAGE_IDS:
tor-commits@lists.torproject.org