-
Notifications
You must be signed in to change notification settings - Fork 197
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
Improve debugging discoverability #2529
Draft
KangxuanYe
wants to merge
12
commits into
main
Choose a base branch
from
kx/debugging_discoverability_poc
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Draft
Changes from all commits
Commits
Show all changes
12 commits
Select commit
Hold shift + click to select a range
5144052
check in with function to create debugger
KangxuanYe cf1eda0
workable version but has problem in extend function on internalDebugger
KangxuanYe 27bf307
fix extend function
KangxuanYe aeec0d9
update anonymous function for log
KangxuanYe 4297d88
improve anonymous function
KangxuanYe cf18306
add changefile
KangxuanYe 619f126
update
KangxuanYe e2a9ed4
replace topLevelLogger
KangxuanYe dd12663
update
KangxuanYe 79fdd59
Merge branch 'main' into kx/debugging_discoverability_poc
KangxuanYe fc0eccf
Merge branch 'main' into kx/debugging_discoverability_poc
KangxuanYe d891922
update comment
KangxuanYe File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
import { logger } from '@microsoft/teams-js'; | ||
import React, { ReactElement } from 'react'; | ||
|
||
import { ApiWithoutInput } from './utils'; | ||
import { ModuleWrapper } from './utils/ModuleWrapper'; | ||
|
||
const TurnOnConsoleLog = (): React.ReactElement => | ||
ApiWithoutInput({ | ||
name: 'turnOnConsoleLog', | ||
title: 'Turn On Console Log', | ||
onClick: async () => { | ||
logger.turnOnConsoleLog(); | ||
return 'true'; | ||
}, | ||
}); | ||
|
||
const TurnOffConsoleLog = (): React.ReactElement => | ||
ApiWithoutInput({ | ||
name: 'turnOffConsoleLog', | ||
title: 'Turn Off Console Log', | ||
onClick: async () => { | ||
logger.turnOffConsoleLog(); | ||
return 'true'; | ||
}, | ||
}); | ||
const LoggerAPIs = (): ReactElement => ( | ||
<ModuleWrapper title="Logger"> | ||
<TurnOnConsoleLog /> | ||
<TurnOffConsoleLog /> | ||
</ModuleWrapper> | ||
); | ||
|
||
export default LoggerAPIs; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
7 changes: 7 additions & 0 deletions
7
change/@microsoft-teams-js-65d123d3-bbbc-4e7e-abc8-7396d65b2950.json
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
{ | ||
"type": "minor", | ||
"comment": "Added a capability for better logging discoverability", | ||
"packageName": "@microsoft/teams-js", | ||
"email": "[email protected]", | ||
"dependentChangeType": "patch" | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
import { GlobalVars } from '../internal/globalVars'; | ||
|
||
export namespace logger { | ||
/** | ||
* Turn on client logging to display all of debug logs on browser console | ||
*/ | ||
export function turnOnConsoleLog(): void { | ||
GlobalVars.turnOnConsoleLog = true; | ||
} | ||
|
||
/** | ||
* Turn off client logging so that all of debug logs will not be displayed on browser console | ||
*/ | ||
export function turnOffConsoleLog(): void { | ||
GlobalVars.turnOnConsoleLog = false; | ||
} | ||
} |
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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.
This is cool and it will probably need a good dose of explanatory comments
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.
Could you please take a look on comments? Basically I just explained the code in detail.