Verbosity Settings - Can someone demystify them?

In general, how do I specify verbose output without needing to run my task in the terminal each time?

This works in a terminal:

> pio test --verbose

But I can’t figure out how to get verbose output when running a task using the Ctrl-Alt-T approach.

In the documentation there is a force_verbose setting, but it’s not clear where this needs to be applied.

Is it an environment setting, a task setting or something else?

I have read these questions:
how-to-add-verbose-to-platformio-ini
where-is-verbose-option-on-build-specified

but they haven’t solved things.

I have tried this in my environment:

[env:native]
platform = native
test_filter = native
PLATFORMIO_SETTING_FORCE_VERBOSE = true

but I got the following:

Warning! Ignore unknown configuration option `platformio_setting_force_verbose` in section [env:native]

so obviously I’m not setting this in the correct place. And anyway, for me should ideally be settable by task, not in the environment.

I tried adding a verbosity flag to my task:

{
    "type": "PlatformIO",
    "task": "Test (native)",
    "problemMatcher": [
        "$platformio"
    ],
    "args": ["--verbose"],
    "group": "test",
    "label": "PlatformIO: Test (native)"
}

but a squiggly line and tooltip says Property args is not allowed.

I’m very new to PlatformIO and finding the number of ways to apply settings and configurations quite confusing. I’m fine with the concepts of environment variables, compiler options etc., I’m just not sure how those concepts map onto PlatformIO or VSCode.

Thanks in advance, any help is appreciated.

The link you’ve posted is inside the pio settings documentation. So it is explained there along with pio settings get and pio settings set CLI commands. Just execute pio settings set force_verbose true in a PIO terminal once to set verbosity globally.

1 Like

Ah, got it. OK, thanks, that’s understood now.

If there’s a way of avoiding the global setting and instead specifying the verbosity at task level, that would be great.

Is the documentation not right in PlatformIO IDE for VSCode — PlatformIO latest documentation? I’d try adding

{
    "version": "2.0.0",
    "tasks": [
        {
            "type": "shell",
            "command": "platformio",
            "args": [
                "test",
                "--verbose"
            ],
            "problemMatcher": [
                "$platformio"
            ],
            "label": "PlatformIO: Test (Verbose)"
        }
    ]
}

to the .vscode\tasks.json file (there’s got to be an array of tasks in there)

1 Like

Ah, thanks, that helped. I had to change shell to process and set the correct environment, but I now have a working task:

{
    "type": "process",
    "command": "platformio.exe",
    "args": [
        "test",
        "--verbose",
        "--environment=native"
    ],
    "problemMatcher": [
        "$platformio"
    ],
    "label": "PlatformIO: Test (Verbose)"
}

So I guess I should learn the different types of task next…