maxon::Loggers::PythonConsole



  • If I understand the manual correctly, the python logger is defined as maxon::Loggers::PythonConsole.

    Built-In Loggers
    All existing loggers are registered at maxon::Loggers. These three loggers can be obtained from these published objects:
    
    maxon::Loggers::Default: The default logger.
    maxon::Loggers::PythonConsole: The Python logger.
    maxon::Loggers::ProcessConsole: The IDE console logger.
    

    So I guess I just have to change below the Default logger to the Python logger, to get all messages.
    However, the namespace does not have a Python logger?

    //const maxon::LoggerRef defaultLogger = maxon::Loggers::Default();
    const maxon::LoggerRef pythonLogger = maxon::Loggers::PythonConsole();
    

    -Pim



  • maxon::Loggers::Get(Id("net.maxon.logger.python"))
    

    should get you the python logger.


  • Global Moderator

    Hi Pim,

    indeed our LoggerInterface manual is already outdated in this regard. Sorry, for the inconvenience, will be fixed in the next release of the documentation.

    You need to access the logger for the Python Console via it's ID. It's defined in the python.framework in cpython.h: ID_LOGGER_PYTHON (equal to "net.maxon.logger.python").

    Edit: Sorry, I didn't see the answer from @mp5gosu before posting. It's correct.

    So long,
    Andreas



  • Great, thank you.