Logger::setDebugOutputLevel not obeyed.

We are using photon realtime C++ sdk.

I have noticed in release builds even though I am calling Logger.setDebugOutputLevel(ExitGames::Common::DebugLevel::WARNINGS) I am still seeing lots of INFO level logging, coming from calls to Logger::log(...).

Is this a bug?

Comments

  • Hi @Dismiss.

    Logger::setDebugOutputLevel() sets the DebugLevel on the particular Logger instance on which it gets called. The logs that you are seeing are probably coming from another Logger instance than the one on which you have adjusted the DebugLevel.

    The DebugLevel for the Logger instance that is used by the Client class can be set by a call to Client::setDebugOutputLevel() and the one that is used by classes in the Common namespace can be set by a call to Base::setDebugOutputLevel()

    The following code snippet is from the constructor of class NetworkLogic in demo_loadBalancing, which is located inside the 'Demos' folder in the Client SDK:
    mLoadBalancingClient.setDebugOutputLevel(DEBUG_RELEASE(ExitGames::Common::DebugLevel::INFO, ExitGames::Common::DebugLevel::WARNINGS)); // that instance of LoadBalancingClient and its implementation details
    	mLogger.setListener(*this);
    	mLogger.setDebugOutputLevel(DEBUG_RELEASE(ExitGames::Common::DebugLevel::INFO, ExitGames::Common::DebugLevel::WARNINGS)); // this class
    	ExitGames::Common::Base::setListener(this);
    	ExitGames::Common::Base::setDebugOutputLevel(DEBUG_RELEASE(ExitGames::Common::DebugLevel::INFO, ExitGames::Common::DebugLevel::WARNINGS)); // all classes that inherit from Base
    
    As you can see, the demo sets the DebugLevel on 3 different Logger instances:
    1. On the instance that is used by class Client
    2. On the instance, that class NetworkLogic is using itself
    3. On the instance that is used by the classes in the Common namespace

    Only for 2) the demo has direct access to the Logger instance and can set the logging level directly on that class. In cases 1) and 3) the access needs to be done through the according wrapper functions that are part of the APIs of class Client and class Base.
Sign In or Register to comment.