This example shows you the available functions in order to enable and control logging fo the C++ DLL. In default setup there is no logging active.

Enable Logging

If you want to make use of logging, please set up before using any of the other QR Invoice functions.

In order to enable logging you will need to provide a log file name.

#include <qrinvoice/logging.hpp>

// ...

// log file gets immediately created

// if you want the log file to only be created when needed, us the "lazy logger"

// set the desired minimum log level
// valid values: "trace", "debug", "info", "warning", "error", "critical", "off"

Control Flushing

Flushing is done whenever suitable. If you need to control or force flushing, the following is possible.

#include <qrinvoice/logging.hpp>

// ...

// flush occurs when error log events are encountered

// manual flush

Shutdown Logging

Logging can be terminated using the shutdown call. It makes sure threads are stopped and file is flushed and closed.

#include <qrinvoice/logging.hpp>

// ...