Skip to content

[pull] main from MicrosoftDocs:main #319

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 20 commits into from
Jun 6, 2025
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
update example
  • Loading branch information
TylerMSFT committed Jun 5, 2025
commit ab4c3db36dee911f97b67dee75af666fb7ed34de
12 changes: 6 additions & 6 deletions docs/build/reference/experimental-log.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,12 +12,15 @@ Output [SARIF](https://sarifweb.azurewebsites.net/) diagnostics to the specified
## Syntax

> **`/experimental:log`** *filename*
> **`/experimental:log`** *directoryname\*

## Arguments

*filename*

Where to output SARIF diagnostics. The `.sarif` suffix is added to *filename* to produce the final filename at which to store the resulting SARIF diagnostics. The space between `/experimental:log` and *filename* is optional. Paths that include spaces must be enclosed in double quotes. *filename* may name a relative or absolute path.
Specifies the output path for SARIF diagnostics. The compiler automatically adds the `.sarif` extension to *filename*. The space between `/experimental:log` and *filename* is optional. Use double quotes around paths containing spaces. Both relative and absolute paths are supported.

Specify a directory name (for example, `/experimental:log sarif_output\`) to output SARIF files for each source file to that directory, using the source file name as the base name for each SARIF file.

## Remarks

Expand All @@ -28,19 +31,16 @@ Diagnostics are also output as text to the console as usual.
### To set this compiler option in the Visual Studio development environment

1. Open the project's **Property Pages** dialog box. For details, see [Set C++ compiler and build properties in Visual Studio](../working-with-project-properties.md).

1. Select the specific project **Configuration** and **Platform** for which you want to change the property. You can also choose **"All Configurations"** and **"All Platforms"**.

1. Select the **Configuration Properties** > **C/C++** > **Command Line** property page.

1. Modify the **Additional Options** property, and then choose **OK**.

## Example

The following command produces SARIF information for the entire compilation in the `diags.sarif` file in the current directory:
The following command produces SARIF information for the entire compilation and saves it in the `sarif_output` directory in the files `main.sarif` and `other.sarif`:

```cmd
CL /experimental:logdiags main.cpp other.cpp
CL /experimental:log sarif_output\ main.cpp other.cpp
```

## See also
Expand Down