tahoma2d/toonz/sources/toonzfarm/include/tlog.h

52 lines
911 B
C
Raw Normal View History

2016-05-17 03:04:11 +12:00
#pragma once
2016-03-19 06:57:51 +13:00
#ifndef TSYSLOG_H
#define TSYSLOG_H
2016-04-14 22:15:09 +12:00
#include <memory>
2016-03-19 06:57:51 +13:00
#include "tcommon.h"
#include <QString>
class TFilePath;
#ifdef TFARMAPI
#undef TFARMAPI
#endif
2016-04-15 17:11:23 +12:00
#ifdef _WIN32
2016-03-19 06:57:51 +13:00
#ifdef TFARM_EXPORTS
#define TFARMAPI __declspec(dllexport)
#else
#define TFARMAPI __declspec(dllimport)
#endif
#else
#define TFARMAPI
#endif
2016-06-15 18:43:10 +12:00
namespace TSysLog {
2016-03-19 06:57:51 +13:00
TFARMAPI void success(const QString &msg);
TFARMAPI void warning(const QString &msg);
TFARMAPI void error(const QString &msg);
TFARMAPI void info(const QString &msg);
}
//------------------------------------------------------------------------------
2016-06-15 18:43:10 +12:00
class TFARMAPI TUserLog {
2016-03-19 06:57:51 +13:00
public:
2016-06-15 18:43:10 +12:00
TUserLog(); // used to redirect log messages to the console
TUserLog(const TFilePath &fp);
~TUserLog();
2016-03-19 06:57:51 +13:00
2016-06-15 18:43:10 +12:00
void warning(const QString &msg);
void error(const QString &msg);
void info(const QString &msg);
2016-03-19 06:57:51 +13:00
private:
2016-06-15 18:43:10 +12:00
class Imp;
std::unique_ptr<Imp> m_imp;
2016-03-19 06:57:51 +13:00
};
#endif