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. Multiple instances for QsLog
Forum Updated to NodeBB v4.3 + New Features

Multiple instances for QsLog

Scheduled Pinned Locked Moved Unsolved General and Desktop
3 Posts 2 Posters 1.1k Views 1 Watching
  • 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.
  • V Offline
    V Offline
    vsukhwal
    wrote on last edited by
    #1

    Hello,

    I am analyzing the QsLog feature for implementing logging facility in my Qt code. However, I do not understand how to create multiple logging files and log into them simultaneously. Can somebody please help me in this aspect?

    Thanks,
    Vidushi Sukhwal

    1 Reply Last reply
    0
    • mrjjM Offline
      mrjjM Offline
      mrjj
      Lifetime Qt Champion
      wrote on last edited by
      #2

      Hi
      This one ?
      https://bitbucket.org/codeimproved/qslog/overview

      I think files are called destinations

      Usage
      Directly including the QsLog source code in a project:
      Include QsLog.pri in your pro file
      Include QsLog.h in your C++ files. Include QsLogDest.h only where you create/add destinations.
      Get the instance of the logger by calling QsLogging::Logger::instance();
      Optionally set the logging level. Info is default.
      Create as many destinations as you want by using the QsLogging::DestinationFactory. <<<<< "file"
      Add the destinations to the logger instance by calling addDestination. <<<< "file"
      Start logging!

      http://qt.shoutwiki.com/wiki/Advanced,_cross-platform_logging_for_Qt
      Sample of the Destination stuff

      1 Reply Last reply
      1
      • V Offline
        V Offline
        vsukhwal
        wrote on last edited by
        #3

        Thank you for your reply. However, the problem is different. I would like to have two different destinations or log files in which I can write different log messages. For eg: I create two destinations A and B. I want QLOG_INFO<< "Hello A" to be added in A only and QLOG_INFO <<"Hello B" to be only added to B.

        In the current scenario, If two different destinations are added, then QLOG_INFO is added to both the destinations simultaneously.

        I

        1 Reply Last reply
        0

        • Login

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