QuasarAppLib
QuasarAppUtils::QALogger Class Reference

The QALogger class is logger handler for app. This class allow to log all message from app to file. More...

#include <qalogger.h>

Collaboration diagram for QuasarAppUtils::QALogger:
Collaboration graph

Public Member Functions

 QALogger ()
 
 ~QALogger ()
 
void init ()
 init This method initialize logging of all qt message into file.
 

Static Public Member Functions

static QString getLogFilePath ()
 setVerboseLevel This method set verbose level of the logger.
 

Detailed Description

The QALogger class is logger handler for app. This class allow to log all message from app to file.

Example:

#include <qalogger.h>
QuasarAppUtils::Params::setEnable("fileLog", true); //force enable file writing using efault file location - located in localApplication data.
QuasarAppUtils::Params::parseParams(argc, argv);
logger.init();
The QALogger class is logger handler for app. This class allow to log all message from app to file.
Definition qalogger.h:46
void gen(int size, QByteArray &result)

Standart file log locations per platforms :

  • Windows: APPDATA%/OrganisationName/YourAppName/YourAppName.log
  • Linux: $HOME/.config/OrganisationName/YourAppName/YourAppName.log
  • Mac: $HOME/Library/Application Support/OrganisationName/YourAppName/YourAppName.log
  • Android: /data/data/com.organisationName.yourAppName/files/YourAppName.log
  • iOS: /var/mobile/Applications/Data/YourAppName/YourAppName.log

you can overiwite this location by setting "fileLog" option in Params.

Definition at line 45 of file qalogger.h.

Constructor & Destructor Documentation

◆ QALogger()

QuasarAppUtils::QALogger::QALogger ( )

Definition at line 31 of file qalogger.cpp.

◆ ~QALogger()

QuasarAppUtils::QALogger::~QALogger ( )

Definition at line 34 of file qalogger.cpp.

Member Function Documentation

◆ getLogFilePath()

QString QuasarAppUtils::QALogger::getLogFilePath ( )
static

setVerboseLevel This method set verbose level of the logger.

Parameters
lvlThis is new verbose level.

Definition at line 110 of file qalogger.cpp.

Here is the call graph for this function:

◆ init()

void QuasarAppUtils::QALogger::init ( )

init This method initialize logging of all qt message into file.

Note
This function should be invokae after parsing arguments. if you invoke this before parsing arguments, verbose level of logs will not created correct.

Definition at line 85 of file qalogger.cpp.

Here is the call graph for this function:

The documentation for this class was generated from the following files: