ToolX 1.11.1 [e3f477f]
A GUI debug tool chain for diagnosing GVA systems
Loading...
Searching...
No Matches
logging.h File Reference

Process wide logging policy: quiet by default, verbose with -v, everything on stderr. More...

#include <QByteArray>
#include <QString>
#include <QtGlobal>
#include <atomic>
#include <cstdio>
#include <cstdlib>
#include <iostream>
Include dependency graph for logging.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Functions

std::atomic< bool > & toolx::logging::verboseFlag ()
 Storage for the verbose flag.
bool toolx::logging::isVerbose ()
 Is verbose output enabled (-v / –verbose).
void toolx::logging::messageHandler (QtMsgType type, const QMessageLogContext &, const QString &message)
 Qt message handler, writes to stderr only.
void toolx::logging::configure (bool verbose)
 Apply the logging policy, call once at start up before any library is initialised.
bool toolx::logging::verboseRequested (int argc, char *argv[])
 Is –verbose in the command line (-v prints the version instead).

Detailed Description

Process wide logging policy: quiet by default, verbose with -v, everything on stderr.

Function Documentation

◆ configure()

void toolx::logging::configure ( bool verbose)
inline

Apply the logging policy, call once at start up before any library is initialised.

Output of the application and of the libraries it uses (Qt, libva, MediaX) is quiet unless verbose is set. Anything that is written is written to stderr, stdout is left unused.

Parameters
verbosetrue to enable informational and debug output

◆ isVerbose()

bool toolx::logging::isVerbose ( )
inline

Is verbose output enabled (-v / –verbose).

Returns
true if verbose output was requested

◆ messageHandler()

void toolx::logging::messageHandler ( QtMsgType type,
const QMessageLogContext & ,
const QString & message )
inline

Qt message handler, writes to stderr only.

Debug, info and warning messages are dropped unless verbose output was requested. Critical and fatal messages (errors) are always written.

Parameters
typethe severity of the message
messagethe message text

◆ verboseFlag()

std::atomic< bool > & toolx::logging::verboseFlag ( )
inline

Storage for the verbose flag.

Returns
std::atomic<bool>& the flag

◆ verboseRequested()

bool toolx::logging::verboseRequested ( int argc,
char * argv[] )
inline

Is –verbose in the command line (-v prints the version instead).

Parameters
argcargument count
argvarguments
Returns
true if verbose output was requested