Skip to content

Improve Logs#461

Merged
rido-min merged 10 commits intomainfrom
fix/clean-logs-blob
Jul 16, 2025
Merged

Improve Logs#461
rido-min merged 10 commits intomainfrom
fix/clean-logs-blob

Conversation

@rido-min
Copy link
Copy Markdown
Member

This pull request introduces several changes across multiple packages to enhance consistency, improve test reliability, and refine logging. The most significant updates include restructuring file exports, improving test assertions, and consolidating logger imports. Below is a categorized summary of the most important changes:

File Export Enhancements

  • Updated package.json files across multiple packages (e.g., agents-activity, agents-hosting, agents-hosting-express) to include package.json in the files array and added type definitions (types) to the exports field. This ensures better compatibility and type support for consumers. [1] [2] [3] [4] [5] [6]

Test Improvements

  • Updated test assertions in activity.test.ts to use Activity.fromObject() for creating activity objects, ensuring consistency and reliability in test cases. [1] [2] [3] [4] [5] [6] [7] [8]

Logger Import Consolidation

  • Replaced direct imports from @microsoft/agents-activity/src/logger with the consolidated @microsoft/agents-activity/logger module across various files to simplify and standardize logger usage. [1] [2] [3] [4] [5] [6] [7] [8]

Logging Enhancements

  • Added detailed logging in blobsStorage.ts to provide better insights into blob operations, such as initialization, reads, and writes. This includes logging container details and blob metadata like size and eTag. [1] [2] [3] [4]

Version Handling Updates

  • Updated version handling in copilotStudioClient.ts and startServer.ts to directly import the version from package.json instead of dynamically importing it, improving runtime performance and maintainability. [1] [2]

These changes collectively enhance the maintainability, reliability, and usability of the codebase.
This pull request introduces several updates across multiple packages, focusing on improving file exports, refactoring imports for better modularity, and enhancing logging in storage-related modules. Below is a summary of the most important changes grouped by theme:

File Exports and Type Definitions

  • Updated package.json files across multiple packages (e.g., agents-activity, agents-copilotstudio-client, agents-hosting-dialogs, etc.) to include package.json in the files array and added type definitions (types) to the exports field. This ensures proper packaging and type support for consumers. [1] [2] [3] [4] [5]

Refactored Imports

  • Replaced imports of debug from @microsoft/agents-activity/src/logger with @microsoft/agents-activity/logger across various files for consistency and modularity. [1] [2] [3] [4] [5]

Logging Enhancements in Storage Modules

  • Added detailed logging to the BlobsStorage class in agents-hosting-storage-blob, including initialization details and operations like reading and writing blobs. This improves traceability and debugging. [1] [2] [3] [4]

Test Updates

  • Refactored assertions in activity.test.ts to use Activity.fromObject for creating activity objects, improving test readability and alignment with the Activity class structure. [1] [2] [3] [4] [5] [6] [7] [8]

Miscellaneous Improvements

  • Replaced dynamic imports of package.json for versioning with direct imports in relevant files, such as copilotStudioClient.ts and startServer.ts, to simplify code and improve performance. [1] [2]

Copilot AI review requested due to automatic review settings July 16, 2025 15:23
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull Request Overview

This PR standardizes logging levels across storage and authentication modules by converting informational logs to debug, enhancing log consistency and reducing noise in production.

  • Downgrades repetitive storage operation logs to debug.
  • Updates OAuth flow and MSAL token provider logs to debug.
  • Refines JWT middleware to use debug for payload and key‐fetch logs.

Reviewed Changes

Copilot reviewed 4 out of 4 changed files in this pull request and generated 2 comments.

File Description
packages/agents-hosting/src/storage/memoryStorage.ts Changed logger.info to logger.debug for key read/write/delete logs
packages/agents-hosting/src/oauth/oAuthFlow.ts Updated flow state log from info to debug
packages/agents-hosting/src/auth/msalTokenProvider.ts Downgraded token provider info logs to debug
packages/agents-hosting/src/auth/jwt-middleware.ts Switched JWT decode and fetch logs from info to debug

Comment thread packages/agents-hosting/src/auth/jwt-middleware.ts
Comment thread packages/agents-hosting/src/oauth/oAuthFlow.ts Outdated
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
@rido-min rido-min enabled auto-merge (squash) July 16, 2025 16:07
@rido-min rido-min disabled auto-merge July 16, 2025 16:07
@rido-min rido-min enabled auto-merge (squash) July 16, 2025 16:07
@rido-min rido-min merged commit 0e173d8 into main Jul 16, 2025
7 checks passed
@rido-min rido-min deleted the fix/clean-logs-blob branch July 16, 2025 16:28
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants