Uploaded image for project: 'Qbs ("Cubes")'
  1. Qbs ("Cubes")
  2. QBS-1791

Improve logging for module developers

    XMLWordPrintable

Details

    • Task
    • Resolution: Unresolved
    • Not Evaluated
    • None
    • 2.0
    • API: JavaScript
    • None

    Description

      As an occasional developer of Qbs modules, I often struggle to make my module work. It's not even clear whether it runs any code at all. This forces me to add logs everywhere: I put logging in the Rule.prepare script, I initialize Rule.inputs with a block of code instead a simple list literal, etc. And yet, it is not enough.

      I also try to use Qbs in verbose mode, but its output is very messy and barely readable by non-Qbs developer.

      There are log messages with a certain log category like

      qbs.exec: finishNode adds leaf ARTIFACT /Users/gooroo/Work/Projects/Personal/playdate-first/default/the-second.5bfb0f3e/libthe-second.dylib.dSYM [the-second] Buildable
      qbs.exec: finishNode adds leaf ARTIFACT /Users/gooroo/Work/Projects/Personal/playdate-first/default/the-second.5bfb0f3e/libthe-second.dylib.dSYM/Contents/Info.plist [the-second] Buildable
      qbs.exec: RULE [bundle.input,codesign.signed_artifact,debuginfo_bundle,debuginfo_dll,debuginfo_plist,dynamiclibrary,dynamiclibrary_import,dynamiclibrary_symbols,dynamiclibrary_symlink][dynamiclibrary_import,dynamiclibrary_symbols,linkerscript,obj,res,staticlibrary,versionscript] [the-second] located at /opt/homebrew/Cellar/qbs/2.3.1/share/qbs/modules/cpp/GenericGCC.qbs:469:18
      qbs.exec: node already built. Skipping.
      

      There are other messages without any log category (these are the messages that are logged in normal mode too):

      linking libthe-second.dylib [the-second]
      generating dSYM for the-second [the-second]
      

      There are some messages with no log category, but formatted differently (they seem to be messages from JS code, both from modules provides by Qbs and from modules written by a user):

      DEBUG: [require] importing file /opt/homebrew/Cellar/qbs/2.3.1/share/qbs/imports/qbs/PathTools/path-tools.js
      DEBUG: [require] loading extension qbs.Process
      DEBUG: [require] loading extension qbs.TextFile
      DEBUG: [require] loading extension qbs.UnixUtils
      DEBUG: [require] importing file /opt/homebrew/Cellar/qbs/2.3.1/share/qbs/imports/qbs/UnixUtils/unix-utils.js
      DEBUG: [require] loading extension qbs.Utilities
      DEBUG: [require] loading extension qbs.WindowsUtils
      DEBUG: [require] importing file /opt/homebrew/Cellar/qbs/2.3.1/share/qbs/imports/qbs/WindowsUtils/windows-utils.js
      DEBUG: Symbol file '/Users/gooroo/Work/Projects/Personal/playdate-first/default/the-second.5bfb0f3e/.sosymbols/libthe-second.dylib' does not yet exist.
      

      There are some multiline messages:

      qbs.buildgraph: consider rule node [playdate.native-interim][dynamiclibrary]
              changed: []
              compatible: [/Users/gooroo/Work/Projects/Personal/playdate-first/default/the-second.5bfb0f3e/libthe-second.dylib]
              added: [/Users/gooroo/Work/Projects/Personal/playdate-first/default/the-second.5bfb0f3e/libthe-second.dylib]
              removed: []
      

      And all these kinds of messages are mixed up. This makes it very difficult to read and to parse.


      What [I think] I need:

      1. Some intermediate log level that would contain only information useful for me as a developer of modules for Qbs (and not a developer of Qbs itself).
      2. Some eaiser to comprehend way to see what is going on: what files are tagged with which tags, which rules are run and why, how the artifacts and rules are connected, etc.
      3. Some easy way to filter logs by categories? (without the need to touch QT_LOGGING_RULES or something)
      4. It also would be great to have an option to output logs in JSONL format.

      Attachments

        No reviews matched the request. Check your Options in the drop-down menu of this sections header.

        Activity

          People

            kandeler Christian Kandeler
            gooroo Serhii Olendarenko
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

              Created:
              Updated:

              Gerrit Reviews

                There are no open Gerrit changes