Skip to content

Commit d169af3

Browse files
authored
Log version on startup (#2523)
* Log the TJS version on boot * changefile * Merge logs
1 parent d5b463d commit d169af3

File tree

3 files changed

+14
-3
lines changed

3 files changed

+14
-3
lines changed

.vscode/settings.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
{
2-
"cSpell.words": ["adal", "frameless", "ipados", "teamspace", "uninitialize", "xvfb"],
2+
"cSpell.words": ["adal", "frameless", "ipados", "teamsjs", "teamspace", "uninitialize", "xvfb"],
33
"editor.defaultFormatter": "esbenp.prettier-vscode",
44
"eslint.workingDirectories": [
55
"./apps/ssr-test-app/",
Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
{
2+
"type": "minor",
3+
"comment": "Added logging for version on startup",
4+
"packageName": "@microsoft/teams-js",
5+
"email": "[email protected]",
6+
"dependentChangeType": "patch"
7+
}

packages/teams-js/src/public/app.ts

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -750,9 +750,13 @@ export namespace app {
750750
const scriptUsageWarning =
751751
'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';
752752
if (!currentScriptSrc || currentScriptSrc.length === 0) {
753-
appLogger('teamsjs is being used from a script tag embedded directly in your html. %s', scriptUsageWarning);
753+
appLogger(
754+
'teamsjs version %s is being used from a script tag embedded directly in your html. %s',
755+
version,
756+
scriptUsageWarning,
757+
);
754758
} else {
755-
appLogger('teamsjs is being used from %s. %s', currentScriptSrc, scriptUsageWarning);
759+
appLogger('teamsjs version %s is being used from %s. %s', version, currentScriptSrc, scriptUsageWarning);
756760
}
757761
}
758762

0 commit comments

Comments
 (0)