Skip to content

Commit

Permalink
Log version on startup (#2523)
Browse files Browse the repository at this point in the history
* Log the TJS version on boot

* changefile

* Merge logs
  • Loading branch information
AE-MS authored Sep 23, 2024
1 parent d5b463d commit d169af3
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 3 deletions.
2 changes: 1 addition & 1 deletion .vscode/settings.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"cSpell.words": ["adal", "frameless", "ipados", "teamspace", "uninitialize", "xvfb"],
"cSpell.words": ["adal", "frameless", "ipados", "teamsjs", "teamspace", "uninitialize", "xvfb"],
"editor.defaultFormatter": "esbenp.prettier-vscode",
"eslint.workingDirectories": [
"./apps/ssr-test-app/",
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
{
"type": "minor",
"comment": "Added logging for version on startup",
"packageName": "@microsoft/teams-js",
"email": "[email protected]",
"dependentChangeType": "patch"
}
8 changes: 6 additions & 2 deletions packages/teams-js/src/public/app.ts
Original file line number Diff line number Diff line change
Expand Up @@ -750,9 +750,13 @@ export namespace app {
const scriptUsageWarning =
'Today, teamsjs can only be used from a single script or you may see undefined behavior. This log line is used to help detect cases where teamsjs is loaded multiple times -- it is always written. The presence of the log itself does not indicate a multi-load situation, but multiples of these log lines will. If you would like to use teamjs from more than one script at the same time, please open an issue at https://github.com/OfficeDev/microsoft-teams-library-js/issues';
if (!currentScriptSrc || currentScriptSrc.length === 0) {
appLogger('teamsjs is being used from a script tag embedded directly in your html. %s', scriptUsageWarning);
appLogger(
'teamsjs version %s is being used from a script tag embedded directly in your html. %s',
version,
scriptUsageWarning,
);
} else {
appLogger('teamsjs is being used from %s. %s', currentScriptSrc, scriptUsageWarning);
appLogger('teamsjs version %s is being used from %s. %s', version, currentScriptSrc, scriptUsageWarning);
}
}

Expand Down

0 comments on commit d169af3

Please sign in to comment.