mirror of
https://github.com/amnezia-vpn/amnezia-client.git
synced 2026-12-04 06:01:26 +09:00
* feat: split app/tunnel log streams and add in-app log viewer * fix: report real save result on android * remove dead logging code & open qt log on start, stop ne logging on auto-off, pin log date locale * drop dead share api and simplify logs ui components * add ru strings for logs redesign
31 lines
905 B
C++
31 lines
905 B
C++
#ifndef LOGSCONTROLLER_H
|
|
#define LOGSCONTROLLER_H
|
|
|
|
#include <QByteArray>
|
|
#include <QList>
|
|
#include <QPair>
|
|
#include <QString>
|
|
#include <QStringList>
|
|
|
|
class LogsController
|
|
{
|
|
public:
|
|
enum class Stream { App, Tunnel };
|
|
|
|
static QStringList files(Stream stream);
|
|
static qint64 size(Stream stream);
|
|
static qint64 fileSize(const QString &path);
|
|
static QString readTail(Stream stream, qint64 *newestFileEnd = nullptr, qint64 maxBytes = 512 * 1024);
|
|
static QByteArray readAll(Stream stream);
|
|
static void clear(Stream stream);
|
|
static QByteArray zipAll();
|
|
static QByteArray zipFiles(const QList<QPair<QString, QByteArray>> &entries);
|
|
|
|
static QByteArray tailOfFiles(const QStringList &paths, qint64 maxBytes, qint64 *newestFileEnd = nullptr);
|
|
|
|
private:
|
|
static QByteArray read(Stream stream, qint64 maxBytes, qint64 *newestFileEnd = nullptr);
|
|
};
|
|
|
|
#endif // LOGSCONTROLLER_H
|