foxssake / netfox

Addons for building multiplayer games with Godot

Home Page:https://foxssake.github.io/netfox/

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Possibility to choose log level and what to log

Ughuuu opened this issue · comments

Right now in the package there are a lot of prints happening(eg. during connection, etc). Would be cool if there would be a way to only log errors or info logs.

The option could also be a project setting.

A good idea and something I've considered during development! I ended up rejecting it because I didn't want to ship a logging library as part of netfox, and didn't want to introduce external dependencies.

But the concern is valid, and I think a minimal implementation is OK. Will get back to it with a PR.

You can just have a static function and an int/enum. You would have to duplicate the function tho and the enums sadly for each lib.

Hey @Ughuuu,
I've created #162 for this. I ended up creating a "netfox.internals" addon for shared under-the-hood tidbits used by all modules. This for now includes logging, but there's one or two things I can move there in the future.

Pros:

  • No code duplication
  • Logging configurable per addon ( i.e. no logging from extras, only debug from noray, etc. ):
    image

Cons:

  • One extra addon to install per netfox project

Technically, the extra addon shouldn't be much of an issue, since the asset library should handle it well, but let me know what you think.

My only concern would be what happens if you update an add-on, how would you version the other directory. I would search to see if there are other cases where they have dependencies like this, maybe you can add a plugin cfg file to version also the internals?

Yeah, I didn't describe that part in too much detail.

The "netfox.internals" addon will be included with all netfox addons. This means that no matter which addon you install, you'll have the dependency.

For updates, netfox is versioned in lockstep ( if one addon version is updated, all of them are updated ), so it is advisable to always have all your netfox addons on the same version. If you update any part of netfox, you will update the internals by extension, and should update the other addons as well.