2018-01-30 22:18:48 +03:00
|
|
|
#ifndef LOG_H
|
|
|
|
#define LOG_H
|
|
|
|
|
|
|
|
#include <QFile>
|
|
|
|
#include <QTextStream>
|
|
|
|
#include <QDateTime>
|
2018-08-19 19:16:21 +03:00
|
|
|
#include "sync_global.h"
|
2018-01-30 22:18:48 +03:00
|
|
|
|
2018-08-19 19:16:21 +03:00
|
|
|
enum SYNCSHARED_EXPORT LogType{ERROR, WARNING, INFORMATION, NONE};
|
2018-01-30 22:18:48 +03:00
|
|
|
|
2018-08-19 19:16:21 +03:00
|
|
|
class SYNCSHARED_EXPORT Log
|
2018-01-30 22:18:48 +03:00
|
|
|
{
|
|
|
|
public:
|
|
|
|
explicit Log(const QString &fileName);
|
|
|
|
~Log();
|
|
|
|
void setShowDateTime(bool value);
|
2018-01-31 17:11:05 +03:00
|
|
|
void write(const QString &value, LogType logType = NONE);
|
2018-01-30 22:18:48 +03:00
|
|
|
|
|
|
|
private:
|
|
|
|
QFile *file;
|
|
|
|
bool m_showDate;
|
|
|
|
|
|
|
|
};
|
|
|
|
|
|
|
|
#endif // LOG_H
|