#ifndef __LOG_WRAPPER_H__
#define __LOG_WRAPPER_H__
#include <plog/Log.h>
#include <napi.h>
#include <iostream>
#include "codecommon.h"


Napi::Value napi_NativeAddonLog(const Napi::CallbackInfo& info);
Napi::Value napi_GetNativeAddonLogConfig(const Napi::CallbackInfo& info);


const unsigned int LOGINSTANCE = 22; // Any unused, non-zero value should do.

#define INFO_TRACE          LOG_INFO_(LOGINSTANCE)
#define WARNING_TRACE       LOG_WARNING_(LOGINSTANCE)
#define ERROR_TRACE         LOG_ERROR_(LOGINSTANCE)
#define VERBOSE_TRACE       LOG_VERBOSE_(LOGINSTANCE)

class LogWrapper
{
    DECLARE_SINGLETON_CLASS(LogWrapper)

public:
    void Config();
    void Trace(const plog::Severity& objSeverity, const std::string& str);
    void SetConfigLogPath(const std::string& strPath)
    {
        m_strConfigLogPath = strPath;
    }
    std::string GetConfigLogPath()
    {
        return m_strConfigLogPath;
    }

private:
    std::string     m_strConfigLogPath;
};
#define _LogWrapper GET_SINGLETON_INSTANCE(LogWrapper)

#endif // __LOG_WRAPPER_H__
