File tree 1 file changed +27
-0
lines changed
1 file changed +27
-0
lines changed Original file line number Diff line number Diff line change @@ -18,4 +18,31 @@ For even more logs, you can set the loglevel at **DEBUG**:
18
18
import logging
19
19
logging.basicConfig(level = logging.DEBUG )
20
20
21
+ Disabling logs
22
+ --------------
23
+
24
+ By default, the logs for the transports are quite verbose.
25
+
26
+ On the **INFO ** level, all the messages between the frontend and the backend are logged which can
27
+ be difficult to read especially when it fetches the schema from the transport.
28
+
29
+ It is possible to disable the logs only for a specific gql transport by setting a higher
30
+ log level for this transport (**WARNING ** for example) so that the other logs of your program are not affected.
31
+
32
+ For this, you should import the logger from the transport file and set the level on this logger.
33
+
34
+ For the RequestsHTTPTransport:
35
+
36
+ .. code-block :: python
37
+
38
+ from gql.transport.requests import log as requests_logger
39
+ requests_logger.setLevel(logging.WARNING )
40
+
41
+ For the WebsocketsTransport:
42
+
43
+ .. code-block :: python
44
+
45
+ from gql.transport.websockets import log as websockets_logger
46
+ websockets_logger.setLevel(logging.WARNING )
47
+
21
48
.. _logging : https://docs.python.org/3/howto/logging.html
You can’t perform that action at this time.
0 commit comments