Skip to content

Add setting for logs to use CCM format#1

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

Add setting for logs to use CCM format#1
Copilot wants to merge 3 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

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
Copy link
Copy Markdown

check-spelling-bot Report

🔴 Please review

See the 📂 files view, the 📜action log, or 📝 job summary for details.

Unrecognized words (1)

fff

These words are not needed and should be removed AAD ABCD abi ACL'd AMap Amd appdata ARMNT asan Baz bitmask bluetooth boundparms brk Buf certs cgi CMSG codepage commandline constexpr Cov cswinrt CTL Dbg Dcom decompressor dedupe DEFT devhome Dns dsc ERANGE errcode errmsg errstr filemode Finalizers FULLWIDTH fuzzer GES github Hackathon HINSTANCE hlocal hmac Hyperlink ICONDIR icu idx img inet Intelli iwr JDK LCID lhs LONGLONG LPBYTE LPCWSTR LPDWORD LPSTR LPVOID LPWSTR MAJORVERSION MAXLENGTH maxvalue MDs MINORVERSION mta nlohmann NONAME NOUPDATE NTFS ofile oid oop OPTOUT outfile OUTOFMEMORY PARAMETERMAP pdb PDWORD pid PKCS pkix placeholders positionals posix pscustomobject pseudocode PSHOST publickey qword redirector regexes remoting reparse REQS rhs rowid RTTI runspace runtimes SARL savepoint Scm sid sqlite subdir subkey trimstart ttl typedef uninitialize uninstallation UNMARSHALING userprofile versioned Webserver website wildcards winreg WMI workaround Wpp wsl

To accept these unrecognized words as correct and remove the previously acknowledged and now absent words, you could run the following commands

... in a clone of the git@github.com:devicie/winget-cli.git repository
on the copilot/add-logs-cmtrace-format branch (ℹ️ how do I use this?):

curl -s -S -L 'https://raw.githubusercontent.com/check-spelling/check-spelling/v0.0.26/apply.pl' |
perl - 'https://github.com/devicie/winget-cli/actions/runs/25955791184/attempts/1' &&
git commit -m 'Update check-spelling metadata'

Pattern suggestions ✂️ (2)

You could add these patterns to .github/actions/spelling/patterns.txt:

# Automatically suggested patterns

# hit-count: 1 file-count: 1
# assign regex
= /[^*].*?(?:[a-z]{3,}|[A-Z]{3,}|[A-Z][a-z]{2,}).*/[gi]?(?=\W|$)

# hit-count: 1 file-count: 1
# regex choice
\(\?:[^)]+\|[^)]+\)

Alternatively, if a pattern suggestion doesn't make sense for this project, add a # to the beginning of the line in the candidates file with the pattern to stop suggesting it.

Notices ℹ️ (1)

See the 📂 files view, the 📜action log, or 📝 job summary for details.

ℹ️ Notices Count
ℹ️ candidate-pattern 2

See ℹ️ Event descriptions for more information.

If the flagged items are 🤯 false positives

If items relate to a ...

  • binary file (or some other file you wouldn't want to check at all).

    Please add a file path to the excludes.txt file matching the containing file.

    File paths are Perl 5 Regular Expressions - you can test yours before committing to verify it will match your files.

    ^ refers to the file's path from the root of the repository, so ^README\.md$ would exclude README.md (on whichever branch you're using).

  • well-formed pattern.

    If you can write a pattern that would match it,
    try adding it to the patterns.txt file.

    Patterns are Perl 5 Regular Expressions - you can test yours before committing to verify it will match your lines.

    Note that patterns can't match multiline strings.

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
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