Skip to content
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

Add option to suppress console output #74

Open
2shady4u opened this issue Feb 9, 2021 · 2 comments
Open

Add option to suppress console output #74

2shady4u opened this issue Feb 9, 2021 · 2 comments
Labels
enhancement New feature or request good first issue Good for newcomers

Comments

@2shady4u
Copy link
Contributor

2shady4u commented Feb 9, 2021

Currently my Godot console gets drowned in output from the myriad of plugins and other nonsense I'm running for my game.
For most of them, there's some way to suppress it, but for the current implementation for the FMOD plugin there's no such thing.

Thus it would be nice to have a user-controlled option to enable/disable console logging.
This can be as simplistic/easy as this:

#define GODOT_LOG(level, message)\
    switch (level) {\
        case 0:\
            if (verbose_mode){\
            Godot::print(message);}\
            break;\
        case 1:\
            Godot::print_warning(message, BOOST_CURRENT_FUNCTION, __FILE__, __LINE__);\
            break;\
        case 2:\
            Godot::print_error(message, BOOST_CURRENT_FUNCTION, __FILE__, __LINE__);\
            break;\
    }\

With verbose_mode being a public variable that can be toggled from inside of Godot.

Probably there a lot of other ways to do this and I'm sure you guys already have something in mind 😄

@piiertho piiertho added enhancement New feature or request good first issue Good for newcomers labels Feb 9, 2021
@CedNaru
Copy link
Member

CedNaru commented Feb 9, 2021

The best would be to tied that to the -quiet or -verbose setting of Godot instead of having a variable specially made for this addon. But I don't think I have much of a choice in that matter with GDnative. I need to check that to be sure.
Otherwise having a verbose property like you suggested might be the solution.

@2shady4u
Copy link
Contributor Author

2shady4u commented Feb 9, 2021

The best would be to tied that to the -quiet or -verbose setting of Godot instead of having a variable specially made for this addon. But I don't think I have much of a choice in that matter with GDnative. I need to check that to be sure.
Otherwise having a verbose property like you suggested might be the solution.

Well the advantage would be that I can enable/disable output independently for FMOD. Since there are times when I do want to see the console output, while at other moments I don't care about it 🤔 🤷

Here's a relevant method:
https://docs.godotengine.org/en/stable/classes/class_os.html#class-os-method-is-stdout-verbose

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request good first issue Good for newcomers
Projects
None yet
Development

No branches or pull requests

3 participants