EZLog
Loading...
Searching...
No Matches
Logger.h File Reference
#include <QDebug>
#include <QString>
#include <QSettings>
#include <QTextStream>
#include <QDateTime>
#include <iostream>
#include <memory>
#include <atomic>
#include <mutex>
#include <functional>

Go to the source code of this file.

Classes

class  EZLog::Lib
 logger lib More...
 
struct  EZLog::null_mutex
 null mutex More...
 
struct  EZLog::null_atomic< T >
 null atomic More...
 
class  EZLog::Logger
 logger class More...
 

Namespaces

namespace  spdlog
 spdlog forward declaration
 
namespace  EZLog
 EZlog namespace, avoiding naming conflicts.
 

Macros

#define LOGGER_EXPORT   __declspec(dllimport)
 
#define LOGGER_SINGLE_THREAD
 Single-thread optimization, if the program is single-threaded, it is recommended to enable it.
 
#define LOGGER_NO_DEBUG_OUTPUT
 Disable debug output.
 
#define LOG_INIT(name)   Logger::Initialize(#name)
 log initialization, must call before using the logging system (e.g. LogInit(MyProject))
 
#define TAKE_OVER_QDEBUG   Logger::InstallMessageHandler()
 Take over qDebug output.
 
#define lDebug   Logger::Debug().output
 Predefined macro that can output content in both the console and log files. Use this the same way you use qDebug (e.g. lDebug() << "something"; )
 
#define LogDebug   Logger::Debug()
 Predefined macro to use Logger::Debug method.
 
#define LogInfo   Logger::Info()
 Predefined macro to use Logger::Info method.
 
#define LogWarn   Logger::Warn()
 Predefined macro to use Logger::Warn method.
 
#define LogError   Logger::Error()
 Predefined macro to use Logger::Error method.
 
#define LogCritical   Logger::Critical()
 Predefined macro to use Logger::Critical method.
 

Typedefs

template<typename T >
using EZLog::Atomic = null_atomic< T >
 atomic type
 
using EZLog::Mutex = null_mutex
 mutex type
 

Variables

LOGGER_EXPORT std::mutex EZLog::real_mutex
 mutex of type std::mutex, used for synchronization in multi-threaded mode
 
LOGGER_EXPORT null_mutex EZLog::fake_mutex
 mutex of type null_mutex, used for simulating mutex operations in single-threaded mode
 

Macro Definition Documentation

◆ lDebug

#define lDebug   Logger::Debug().output

Predefined macro that can output content in both the console and log files. Use this the same way you use qDebug (e.g. lDebug() << "something"; )

◆ LOG_INIT

#define LOG_INIT (   name)    Logger::Initialize(#name)

log initialization, must call before using the logging system (e.g. LogInit(MyProject))

Parameters
nameproject name

◆ LogCritical

#define LogCritical   Logger::Critical()

Predefined macro to use Logger::Critical method.

◆ LogDebug

#define LogDebug   Logger::Debug()

Predefined macro to use Logger::Debug method.

◆ LogError

#define LogError   Logger::Error()

Predefined macro to use Logger::Error method.

◆ LOGGER_EXPORT

#define LOGGER_EXPORT   __declspec(dllimport)

◆ LOGGER_NO_DEBUG_OUTPUT

#define LOGGER_NO_DEBUG_OUTPUT

Disable debug output.

◆ LOGGER_SINGLE_THREAD

#define LOGGER_SINGLE_THREAD

Single-thread optimization, if the program is single-threaded, it is recommended to enable it.

◆ LogInfo

#define LogInfo   Logger::Info()

Predefined macro to use Logger::Info method.

◆ LogWarn

#define LogWarn   Logger::Warn()

Predefined macro to use Logger::Warn method.

◆ TAKE_OVER_QDEBUG

#define TAKE_OVER_QDEBUG   Logger::InstallMessageHandler()

Take over qDebug output.