Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. General and Desktop
  4. Local qMessageHandled and message pattern

Local qMessageHandled and message pattern

Scheduled Pinned Locked Moved Unsolved General and Desktop
2 Posts 2 Posters 362 Views
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • D Offline
    D Offline
    debian
    wrote on last edited by
    #1

    Hello!
    I use Qt-5.12.6, can I set independent qMessageHandler and/or message pattern for different part of application, e.g. plugin will use message pattern %{time yyyyMMdd h:mm:ss.zzz} %{catery}, but application - {%file} %{function} %{line}?
    Thank you.

    JonBJ 1 Reply Last reply
    0
    • D debian

      Hello!
      I use Qt-5.12.6, can I set independent qMessageHandler and/or message pattern for different part of application, e.g. plugin will use message pattern %{time yyyyMMdd h:mm:ss.zzz} %{catery}, but application - {%file} %{function} %{line}?
      Thank you.

      JonBJ Online
      JonBJ Online
      JonB
      wrote on last edited by
      #2

      @debian
      I don't think so, as there is only one globally-installed message handler:
      https://doc.qt.io/qt-5/qtglobal.html#qInstallMessageHandler

      Only one message handler can be defined, since this is usually done on an application-wide basis to control debug output.

      You would need something in code in your handler which could (somehow) distinguish where you are being called from in code. Which is liable to be difficult....

      1 Reply Last reply
      1

      • Login

      • Login or register to search.
      • First post
        Last post
      0
      • Categories
      • Recent
      • Tags
      • Popular
      • Users
      • Groups
      • Search
      • Get Qt Extensions
      • Unsolved