LoggingHandler Class

class QInstaller::LoggingHandler

The LoggingHandler class provides methods for manipulating the application-wide verbosiveness and format of printed debug messages. More...

Header: #include <LoggingHandler>

Public Types

enum VerbosityLevel { Silent, Normal, Detailed, Minimum, Maximum }

Public Functions

bool isVerbose() const
void messageHandler(QtMsgType type, const QMessageLogContext &context, const QString &msg)
bool outputRedirected() const
void printComponentInfo(const QList<QInstaller::Component *> components) const
void printLocalPackageInformation(const QList<KDUpdater::LocalPackage> &packages) const
void printPackageInformation(const QInstaller::PackagesList &matchedPackages, const QInstaller::LocalPackagesHash &installedPackages) const
void setVerbose(bool v)
QInstaller::LoggingHandler::VerbosityLevel verboseLevel() const

Static Public Members

QInstaller::LoggingHandler &instance()

Detailed Description

The class also contains utility methods for printing common preformatted messages.

Member Type Documentation

enum LoggingHandler::VerbosityLevel

This enum holds the possible levels of output verbosity.

ConstantValueDescription
QInstaller::LoggingHandler::Silent0 
QInstaller::LoggingHandler::Normal1 
QInstaller::LoggingHandler::Detailed2 
QInstaller::LoggingHandler::MinimumSilentMinimum possible verbosity level. Synonym for VerbosityLevel::Silent.
QInstaller::LoggingHandler::MaximumDetailedMaximum possible verbosity level. Synonym for VerbosityLevel::Detailed.

Member Function Documentation

[static] QInstaller::LoggingHandler &LoggingHandler::instance()

Returns the only instance of this class.

bool LoggingHandler::isVerbose() const

Returns true if the installer is set to verbose output.

void LoggingHandler::messageHandler(QtMsgType type, const QMessageLogContext &context, const QString &msg)

Prints out preformatted debug messages, warnings, critical and fatal error messages specified by msg and type. The message context provides information about the source code location the message was generated.

bool LoggingHandler::outputRedirected() const

Returns true if output is redirected, i.e. to a file.

void LoggingHandler::printComponentInfo(const QList<QInstaller::Component *> components) const

Prints basic information about components.

void LoggingHandler::printLocalPackageInformation(const QList<KDUpdater::LocalPackage> &packages) const

Prints basic or more detailed information about local packages, depending on the current verbosity level.

void LoggingHandler::printPackageInformation(const QInstaller::PackagesList &matchedPackages, const QInstaller::LocalPackagesHash &installedPackages) const

Prints basic or more detailed information about available matchedPackages, depending on the current verbosity level. If a package is also present in installedPackages, the installed version will be included in printed information.

void LoggingHandler::setVerbose(bool v)

Sets to verbose output if v is set to true. Calling this multiple times increases or decreases the verbosity level accordingly.

See also isVerbose().

QInstaller::LoggingHandler::VerbosityLevel LoggingHandler::verboseLevel() const

Returns the current verbosity level.

© 2021 The Qt Company Ltd. Documentation contributions included herein are the copyrights of their respective owners. The documentation provided herein is licensed under the terms of the GNU Free Documentation License version 1.3 as published by the Free Software Foundation. The Qt Company, Qt and their respective logos are trademarks of The Qt Company Ltd in Finland and/or other countries worldwide. All other trademarks are property of their respective owners.