File tree Expand file tree Collapse file tree 4 files changed +62
-13
lines changed
Expand file tree Collapse file tree 4 files changed +62
-13
lines changed Load Diff This file was deleted.
Original file line number Diff line number Diff line change 11.. currentmodule :: twitchio
22
33
4- Utils
5- #################
4+ Asset
5+ -----
66
77.. attributetable :: twitchio.Asset
88
99.. autoclass :: twitchio.Asset
1010 :members:
1111
12+
13+ Colour
14+ ------
1215.. attributetable :: twitchio.Colour
1316
1417.. autoclass :: twitchio.Colour
1518 :members:
19+
20+
21+ .. autoclass :: twitchio.Color()
22+
23+
24+ Scopes
25+ ------
26+
27+ .. attributetable :: twitchio.Scopes
28+
29+ .. autoclass :: twitchio.Scopes
30+ :members:
31+
32+
33+ Helpers
34+ -------
35+
36+ .. autofunction :: twitchio.utils.url_encode_datetime
37+
38+ .. autofunction :: twitchio.utils.parse_timestamp
39+
40+ .. autofunction :: twitchio.utils.setup_logging
Original file line number Diff line number Diff line change @@ -15,4 +15,4 @@ async def event_oauth_authorized(payload: UserTokenPayload) -> None:
1515 """
1616
1717async def event_ready () -> None :
18- """Event dispatched when the Client is ready."""
18+ """Event dispatched when the Client is ready and has completed login ."""
Original file line number Diff line number Diff line change @@ -202,6 +202,40 @@ def setup_logging(
202202 level : int | None = None ,
203203 root : bool = True ,
204204) -> None :
205+ """A helper function to setup logging for your application.
206+
207+ Parameters
208+ ----------
209+ handler: :class:`logging.Handler` | None
210+ An optional :class:`logging.Handler` to use. Defaults to ``None``, which creates a :class:`logging.StreamHandler`
211+ by default.
212+ formatter: :class:`logging.Formatter` | None
213+ An optional :class:`logging.Formatter` to use. Defaults to ``None``, which uses a custom TrueColour
214+ formatter by default, falling back to standard colour support and finally no colour support if no colour
215+ is supported.
216+ level: int | None
217+ An optional int indicating the level of logging output. Defaults to ``20``, which is ``INFO``.
218+ root: bool
219+ An optional bool indicating whether logging should be setup on the root logger. When ``False``, logging will only be
220+ setup for twitchio. Defaults to ``True``.
221+
222+ Examples
223+ --------
224+
225+ .. code-block:: python3
226+
227+ import logging
228+
229+ import twitchio
230+
231+
232+ LOGGER: logging.Logger = logging.getLogger(__name__)
233+ twitchio.utils.setup_logging(level=logging.INFO)
234+ ...
235+
236+ arg: str = "World!"
237+ LOGGER.info("Hello %s", arg)
238+ """
205239 if level is None :
206240 level = logging .INFO
207241
You can’t perform that action at this time.
0 commit comments