dotnet / vscode-csharp

Official C# support for Visual Studio Code
MIT License
2.86k stars 671 forks source link

The Debug Window's dotnet core output is overwhelming. Please make configurable. #1154

Closed JerryNixon closed 7 years ago

JerryNixon commented 7 years ago

Do I want all this output in the debug window? Yes, sometimes. But most of the time - which means 99% of the time - it's crazy overwhelming and meaningless. It would be ideal if I could dial down the volume of output unless I need it to debug something. Could this be configurable?

image

gregg-miskelly commented 7 years ago

@JerryNixon There actually are configuration nobs already. In launch.json, see the various logging options.

JerryNixon commented 7 years ago

Are there, @gregg-miskelly? Please, help me understand.

{
    "version": "0.2.0",
    "configurations": [
        {
            "name": ".NET Core Launch (console)",
            "type": "coreclr",
            "request": "launch",
            "preLaunchTask": "build",
            "program": "${workspaceRoot}\\bin\\Debug\\netcoreapp1.0\\test.dll",
            "args": [],
            "cwd": "${workspaceRoot}",
            "externalConsole": false,
            "stopAtEntry": false,
            "internalConsoleOptions": "openOnSessionStart"
        },
        {
            "name": ".NET Core Attach",
            "type": "coreclr",
            "request": "attach",
            "processId": "${command.pickProcess}"
        }
    ]
}
gregg-miskelly commented 7 years ago

Yes, example:

...
            "internalConsoleOptions": "openOnSessionStart",
            "logging": {
                "moduleLoad": false
            }

Let us know if you want more nobs.

JerryNixon commented 7 years ago

Ah, okay with these settings (just repeating in case another developer finds this thread):

{
    "version": "0.2.0",
    "configurations": [
        {
            "name": ".NET Core Launch (console)",
            "type": "coreclr",
            "request": "launch",
            "preLaunchTask": "build",
            "program": "${workspaceRoot}\\bin\\Debug\\netcoreapp1.0\\test.dll",
            "args": [],
            "cwd": "${workspaceRoot}",
            "externalConsole": false,
            "stopAtEntry": false,
            "internalConsoleOptions": "openOnSessionStart",
            "logging":
            {
                "moduleLoad": false, 
            }
        },
        {
            "name": ".NET Core Attach",
            "type": "coreclr",
            "request": "attach",
            "processId": "${command.pickProcess}"
        }
    ]
}

The output is simply:

--------------------------------------------------------------------------------
You may only use the Microsoft .NET Core Debugger (clrdbg) with Visual Studio
Code, Visual Studio or Visual Studio for Mac software to help you develop and
test your applications.
--------------------------------------------------------------------------------
Hello World!
The program 'c:\TEMP\test\bin\Debug\netcoreapp1.0\test.dll' has exited with code 0 (0x00000000).

Which is so much better. It turns out the feature that is already built-in is very sufficient. Before I close this issue, one last question. Is there a nob to hide that You may only... preamble?

JerryNixon commented 7 years ago

I wonder why this isn't the default. I mean that seriously.

gregg-miskelly commented 7 years ago

@JerryNixon because when things go wrong you will never figure out why if you turn that off :)

gregg-miskelly commented 7 years ago

@JerryNixon sorry, missed your question about the preamble - no, we don't have an option for that.

lbovet commented 6 years ago

Why is this preamble useful for? Is there only @JerryNixon and me thinking it should not be there?

dgadelha commented 6 years ago

In case someone's looking how to hide this preamble, you need to edit vsdbg.dll at %USERPROFILE%\.vscode\extensions\ms-vscode.csharp-1.14.0\.debugger with a HEX editor and replace this message.

My vsdbg.dll's hash is 4b82f8051f1f4c9692fb29804df8835c (MD5) / 1b16b52c3a3079e2e875e8a1a7c4890e220f21ac (SHA1) and the message starts at 0x00091F40 and ends at 0x0009207A. Just replace it with NULs (00).

My modified DLL is attached here in case someone needs. vsdbg.zip

langheran commented 5 years ago

https://github.com/OmniSharp/omnisharp-vscode/blob/master/debugger-launchjson.md

eviathan commented 4 years ago

The preamble is really irritating and a terrible place to put it. If it's just legalese to placate legal then they should put it somewhere that doesn't impede on productivity.

Having anything except application output in your debug console is just tacky.

Also its semi nonsensical/ tautological ... what else are we going to use the .NET Core Debugger for .. I mean we are literally using it to test our applications in that piece of software when we get told we are only supposed to be using it to do just that.

Part of the reason it's so irritating is its stupidity.