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

54 lines
902 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
namespace TSysLog
{
TFARMAPI void success(const QString &msg);
TFARMAPI void warning(const QString &msg);
TFARMAPI void error(const QString &msg);
TFARMAPI void info(const QString &msg);
}
//------------------------------------------------------------------------------
class TFARMAPI TUserLog
{
public:
TUserLog(); // used to redirect log messages to the console
TUserLog(const TFilePath &fp);
~TUserLog();
void warning(const QString &msg);
void error(const QString &msg);
void info(const QString &msg);
private:
class Imp;
2016-04-14 22:15:09 +12:00
std::unique_ptr<Imp> m_imp;
2016-03-19 06:57:51 +13:00
};
#endif