<!DOCTYPE html>
<html>
  <head>

    <meta http-equiv="content-type" content="text/html; charset=UTF-8">
  </head>
  <body>
    <p>Hi</p>
    <p>I'm trying to obtain debug output from qgis-server from the
      release-nighly repo (currently testing with <span
        style="font-family:monospace"><span
          style="color:#000000;background-color:#ffffff;">1:3.44.6+git20260114+3cbba756601+40noble),
          which according to [1] is compiled as a debug build (so as I
          understand should have #define QGISDEBUG?).</span></span></p>
    <p><span style="font-family:monospace"><span
          style="color:#000000;background-color:#ffffff;">I wrote a
          small plugin which does<br>
          <br>
          QgsMessageLog.logMessage("QGIS_DEBUG: %s" %
          os.environ.get('QGIS_DEBUG', '<unset>'), 'Server Plugin
          "</span></span><span style="font-family:monospace"><span
          style="color:#000000;background-color:#ffffff;"></span></span><span
        style="font-family:monospace"><span
          style="color:#000000;background-color:#ffffff;">DebugTest</span></span><span
        style="font-family:monospace"><span
          style="color:#000000;background-color:#ffffff;"></span></span><span
        style="font-family:monospace"><span
          style="color:#000000;background-color:#ffffff;">"', Qgis.Info)</span></span><span
        style="font-family:monospace"><span
          style="color:#000000;background-color:#ffffff;"><br>
          QgsMessageLog.logMessage("Level: %d" % QgsLogger.debugLevel(),
          'Server Plugin "</span></span><span
        style="font-family:monospace"><span
          style="color:#000000;background-color:#ffffff;">DebugTest</span></span><span
        style="font-family:monospace"><span
          style="color:#000000;background-color:#ffffff;">"', Qgis.Info)<br>
          QgsLogger.debug("This is a debug message", 0, "debug.py",
          "onRequestReady", 18)</span></span></p>
    <p><span style="font-family:monospace"><span
          style="color:#000000;background-color:#ffffff;">and then call
          the qgis server as<br>
          <br>
        </span></span>
      <span style="font-family:monospace"><span
          style="color:#000000;background-color:#ffffff;">QGIS_SERVER_LOG_FILE=$PWD/qgis_server.log
          QGIS_LOG_FILE=$PWD/qgis.log QGIS_PROJECT_FILE=$PWD/test.qgs
          QUERY_STRING="SERVICE=WMS&REQUEST=GetCapabilities"
          /usr/lib/cgi-bin/qgis_mapserv.fcgi</span></span></p>
    <p><span style="font-family:monospace">The relevant output is in
        qgis_server.log</span></p>
    <p><span style="font-family:monospace">13:52:41 INFO Server Plugin "</span><span
        style="font-family:monospace"><span
          style="color:#000000;background-color:#ffffff;"></span></span><span
        style="font-family:monospace"><span
          style="color:#000000;background-color:#ffffff;">DebugTest</span></span><span
        style="font-family:monospace"><span
          style="color:#000000;background-color:#ffffff;"></span></span><span
        style="font-family:monospace">"[558]: QGIS_DEBUG: <unset><br>
        13:52:41 INFO Server Plugin "</span><span
        style="font-family:monospace"><span
          style="color:#000000;background-color:#ffffff;"></span></span><span
        style="font-family:monospace"><span
          style="color:#000000;background-color:#ffffff;">DebugTest</span></span><span
        style="font-family:monospace"><span
          style="color:#000000;background-color:#ffffff;"></span></span><span
        style="font-family:monospace">"[558]: Level: 0</span></p>
    <p><span style="font-family:monospace">while qgis.log is empty. If I
        manually set QGIS_DEBUG=1, qgis.log will contain<br>
        <br>
        debug.py:18 : (onRequestReady) [3ms] This is a debug message</span></p>
    <p><span style="font-family:monospace">So it looks like the
        release-nighly builds are in fact not compiled with QGISDEBUG,
        and all QgsDebug macros [2] are compiled as stubs? Are the build
        logs of the release-nighly repo visible somewhere?</span></p>
    <p><span style="font-family:monospace">Thanks!<br>
        Sandro</span></p>
    <p>[1] <a class="moz-txt-link-freetext" href="https://qgis.org/resources/installation-guide/#debian--ubuntu">https://qgis.org/resources/installation-guide/#debian--ubuntu</a><br>
      [2]
<a class="moz-txt-link-freetext" href="https://github.com/qgis/QGIS/blob/fb066c580586d9a01aeec95276a279a2adb686ad/src/core/qgslogger.h#L32">https://github.com/qgis/QGIS/blob/fb066c580586d9a01aeec95276a279a2adb686ad/src/core/qgslogger.h#L32</a></p>
  </body>
</html>