@@ -47,7 +47,11 @@ <h1 class="title">Module <code>supertokens_python.supertokens</code></h1>
47
47
48
48
from typing_extensions import Literal
49
49
50
- from supertokens_python.logger import get_maybe_none_as_str, log_debug_message
50
+ from supertokens_python.logger import (
51
+ get_maybe_none_as_str,
52
+ log_debug_message,
53
+ enable_debug_logging,
54
+ )
51
55
52
56
from .constants import FDI_KEY_HEADER, RID_KEY_HEADER, USER_COUNT, USER_DELETE, USERS
53
57
from .exceptions import SuperTokensError
@@ -178,6 +182,7 @@ <h1 class="title">Module <code>supertokens_python.supertokens</code></h1>
178
182
recipe_list: List[Callable[[AppInfo], RecipeModule]],
179
183
mode: Optional[Literal["asgi", "wsgi"]],
180
184
telemetry: Optional[bool],
185
+ debug: Optional[bool],
181
186
):
182
187
if not isinstance(app_info, InputAppInfo): # type: ignore
183
188
raise ValueError("app_info must be an instance of InputAppInfo")
@@ -193,6 +198,8 @@ <h1 class="title">Module <code>supertokens_python.supertokens</code></h1>
193
198
mode,
194
199
)
195
200
self.supertokens_config = supertokens_config
201
+ if debug is True:
202
+ enable_debug_logging()
196
203
self._telemetry_status: str = "NONE"
197
204
log_debug_message(
198
205
"Started SuperTokens with debug logging (supertokens.init called)"
@@ -245,6 +252,7 @@ <h1 class="title">Module <code>supertokens_python.supertokens</code></h1>
245
252
recipe_list: List[Callable[[AppInfo], RecipeModule]],
246
253
mode: Optional[Literal["asgi", "wsgi"]],
247
254
telemetry: Optional[bool],
255
+ debug: Optional[bool],
248
256
):
249
257
if Supertokens.__instance is None:
250
258
Supertokens.__instance = Supertokens(
@@ -254,6 +262,7 @@ <h1 class="title">Module <code>supertokens_python.supertokens</code></h1>
254
262
recipe_list,
255
263
mode,
256
264
telemetry,
265
+ debug,
257
266
)
258
267
PostSTInitCallbacks.run_post_init_callbacks()
259
268
@@ -790,7 +799,7 @@ <h3>Methods</h3>
790
799
</ dd >
791
800
< dt id ="supertokens_python.supertokens.Supertokens "> < code class ="flex name class ">
792
801
< span > class < span class ="ident "> Supertokens</ span > </ span >
793
- < span > (</ span > < span > app_info: < a title ="supertokens_python.supertokens.InputAppInfo " href ="#supertokens_python.supertokens.InputAppInfo "> InputAppInfo</ a > , framework: "Literal['fastapi', 'flask', 'django']", supertokens_config: < a title ="supertokens_python.supertokens.SupertokensConfig " href ="#supertokens_python.supertokens.SupertokensConfig "> SupertokensConfig</ a > , recipe_list: List[Callable[[< a title ="supertokens_python.supertokens.AppInfo " href ="#supertokens_python.supertokens.AppInfo "> AppInfo</ a > ], RecipeModule]], mode: "Optional[Literal['asgi', 'wsgi']]", telemetry: Optional[bool])</ span >
802
+ < span > (</ span > < span > app_info: < a title ="supertokens_python.supertokens.InputAppInfo " href ="#supertokens_python.supertokens.InputAppInfo "> InputAppInfo</ a > , framework: "Literal['fastapi', 'flask', 'django']", supertokens_config: < a title ="supertokens_python.supertokens.SupertokensConfig " href ="#supertokens_python.supertokens.SupertokensConfig "> SupertokensConfig</ a > , recipe_list: List[Callable[[< a title ="supertokens_python.supertokens.AppInfo " href ="#supertokens_python.supertokens.AppInfo "> AppInfo</ a > ], RecipeModule]], mode: "Optional[Literal['asgi', 'wsgi']]", telemetry: Optional[bool], debug: Optional[bool] )</ span >
794
803
</ code > </ dt >
795
804
< dd >
796
805
< div class ="desc "> </ div >
@@ -809,6 +818,7 @@ <h3>Methods</h3>
809
818
recipe_list: List[Callable[[AppInfo], RecipeModule]],
810
819
mode: Optional[Literal["asgi", "wsgi"]],
811
820
telemetry: Optional[bool],
821
+ debug: Optional[bool],
812
822
):
813
823
if not isinstance(app_info, InputAppInfo): # type: ignore
814
824
raise ValueError("app_info must be an instance of InputAppInfo")
@@ -824,6 +834,8 @@ <h3>Methods</h3>
824
834
mode,
825
835
)
826
836
self.supertokens_config = supertokens_config
837
+ if debug is True:
838
+ enable_debug_logging()
827
839
self._telemetry_status: str = "NONE"
828
840
log_debug_message(
829
841
"Started SuperTokens with debug logging (supertokens.init called)"
@@ -876,6 +888,7 @@ <h3>Methods</h3>
876
888
recipe_list: List[Callable[[AppInfo], RecipeModule]],
877
889
mode: Optional[Literal["asgi", "wsgi"]],
878
890
telemetry: Optional[bool],
891
+ debug: Optional[bool],
879
892
):
880
893
if Supertokens.__instance is None:
881
894
Supertokens.__instance = Supertokens(
@@ -885,6 +898,7 @@ <h3>Methods</h3>
885
898
recipe_list,
886
899
mode,
887
900
telemetry,
901
+ debug,
888
902
)
889
903
PostSTInitCallbacks.run_post_init_callbacks()
890
904
@@ -1293,7 +1307,7 @@ <h3>Static methods</h3>
1293
1307
</ details >
1294
1308
</ dd >
1295
1309
< dt id ="supertokens_python.supertokens.Supertokens.init "> < code class ="name flex ">
1296
- < span > def < span class ="ident "> init</ span > </ span > (< span > app_info: < a title ="supertokens_python.supertokens.InputAppInfo " href ="#supertokens_python.supertokens.InputAppInfo "> InputAppInfo</ a > , framework: "Literal['fastapi', 'flask', 'django']", supertokens_config: < a title ="supertokens_python.supertokens.SupertokensConfig " href ="#supertokens_python.supertokens.SupertokensConfig "> SupertokensConfig</ a > , recipe_list: List[Callable[[< a title ="supertokens_python.supertokens.AppInfo " href ="#supertokens_python.supertokens.AppInfo "> AppInfo</ a > ], RecipeModule]], mode: "Optional[Literal['asgi', 'wsgi']]", telemetry: Optional[bool])</ span >
1310
+ < span > def < span class ="ident "> init</ span > </ span > (< span > app_info: < a title ="supertokens_python.supertokens.InputAppInfo " href ="#supertokens_python.supertokens.InputAppInfo "> InputAppInfo</ a > , framework: "Literal['fastapi', 'flask', 'django']", supertokens_config: < a title ="supertokens_python.supertokens.SupertokensConfig " href ="#supertokens_python.supertokens.SupertokensConfig "> SupertokensConfig</ a > , recipe_list: List[Callable[[< a title ="supertokens_python.supertokens.AppInfo " href ="#supertokens_python.supertokens.AppInfo "> AppInfo</ a > ], RecipeModule]], mode: "Optional[Literal['asgi', 'wsgi']]", telemetry: Optional[bool], debug: Optional[bool] )</ span >
1297
1311
</ code > </ dt >
1298
1312
< dd >
1299
1313
< div class ="desc "> </ div >
@@ -1309,6 +1323,7 @@ <h3>Static methods</h3>
1309
1323
recipe_list: List[Callable[[AppInfo], RecipeModule]],
1310
1324
mode: Optional[Literal["asgi", "wsgi"]],
1311
1325
telemetry: Optional[bool],
1326
+ debug: Optional[bool],
1312
1327
):
1313
1328
if Supertokens.__instance is None:
1314
1329
Supertokens.__instance = Supertokens(
@@ -1318,6 +1333,7 @@ <h3>Static methods</h3>
1318
1333
recipe_list,
1319
1334
mode,
1320
1335
telemetry,
1336
+ debug,
1321
1337
)
1322
1338
PostSTInitCallbacks.run_post_init_callbacks()</ code > </ pre >
1323
1339
</ details >
0 commit comments