mirror of
https://github.com/Rapptz/discord.py.git
synced 2025-07-06 01:51:59 +00:00
logging.rst: Fix some typos and grammar errors
This commit is contained in:
parent
a40e20fa38
commit
d6df55afe2
@ -14,16 +14,16 @@ Configuration of the ``logging`` module can be as simple as::
|
|||||||
logging.basicConfig(level=logging.INFO)
|
logging.basicConfig(level=logging.INFO)
|
||||||
|
|
||||||
Placed at the start of the application. This will output the logs from
|
Placed at the start of the application. This will output the logs from
|
||||||
discord as well as other libraries that uses the ``logging`` module
|
discord as well as other libraries that use the ``logging`` module
|
||||||
directly to the console.
|
directly to the console.
|
||||||
|
|
||||||
The optional ``level`` argument specifies what level of events to log
|
The optional ``level`` argument specifies what level of events to log
|
||||||
out and can any of ``CRITICAL``, ``ERROR``, ``WARNING``, ``INFO``, and
|
out and can be any of ``CRITICAL``, ``ERROR``, ``WARNING``, ``INFO``, and
|
||||||
``DEBUG`` and if not specified defaults to ``WARNING``.
|
``DEBUG`` and if not specified defaults to ``WARNING``.
|
||||||
|
|
||||||
More advance setups are possible with the :mod:`logging` module. To for
|
More advanced setups are possible with the :mod:`logging` module. For
|
||||||
example write the logs to a file called ``discord.log`` instead of
|
example to write the logs to a file called ``discord.log`` instead of
|
||||||
outputting them to to the console the following snippet can be used::
|
outputting them to the console the following snippet can be used::
|
||||||
|
|
||||||
import discord
|
import discord
|
||||||
import logging
|
import logging
|
||||||
@ -34,8 +34,8 @@ outputting them to to the console the following snippet can be used::
|
|||||||
handler.setFormatter(logging.Formatter('%(asctime)s:%(levelname)s:%(name)s: %(message)s'))
|
handler.setFormatter(logging.Formatter('%(asctime)s:%(levelname)s:%(name)s: %(message)s'))
|
||||||
logger.addHandler(handler)
|
logger.addHandler(handler)
|
||||||
|
|
||||||
This is recommended, especially at verbose levels such as ``INFO``,
|
This is recommended, especially at verbose levels such as ``INFO``
|
||||||
and ``DEBUG`` as there are a lot of events logged and it would clog the
|
and ``DEBUG``, as there are a lot of events logged and it would clog the
|
||||||
stdout of your program.
|
stdout of your program.
|
||||||
|
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user