BoltEngine / Bolt-Tracker

New issue tracker for Photon Bolt
10 stars 2 forks source link

Removing all bolt logging from settings doesn't work #108

Closed DirtyHippy00 closed 5 years ago

DirtyHippy00 commented 5 years ago

This is being reported by a few users. Keep in mind that I can't repro it since I use a forked version of the source from a little while back. However, I did look at the newest source code for triage, and it seems pretty clear to me what the issue is. I feel a bit uncomfortable reporting this issue without reproing it first, but I'm fairly confident it is a regression.

If you clear all bolt log settings (expecting to either not log at all or to add your own bolt log writer), bolt will in BoltCore:

    BoltLog.RemoveAll();
    BoltLog.Setup(_mode, _config.logTargets);

    // tell user we're starting
    BoltLog.Debug("Bolt starting with a simulation rate of {0} steps per second", _config.framesPerSecond);

This: A) Removes all bolt log writers B) Adds any bolt log writers specified in settings (so if nothing in settings, the number of writers will be 0). C) Then it logs the simulation rate. BoltLog.Debug will call

        VerifyOneWriter();

which does:

    if (_writers.Count == 0)
    {
        _writers.Add(new UnityWriter());
    }

This was commented out in my older version of the source (where this works correctly as I use my own logging implementation and have everything turned off in bolt). So basically, this ensures there is always a unity log writer no matter what you do.

herpdederp commented 5 years ago

https://github.com/BoltEngine/bolt-internal/commit/293808db684b82151137432e899fb03caa6b5a36

ramonmelo commented 5 years ago

Fixed on the next release.