12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849 |
- #include "Log.h"
- #include <QCoreApplication>
- #include <QThread>
- Log::Log(QObject *parent) :
- QObject(parent)
- {
- QString configPath = QCoreApplication::applicationDirPath() + "/log4j.properties";
- Log4Qt::PropertyConfigurator::configure(configPath);
- }
- Log::~Log()
- {
- }
- Log* Log::instance()
- {
- static Log log;
- return &log;
- }
- void Log::debug(const QString &log)
- {
- logger()->debug(log);
- }
- void Log::info(const QString &log)
- {
- logger()->info(log);
- }
- void Log::warn(const QString &log)
- {
- logger()->warn(log);
- }
- void Log::error(const QString &log)
- {
- logger()->error(log);
- }
- void Log::fatal(const QString &log)
- {
- logger()->fatal(log);
- }
|