From 3f6ee447e0cdd7a80242a48ac8a22e2f1263b108 Mon Sep 17 00:00:00 2001 From: Will McGugan Date: Fri, 27 Mar 2020 08:58:22 +0000 Subject: [PATCH] docs --- README.md | 4 ++-- docs/source/logging.rst | 6 +++--- rich/logging.py | 2 +- 3 files changed, 6 insertions(+), 6 deletions(-) diff --git a/README.md b/README.md index 0233e84e..a735db55 100644 --- a/README.md +++ b/README.md @@ -99,9 +99,9 @@ Note the `log_locals` argument, which outputs a table containing the local varia The log method could be used for logging to the terminal for long running applications such as servers, but is also a very nice debugging aid. -You can also use the builtin logging Handler class, to format and colorize output form Python's logging module. Here's an example of the output: +You can also use the builtin Handler class to format and colorize output form Python's logging module. Here's an example of the output: -![Log](./imgs/logging.png) +![Logging](https://github.com/willmcgugan/rich/blob/master/imgs/logging.png) ## Emoji diff --git a/docs/source/logging.rst b/docs/source/logging.rst index d51f5b71..4203fe04 100644 --- a/docs/source/logging.rst +++ b/docs/source/logging.rst @@ -1,5 +1,5 @@ -Logging -======= +Logging Handler +=============== Rich supplies a :ref:`logging handler` which will format and colorize text written by Python's logging module. @@ -12,6 +12,6 @@ Here's an example of how to set up a rich logger:: logging.basicConfig( level="NOTSET", format=FORMAT, datefmt="[%X] ", handlers=[RichHandler()] ) - + log = logging.getLogger("rich") log.info("Hello, World!") \ No newline at end of file diff --git a/rich/logging.py b/rich/logging.py index a406a2fb..a439a9d0 100644 --- a/rich/logging.py +++ b/rich/logging.py @@ -16,7 +16,7 @@ class RichHandler(Handler): """A logging handler that renders output with Rich. The time / level / message and file are displayed in columns. The level is color coded, and the message is syntax highlighted. - Example: + Example:: import logging from rich.logging import RichHandler