@@ -47,7 +47,11 @@ <h1 class="title">Module <code>supertokens_python.supertokens</code></h1>
4747
4848from typing_extensions import Literal
4949
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+ )
5155
5256from .constants import FDI_KEY_HEADER, RID_KEY_HEADER, USER_COUNT, USER_DELETE, USERS
5357from .exceptions import SuperTokensError
@@ -178,6 +182,7 @@ <h1 class="title">Module <code>supertokens_python.supertokens</code></h1>
178182 recipe_list: List[Callable[[AppInfo], RecipeModule]],
179183 mode: Optional[Literal["asgi", "wsgi"]],
180184 telemetry: Optional[bool],
185+ debug: Optional[bool],
181186 ):
182187 if not isinstance(app_info, InputAppInfo): # type: ignore
183188 raise ValueError("app_info must be an instance of InputAppInfo")
@@ -193,6 +198,8 @@ <h1 class="title">Module <code>supertokens_python.supertokens</code></h1>
193198 mode,
194199 )
195200 self.supertokens_config = supertokens_config
201+ if debug is True:
202+ enable_debug_logging()
196203 self._telemetry_status: str = "NONE"
197204 log_debug_message(
198205 "Started SuperTokens with debug logging (supertokens.init called)"
@@ -245,6 +252,7 @@ <h1 class="title">Module <code>supertokens_python.supertokens</code></h1>
245252 recipe_list: List[Callable[[AppInfo], RecipeModule]],
246253 mode: Optional[Literal["asgi", "wsgi"]],
247254 telemetry: Optional[bool],
255+ debug: Optional[bool],
248256 ):
249257 if Supertokens.__instance is None:
250258 Supertokens.__instance = Supertokens(
@@ -254,6 +262,7 @@ <h1 class="title">Module <code>supertokens_python.supertokens</code></h1>
254262 recipe_list,
255263 mode,
256264 telemetry,
265+ debug,
257266 )
258267 PostSTInitCallbacks.run_post_init_callbacks()
259268
@@ -790,7 +799,7 @@ <h3>Methods</h3>
790799</ dd >
791800< dt id ="supertokens_python.supertokens.Supertokens "> < code class ="flex name class ">
792801< 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 >
794803</ code > </ dt >
795804< dd >
796805< div class ="desc "> </ div >
@@ -809,6 +818,7 @@ <h3>Methods</h3>
809818 recipe_list: List[Callable[[AppInfo], RecipeModule]],
810819 mode: Optional[Literal["asgi", "wsgi"]],
811820 telemetry: Optional[bool],
821+ debug: Optional[bool],
812822 ):
813823 if not isinstance(app_info, InputAppInfo): # type: ignore
814824 raise ValueError("app_info must be an instance of InputAppInfo")
@@ -824,6 +834,8 @@ <h3>Methods</h3>
824834 mode,
825835 )
826836 self.supertokens_config = supertokens_config
837+ if debug is True:
838+ enable_debug_logging()
827839 self._telemetry_status: str = "NONE"
828840 log_debug_message(
829841 "Started SuperTokens with debug logging (supertokens.init called)"
@@ -876,6 +888,7 @@ <h3>Methods</h3>
876888 recipe_list: List[Callable[[AppInfo], RecipeModule]],
877889 mode: Optional[Literal["asgi", "wsgi"]],
878890 telemetry: Optional[bool],
891+ debug: Optional[bool],
879892 ):
880893 if Supertokens.__instance is None:
881894 Supertokens.__instance = Supertokens(
@@ -885,6 +898,7 @@ <h3>Methods</h3>
885898 recipe_list,
886899 mode,
887900 telemetry,
901+ debug,
888902 )
889903 PostSTInitCallbacks.run_post_init_callbacks()
890904
@@ -1293,7 +1307,7 @@ <h3>Static methods</h3>
12931307</ details >
12941308</ dd >
12951309< 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 >
12971311</ code > </ dt >
12981312< dd >
12991313< div class ="desc "> </ div >
@@ -1309,6 +1323,7 @@ <h3>Static methods</h3>
13091323 recipe_list: List[Callable[[AppInfo], RecipeModule]],
13101324 mode: Optional[Literal["asgi", "wsgi"]],
13111325 telemetry: Optional[bool],
1326+ debug: Optional[bool],
13121327):
13131328 if Supertokens.__instance is None:
13141329 Supertokens.__instance = Supertokens(
@@ -1318,6 +1333,7 @@ <h3>Static methods</h3>
13181333 recipe_list,
13191334 mode,
13201335 telemetry,
1336+ debug,
13211337 )
13221338 PostSTInitCallbacks.run_post_init_callbacks()</ code > </ pre >
13231339</ details >
0 commit comments