// Copyright (c) 2012 Ohyo net work. All rights reserved.
// 2012/01/04
// logging.h
//
//
#ifndef __INCLUDE_LOGGING_H__
#define __INCLUDE_LOGGING_H__
#include "str_conv.inl"
#include <iostream>
#include <sstream>
#include <string>
#include <cstring>
#include <fstream>
#ifdef _WIN32
# include <windows.h>
# include <shlobj.h>
# include <shlwapi.h>
#pragma comment(lib, "shlwapi.lib")
#else
# include <locale.h>
# include <string.h>
#endif
#ifndef BEGIN_NAMESPACE
# define BEGIN_NAMESPACE(x) namespace x {
#endif
#ifndef END_NAMESPACE
# define END_NAMESPACE(x) }
#endif
#ifndef DISALLOW_COPY_AND_ASSIGN
# define DISALLOW_COPY_AND_ASSIGN(TypeName) \
TypeName(const TypeName&); \
void operator=(const TypeName&)
#endif
BEGIN_NAMESPACE(logging)
enum LOG_LEVEL {
LOG_NONE = 0,
LOG_DEBUG = 1 << 0,
LOG_INFO = 1 << 1,
LOG_WARNING = 1 << 2,
LOG_ERROR = 1 << 3,
LOG_EXCEPTION = 1 << 4,
_LOG_ALL_ = 0xFFFFFFFF
};
#if defined(_DEBUG)
__declspec(selectany) volatile unsigned long g_dwLogLevel = static_cast<unsigned long>(_LOG_ALL_);
#else
// release版本 不记录任何信息.
__declspec(selectany) volatile unsig
C++日志记录类logging
最新推荐文章于 2022-11-26 16:40:06 发布
![](https://img-home.csdnimg.cn/images/20240711042549.png)