-
Notifications
You must be signed in to change notification settings - Fork 80
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
feat: added debug
flag in the SuperTokenConfig
in the init()
for logging
#732
Changes from 4 commits
6c554e9
ea9f047
4e98b67
a995017
1492467
41afe16
3968f71
d44252c
8a5e872
efd7579
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -32,6 +32,7 @@ import STError from "./error"; | |
import { logDebugMessage } from "./logger"; | ||
import { PostSuperTokensInitCallbacks } from "./postSuperTokensInitCallbacks"; | ||
import { DEFAULT_TENANT_ID } from "./recipe/multitenancy/constants"; | ||
import debug from "debug"; | ||
|
||
export default class SuperTokens { | ||
private static instance: SuperTokens | undefined; | ||
|
@@ -49,6 +50,9 @@ export default class SuperTokens { | |
telemetryEnabled: boolean; | ||
|
||
constructor(config: TypeInput) { | ||
if (config.debug) { | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
|
||
debug.enable("com.supertokens"); | ||
rishabhpoddar marked this conversation as resolved.
Show resolved
Hide resolved
|
||
} | ||
logDebugMessage("Started SuperTokens with debug logging (supertokens.init called)"); | ||
const originToPrint = | ||
config.appInfo.origin === undefined | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
why aren't you checking for
if (debug.enabled(SUPERTOKENS_DEBUG_NAMESPACE)) {
?There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We already call
debug.enable()
when initialising the logger, so ideally this should always returntrue
. Added this check, just for safety.