Skip to content

swiftc dump ast without any swiftc logging #83660

@max-leuthaeuser

Description

@max-leuthaeuser

Using the -dump-ast -dump-ast-format json flags logs all stdout/stderr from the compiler.

E.g.,

/usr/bin/swiftc -module-name SwiftHelloWorld <other-args-omitted> -dump-ast -dump-ast-format json

may result in:

{ // full json omitted }
error messages
...
 #7 0x00007ff68b556ebe (.../Swift/Toolchains/6.1.2+Asserts/usr/bin/swift-frontend.exe+0x2046ebe)
...

warning messages
{ // another full json omitted }{ // another full json omitted }
...

Is there any swiftc flag to clean the output and actually only receive the json strings if any?
Piping the output (1>, 2>) does not help as many log messages are still intertwined with the actual json output.

Metadata

Metadata

Assignees

No one assigned

    Labels

    FrontendArea → compiler: FrontendcompilerThe Swift compiler itself

    Type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions