You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

36 lines
747 B

#ifndef LOGMANAGER_H
#define LOGMANAGER_H
#include "Singleton.h"
//#include <spdlog/spdlog.h>
#include <QDebug>
#include <QSharedPointer>
#define LOG_DEBUG qDebug()
#define LOG_INFO qInfo()
#define LOG_WARN qWarning()
#define LOG_ERROR qCritical()
#define LOG_PANIC qFatal()
class LogManager : public Singleton<LogManager>
{
public:
LogManager();
/**
* @brief init 日志初始化
* @param filename 日志名称
*/
void init(const QString &filename);
private:
// QSharedPointer<spdlog::logger> _logger;
public:
static void messageHandler(QtMsgType type,
const QMessageLogContext &context,
const QString &msg);
};
#endif // LOGMANAGER_H