util: Log static plugins meta data and used style #72

pull hebasto wants to merge 1 commits into bitcoin-core:master from hebasto:200812-log changing 1 files +16 −0
  1. hebasto commented at 10:02 PM on August 24, 2020: member

    This PR is a follow-up of https://github.com/bitcoin/bitcoin/pull/17826, and adds additional info about the imported static plugins and the used style to the debug.log I found useful for testing (e.g., with QT_QPA_PLATFORM, QT_QPA_PLATFORMTHEME, QT_STYLE_OVERRIDE variables) and debugging issues (e.g., https://github.com/bitcoin/bitcoin/pull/19716#issuecomment-674052881).

    The excerpt from the log:

    2020-11-15T18:41:45Z [main] Bitcoin Core version v0.20.99.0-f0b933f78 (release build)
    2020-11-15T18:41:45Z [main] Qt 5.9.8 (static), plugin=xcb (static)
    2020-11-15T18:41:45Z [main] Static plugins:
    2020-11-15T18:41:45Z [main]  QXcbIntegrationPlugin, version 329992
    2020-11-15T18:41:45Z [main] Style: fusion / QFusionStyle
    ...
    
  2. hebasto commented at 10:03 PM on August 24, 2020: member
  3. fanquake commented at 2:11 AM on August 25, 2020: member

    Concept ACK

  4. MarcoFalke commented at 6:25 AM on August 25, 2020: contributor

    Concept ACK

  5. in src/qt/guiutil.cpp:917 in 528360ade9 outdated
     913 | @@ -912,6 +914,10 @@ void LogQtInfo()
     914 |      const std::string plugin_link{"dynamic"};
     915 |  #endif
     916 |      LogPrintf("Qt %s (%s), plugin=%s (%s)\n", qVersion(), qt_link, QGuiApplication::platformName().toStdString(), plugin_link);
     917 | +    for (const QStaticPlugin p : QPluginLoader::staticPlugins()) {
    


    promag commented at 11:20 AM on September 25, 2020:

    Could print "No static plugins" or something.


    promag commented at 11:21 AM on September 25, 2020:

    nit, use &?


    hebasto commented at 2:27 PM on September 27, 2020:

    Thanks! Updated.

  6. promag commented at 11:21 AM on September 25, 2020: contributor

    Code review ACK 528360ade9bb3f4902b632f6f755cf63b3397412.

    Tested but with brew qt 5.15.1, so no static plugins are listed.

  7. hebasto force-pushed on Sep 27, 2020
  8. hebasto commented at 2:27 PM on September 27, 2020: member

    Updated 528360ade9bb3f4902b632f6f755cf63b3397412 -> b5397ad1fbcb92eb244731aa60f07b33d55be797 (pr72.01 -> pr72.02, diff):

  9. in src/qt/guiutil.cpp:922 in b5397ad1fb outdated
     913 | @@ -912,6 +914,16 @@ void LogQtInfo()
     914 |      const std::string plugin_link{"dynamic"};
     915 |  #endif
     916 |      LogPrintf("Qt %s (%s), plugin=%s (%s)\n", qVersion(), qt_link, QGuiApplication::platformName().toStdString(), plugin_link);
     917 | +    const auto static_plugins = QPluginLoader::staticPlugins();
     918 | +    if (static_plugins.empty()) {
     919 | +        LogPrintf("No static plugins.\n");
     920 | +    } else {
     921 | +        for (const QStaticPlugin& p : static_plugins) {
     922 | +            LogPrintf("Static plugin: %s\n", QJsonDocument(p.metaData()).toJson(QJsonDocument::Compact).toStdString());
    


    promag commented at 9:14 AM on October 1, 2020:

    nit, could write "Static plugins:" just once before the loop.


    hebasto commented at 6:43 PM on October 1, 2020:

    Thanks! Updated.

  10. promag commented at 9:17 AM on October 1, 2020: contributor

    Code review ACK b5397ad1fbcb92eb244731aa60f07b33d55be797.

  11. hebasto force-pushed on Oct 1, 2020
  12. hebasto commented at 6:43 PM on October 1, 2020: member

    Updated b5397ad1fbcb92eb244731aa60f07b33d55be797 -> 052f3eb5a7909c198dbd478220cbda203ebf2714 (pr72.02 -> pr72.03, diff):

    nit, could write "Static plugins:" just once before the loop.

  13. hebasto closed this on Oct 25, 2020

  14. hebasto reopened this on Oct 25, 2020

  15. hebasto force-pushed on Oct 25, 2020
  16. hebasto commented at 3:12 PM on October 25, 2020: member

    Rebased 052f3eb5a7909c198dbd478220cbda203ebf2714 -> c45ecd3c4adf0de27f9429fec75d40c4a00276bc (pr72.03 -> pr72.04).

  17. in src/qt/guiutil.cpp:43 in c45ecd3c4a outdated
      39 | @@ -40,11 +40,13 @@
      40 |  #include <QFontDatabase>
      41 |  #include <QFontMetrics>
      42 |  #include <QGuiApplication>
      43 | +#include <QJsonDocument>
    


    laanwj commented at 10:54 PM on November 12, 2020:

    does this really need JSON document? we use it nowhere else, and is not really our log format anway


    promag commented at 11:05 PM on November 12, 2020:

    I guess we could just print QJsonObject QStaticPlugin::rawMetaData().


    hebasto commented at 6:08 PM on November 15, 2020:

    I guess we could just print QJsonObject QStaticPlugin::rawMetaData().

    It prints something like that:

    2020-11-15T18:02:40Z [main] Static plugins:
    2020-11-15T18:02:40Z [main]  QTMETADATA  qbjs\x01
    

    hebasto commented at 6:50 PM on November 15, 2020:
  18. laanwj commented at 10:55 PM on November 12, 2020: member

    Concept ACK but I don't really see the point of JSON here.

  19. hebasto force-pushed on Nov 15, 2020
  20. hebasto renamed this:
    util: Log static plugins
    util: Log static plugins meta data
    on Nov 15, 2020
  21. hebasto renamed this:
    util: Log static plugins meta data
    util: Log static plugins meta data and used style
    on Nov 15, 2020
  22. hebasto commented at 6:49 PM on November 15, 2020: member

    Updated c45ecd3c4adf0de27f9429fec75d40c4a00276bc -> f0b933f78d98a560394de5e09df8a6472433aa33 (pr72.04 -> pr72.05):

    • removed JSON from the log
    • rebased on top of the recent CI changes
  23. hebasto force-pushed on Nov 28, 2020
  24. util: Log static plugins meta data and style 957895c715
  25. hebasto force-pushed on Dec 23, 2020
  26. hebasto commented at 8:33 PM on December 23, 2020: member

    Rebased 5fffd6aa8853c3534f421c89006d98966c88fde9 -> 957895c715f86feaa26c806e5fa8ebb77430a926 (pr72.06 -> pr72.07) on top of the recent CI changes.

  27. jarolrod commented at 2:14 AM on January 19, 2021: member

    ACK 957895c715f86feaa26c806e5fa8ebb77430a926, Tested on macOS 11.1

    Since the OP Screenshot shows the case with static plugins, I tested the case without static plugins (only dynamic)

    <img width="524" alt="Screen Shot 2021-01-18 at 9 11 25 PM" src="https://user-images.githubusercontent.com/23396902/104979324-02ce2280-59d2-11eb-8392-2dd8f21e786f.png">

  28. jonasschnelli approved
  29. jonasschnelli commented at 9:14 AM on January 28, 2021: contributor

    utACK 957895c715f86feaa26c806e5fa8ebb77430a926

  30. jonasschnelli merged this on Jan 28, 2021
  31. jonasschnelli closed this on Jan 28, 2021

  32. hebasto deleted the branch on Jan 28, 2021
  33. sidhujag referenced this in commit 7310454603 on Jan 28, 2021
  34. laanwj commented at 5:34 PM on January 28, 2021: member

    Posthumous ACK

  35. DeckerSU referenced this in commit f5e45e959c on Nov 15, 2021
  36. TheComputerGenie referenced this in commit 4cce803da3 on Jan 5, 2022
  37. bitcoin-core locked this on Aug 16, 2022

github-metadata-mirror

This is a metadata mirror of the GitHub repository bitcoin-core/gui. This site is not affiliated with GitHub. Content is generated from a GitHub metadata backup.
generated: 2026-05-01 13:20 UTC

This site is hosted by @0xB10C
More mirrored repositories can be found on mirror.b10c.me