#ifndef I_LOG_H #define I_LOG_H // #include "VReturnCode.h" #include #include class ILog { public: /** * @brief Get the Instance object * Return reference for runing faster. Usage : ILog::GetInstance()->Init(); * Don't use ILog like this: * std::shared_ptr &log = ILog::GetInstance(); or std::shared_ptr log = ILog::GetInstance(); * log->Log("Your log."); * @param impl Change the instance. * @return std::shared_ptr& */ static std::shared_ptr &GetInstance(std::shared_ptr *impl = nullptr); ILog() = default; virtual ~ILog() = default; virtual bool Init() { return false; } virtual bool UnInit() { return false; } /** * @brief * If the Log module is working. * @return true * @return false */ virtual bool IsWorking() { return false; } /** * @brief * Virtual log function. * @param buff * @return int */ virtual int Log(const char *buff) { return 0; } virtual int InFo(const char *buff) { return 0; } virtual int Warning(const char *buff) { return 0; } virtual int Error(const char *buff) { return 0; } virtual int Trace(const char *buff) { return 0; } virtual int Debug(const char *buff) { return 0; } }; #endif