Skip to content

MessageType should include a 'trace' severity #2117

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

Open
jasonmalinowski opened this issue Mar 19, 2025 · 5 comments
Open

MessageType should include a 'trace' severity #2117

jasonmalinowski opened this issue Mar 19, 2025 · 5 comments
Labels
feature-request Request for new features or functionality show message
Milestone

Comments

@jasonmalinowski
Copy link
Member

jasonmalinowski commented Mar 19, 2025

MessageType (as of 3.18) is defined as:

export namespace MessageType {
	/**
	 * An error message.
	 */
	export const Error = 1;
	/**
	 * A warning message.
	 */
	export const Warning = 2;
	/**
	 * An information message.
	 */
	export const Info = 3;
	/**
	 * A log message.
	 */
	export const Log = 4;
	/**
	 * A debug message.
	 *
	 * @since 3.18.0
	 */
	export const Debug = 5;
}

export type MessageType = 1 | 2 | 3 | 4 | 5;

The "debug" addition is handy, but it'd be great if one more level, 'trace' was also added. VS Code's newish support for logging output window has a distinction of debug versus trace:

Image

And .NET's logging library similarly has a debug vs. trace distinction in this enum:
https://learn.microsoft.com/en-us/dotnet/api/microsoft.extensions.logging.loglevel?view=net-9.0-pp

As it stands, for us to report 'trace' events with the standard logging API, we're mapping those back to 'debug' which is slightly confusing when we're comparing logs from other sources. Given both sides have a 'trace' concept it'd be nice if we could just use it.

As we discovered, the generic 'log' message type doesn't really mean trace, but rather it has no severity, and it gets logged by the VS Code LSP client without any severity tag at all.

@puremourning
Copy link

Sounds like a vs code issue not a spec issue.

@dbaeumer
Copy link
Member

It is both. VS Code for the implementation side. But if we want to support it we need a spec addition as well.

@dbaeumer dbaeumer added feature-request Request for new features or functionality show message labels Mar 19, 2025
@dbaeumer dbaeumer added this to the On Deck milestone Mar 19, 2025
@puremourning
Copy link

I mean that the Log level should map to 'trace' no?

-> As we discovered, the generic 'log' message type doesn't really mean trace, but rather it has no severity, and it gets logged by the VS Code LSP client without any severity tag at all.

@jasonmalinowski
Copy link
Member Author

@puremourning This absolutely could be interpreted as a VS Code implementation issue, but if that was the case the spec doesn't really give any hint that Debug should be considered a severity between "info" and "log". And it'd also be a very breaking interpretation to consider log to be the lowest severity, since a client filtering out things based on severity would then filter out the messages that previously were conceptually a higher severity.

@dbaeumer
Copy link
Member

I mean that the Log level should map to 'trace' no?

Now that I think about this I think that might be a good approach. We could also add to the spec that Log === trace in terms of semantic.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
feature-request Request for new features or functionality show message
Projects
None yet
Development

No branches or pull requests

3 participants