needle-tools/needle-console

Ability to filter by [Channel]

AldeRoberge opened this issue · 7 comments

It would be great to be able to filter like this :

        Debug.Log($"[Setup] Setting current setup to {setupInfo.Type.Name}.");

And then in the editor console :

image

marwie commented

Hello @AldeRoberge have you tried writing a custom filter?

See for example https://github.com/needle-tools/needle-console/blob/main/package/Editor/CustomConsole/Filters/LineFilter.cs

and I think you have to register it yourself:

public static void AddFilter(IConsoleFilter filter)

here is how builtin filters are registered:

messageFilter = new MessageFilter(ref messages);

@marwie
Pinging this since I can't seem to find the "Channels" dropdown - where is it? I'm on latest UPM package.
I have the same use case as OP.

marwie commented

The channels dropdown is something the OP asked about but it's not a feature of the console here
See my previous response - you can try adding it as a custom filter in your own code

Actually, the ConsoleFilterPreset might be what I was looking for. Too bad this isn't apparent in the readme.

This way we can quickly share package or namespace filters across our whole team, although it's a bit sad you have to "capture" the logs in the editor before you can filter them instead of just defining them up front.
Guess I could look into adding that feature myself.

marwie commented

Yes and feel free to make a PR and/or update the readme if you think information is missing or could be more clear