Skip to content

Add setting for logs to use CCM format#1

Draft
Copilot wants to merge 4 commits into
masterfrom
copilot/add-logs-cmtrace-format
Draft

Add setting for logs to use CCM format#1
Copilot wants to merge 4 commits into
masterfrom
copilot/add-logs-cmtrace-format

Conversation

Copy link
Copy Markdown

Copilot AI commented May 15, 2026

📖 Description

Adds a logging.format enum setting to WinGet that controls the log file format. The setting accepts "winget" (default, existing behaviour) or "CCM" to enable CCM/CMTrace-compatible log formatting in the FileLogger.

When "CCM" is selected, log entries are written in the format recognized by CMTrace and Microsoft Endpoint Configuration Manager log viewers:

<![LOG[message]LOG]!><time="HH:mm:ss.fff+###" date="MM-dd-YYYY" component="channel" context="" type="N" thread="TID" file="">

Key changes:

  • Added LogFileFormat enum (WinGet, CCM) to AppInstallerLogging.h
  • Replaced the previous LoggingUseCMTrace bool with LoggingFormat in the Setting enum, mapped to .logging.format
  • Added ToCCMLogLine() helper in FileLogger.cpp; FileLogger::Write() dispatches to it when logging.format is "CCM"
  • Added .github/workflows/build-msix.yml — builds an x64 Release MSIX on pushes to copilot/** branches, PRs, and manual dispatch, uploading the package as a GitHub Actions artifact
  • Added fff (milliseconds datetime format token) to .github/actions/spelling/expect.txt to fix spelling CI check

Example settings.json:

{
    "logging": {
        "format": "CCM"
    }
}

🔗 References

🔍 Validation

Unit tests added under SettingLoggingFormat in AppInstallerCLITests covering:

  • Default value is WinGet
  • "winget" and "CCM" values parse correctly
  • Case-insensitive matching ("CCM" and "ccm" both work)
  • Invalid value (e.g. "cmtrace") produces a warning and falls back to default
  • Wrong type produces a warning and falls back to default

✅ Checklist

📋 Issue Type

  • Bug fix
  • Feature
  • Task
Original prompt

add a setting for logs to use the CMTrace format. they shouldn't use it by default. write and run appropriate tests. check past PRs and issues to ensure you follow conventions in the codebase

Created from VS Code.

@github-actions

This comment has been minimized.

Copy link
Copy Markdown
Member

@pl4nty Tom Plant (pl4nty) left a comment

Choose a reason for hiding this comment

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

the format's name is CCM, eg ToCCMLogLine

for the setting, let's make a logging.format enum. the values can be the current format (what's its name? winget?) or "CCM". defaulting to the current format

can you upload the built files somewhere, so I can test? Ideally the full msix. maybe by uploading to a file sharing service? or writing a GitHub action that builds and uploads them as artefacts. if you choose to make an action, run it yourself to test and ensure it works

@github-actions

This comment has been minimized.

Copy link
Copy Markdown
Author

Copilot AI commented May 16, 2026

the format's name is CCM, eg ToCCMLogLine

for the setting, let's make a logging.format enum. the values can be the current format (what's its name? winget?) or "CCM". defaulting to the current format...

Done in commit 9d83250:

  • Renamed the formatter to ToCCMLogLine and the enum value to LogFileFormat::CCM
  • Replaced the logging.useCMTrace bool with a logging.format enum; valid values are "winget" (default, existing behaviour) and "CCM"
  • Added .github/workflows/build-msix.yml — it triggers on pushes to copilot/** branches and on PRs, builds an x64 Release MSIX, and uploads it as a GitHub Actions artifact (msix-x64-Release) retained for 7 days. You can also trigger it manually from the Actions tab.

Copilot AI changed the title [WIP] Add setting for logs to use CMTrace format Add setting for logs to use CCM format May 16, 2026
Copilot AI requested a review from Tom Plant (pl4nty) May 16, 2026 07:13
@pl4nty
Copy link
Copy Markdown
Member

Copilot fix the CI error

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.

2 participants