提交 d6ede8b3 编写于 作者: E Enrico Giordani

Moved RedisLog.* to Win32_Interop and renamed to Win32_RedisLog.*

Deleted unused file msvs/RedisLog.h
上级 13f36c88
/*
* Copyright (c), Microsoft Open Technologies, Inc.
* All rights reserved.
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions are met:
* - Redistributions of source code must retain the above copyright notice,
* this list of conditions and the following disclaimer.
* - Redistributions in binary form must reproduce the above copyright notice,
* this list of conditions and the following disclaimer in the documentation
* and/or other materials provided with the distribution.
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
* AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
* DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
* FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
* DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
* SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
* CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
* OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
#pragma once
/* Log levels */
#define REDIS_DEBUG 0
#define REDIS_VERBOSE 1
#define REDIS_NOTICE 2
#define REDIS_WARNING 3
#define REDIS_LOG_RAW (1<<10) /* Modifier to log without timestamp */
#define REDIS_MAX_LOGMSG_LEN 1024 /* Default maximum length of syslog messages */
void redisLog(int level, const char *fmt, ...);
void redisLogRaw(int level, const char *msg);
void redisLogFromHandler(int level, const char *msg);
void SetVerbosity(int verbosity);
\ No newline at end of file
...@@ -32,7 +32,7 @@ ...@@ -32,7 +32,7 @@
#include "Win32_ANSI.h" #include "Win32_ANSI.h"
#include "win32_util.h" #include "win32_util.h"
#include <string> #include <string>
#include "..\redisLog.h" #include "Win32_RedisLog.h"
using namespace std; using namespace std;
#define CATCH_AND_REPORT() catch(const std::exception &){::redisLog(REDIS_WARNING, "FDAPI: std exception");}catch(...){::redisLog(REDIS_WARNING, "FDAPI: other exception");} #define CATCH_AND_REPORT() catch(const std::exception &){::redisLog(REDIS_WARNING, "FDAPI: std exception");}catch(...){::redisLog(REDIS_WARNING, "FDAPI: other exception");}
......
...@@ -19,7 +19,6 @@ ...@@ -19,7 +19,6 @@
</ProjectConfiguration> </ProjectConfiguration>
</ItemGroup> </ItemGroup>
<ItemGroup> <ItemGroup>
<ClCompile Include="..\RedisLog.c" />
<ClCompile Include="win32fixes.c" /> <ClCompile Include="win32fixes.c" />
<ClCompile Include="Win32_ANSI.c" /> <ClCompile Include="Win32_ANSI.c" />
<ClCompile Include="Win32_CommandLine.cpp" /> <ClCompile Include="Win32_CommandLine.cpp" />
...@@ -29,6 +28,7 @@ ...@@ -29,6 +28,7 @@
<ClCompile Include="Win32_fdapi_crt.cpp" /> <ClCompile Include="Win32_fdapi_crt.cpp" />
<ClCompile Include="Win32_QFork.cpp" /> <ClCompile Include="Win32_QFork.cpp" />
<ClCompile Include="Win32_QFork_impl.c" /> <ClCompile Include="Win32_QFork_impl.c" />
<ClCompile Include="Win32_RedisLog.c" />
<ClCompile Include="win32_rfdmap.cpp" /> <ClCompile Include="win32_rfdmap.cpp" />
<ClCompile Include="Win32_service.cpp" /> <ClCompile Include="Win32_service.cpp" />
<ClCompile Include="win32_util.c" /> <ClCompile Include="win32_util.c" />
...@@ -36,7 +36,6 @@ ...@@ -36,7 +36,6 @@
<ClCompile Include="win32_wsiocp.c" /> <ClCompile Include="win32_wsiocp.c" />
</ItemGroup> </ItemGroup>
<ItemGroup> <ItemGroup>
<ClInclude Include="..\redisLog.h" />
<ClInclude Include="win32fixes.h" /> <ClInclude Include="win32fixes.h" />
<ClInclude Include="Win32_ANSI.h" /> <ClInclude Include="Win32_ANSI.h" />
<ClInclude Include="Win32_CommandLine.h" /> <ClInclude Include="Win32_CommandLine.h" />
...@@ -46,9 +45,11 @@ ...@@ -46,9 +45,11 @@
<ClInclude Include="Win32_fdapi_crt.h" /> <ClInclude Include="Win32_fdapi_crt.h" />
<ClInclude Include="Win32_QFork.h" /> <ClInclude Include="Win32_QFork.h" />
<ClInclude Include="Win32_QFork_impl.h" /> <ClInclude Include="Win32_QFork_impl.h" />
<ClInclude Include="Win32_RedisLog.h" />
<ClInclude Include="win32_rfdmap.h" /> <ClInclude Include="win32_rfdmap.h" />
<ClInclude Include="Win32_Service.h" /> <ClInclude Include="Win32_Service.h" />
<ClInclude Include="Win32_SmartHandle.h" /> <ClInclude Include="Win32_SmartHandle.h" />
<ClInclude Include="win32_types.h" />
<ClInclude Include="win32_util.h" /> <ClInclude Include="win32_util.h" />
<ClInclude Include="Win32_variadicFunctor.h" /> <ClInclude Include="Win32_variadicFunctor.h" />
<ClInclude Include="win32_winapifamily.h" /> <ClInclude Include="win32_winapifamily.h" />
...@@ -150,8 +151,7 @@ link.exe -dll -noentry resources/EventLog.res -out:$(TargetDir)EventLog.dll ...@@ -150,8 +151,7 @@ link.exe -dll -noentry resources/EventLog.res -out:$(TargetDir)EventLog.dll
</Link> </Link>
<Lib> <Lib>
<IgnoreSpecificDefaultLibraries>MSVCRT</IgnoreSpecificDefaultLibraries> <IgnoreSpecificDefaultLibraries>MSVCRT</IgnoreSpecificDefaultLibraries>
<AdditionalDependencies> <AdditionalDependencies>DbgHelp.lib;%(AdditionalDependencies)</AdditionalDependencies>
</AdditionalDependencies>
</Lib> </Lib>
</ItemDefinitionGroup> </ItemDefinitionGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'"> <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
...@@ -198,8 +198,7 @@ link.exe -dll -noentry resources/EventLog.res -out:$(TargetDir)EventLog.dll ...@@ -198,8 +198,7 @@ link.exe -dll -noentry resources/EventLog.res -out:$(TargetDir)EventLog.dll
<OptimizeReferences>true</OptimizeReferences> <OptimizeReferences>true</OptimizeReferences>
</Link> </Link>
<Lib> <Lib>
<AdditionalDependencies> <AdditionalDependencies>DbgHelp.lib;%(AdditionalDependencies)</AdditionalDependencies>
</AdditionalDependencies>
</Lib> </Lib>
</ItemDefinitionGroup> </ItemDefinitionGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'"> <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
......
...@@ -21,7 +21,6 @@ ...@@ -21,7 +21,6 @@
*/ */
#include "win32_types.h" #include "win32_types.h"
#include "Win32_FDAPI.h" #include "Win32_FDAPI.h"
#include <Windows.h> #include <Windows.h>
...@@ -42,7 +41,7 @@ ...@@ -42,7 +41,7 @@
#include "Win32_SmartHandle.h" #include "Win32_SmartHandle.h"
#include "Win32_Service.h" #include "Win32_Service.h"
#include "Win32_CommandLine.h" #include "Win32_CommandLine.h"
#include "..\redisLog.h" #include "Win32_RedisLog.h"
#include <vector> #include <vector>
#include <map> #include <map>
......
...@@ -20,16 +20,16 @@ ...@@ -20,16 +20,16 @@
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/ */
#include "win32_Interop/win32_types.h" #include "Win32_types.h"
#include "redisLog.h" #include "Win32_RedisLog.h"
#include <stdio.h> #include <stdio.h>
#include <stdarg.h> #include <stdarg.h>
#include <malloc.h> #include <malloc.h>
#include <string.h> #include <string.h>
#include <process.h> #include <process.h>
#include "redis.h" #include "../redis.h"
#include "win32_Interop/win32Fixes.h" #include "Win32Fixes.h"
#include "win32_Interop/Win32_EventLog.h" #include "Win32_EventLog.h"
#include <time.h> #include <time.h>
#include <assert.h> #include <assert.h>
......
...@@ -68,7 +68,7 @@ this should preceed the other arguments passed to redis. For instance: ...@@ -68,7 +68,7 @@ this should preceed the other arguments passed to redis. For instance:
#include <sstream> #include <sstream>
#include <vector> #include <vector>
#include <iostream> #include <iostream>
#include "..\redisLog.h" #include "Win32_RedisLog.h"
#include "Win32_CommandLine.h" #include "Win32_CommandLine.h"
using namespace std; using namespace std;
......
...@@ -41,7 +41,6 @@ ...@@ -41,7 +41,6 @@
#ifdef _WIN32 #ifdef _WIN32
#include <locale.h> #include <locale.h>
#define LOG_LOCAL0 0 #define LOG_LOCAL0 0
#include "redisLog.h"
#else #else
#include <sys/wait.h> #include <sys/wait.h>
#include <arpa/inet.h> #include <arpa/inet.h>
......
...@@ -73,7 +73,7 @@ typedef PORT_LONGLONG mstime_t; /* millisecond time type. */ ...@@ -73,7 +73,7 @@ typedef PORT_LONGLONG mstime_t; /* millisecond time type. */
#include "latency.h" /* Latency monitor API */ #include "latency.h" /* Latency monitor API */
#include "sparkline.h" /* ASII graphs API */ #include "sparkline.h" /* ASII graphs API */
#include "redisLog.h" /* moved logging for hiredis and RedisCli usage /* #include "Win32_Interop/Win32_RedisLog.h" /* moved logging for hiredis and RedisCli usage /*
/* Error codes */ /* Error codes */
#define REDIS_OK 0 #define REDIS_OK 0
...@@ -94,7 +94,7 @@ typedef PORT_LONGLONG mstime_t; /* millisecond time type. */ ...@@ -94,7 +94,7 @@ typedef PORT_LONGLONG mstime_t; /* millisecond time type. */
#define REDIS_SHARED_INTEGERS 10000 #define REDIS_SHARED_INTEGERS 10000
#define REDIS_SHARED_BULKHDR_LEN 32 #define REDIS_SHARED_BULKHDR_LEN 32
#ifdef _WIN32 #ifdef _WIN32
// see redisLog.h // see Win32_RedisLog.h
#else #else
#define REDIS_MAX_LOGMSG_LEN 1024 /* Default maximum length of syslog messages */ #define REDIS_MAX_LOGMSG_LEN 1024 /* Default maximum length of syslog messages */
#endif #endif
...@@ -307,7 +307,7 @@ typedef PORT_LONGLONG mstime_t; /* millisecond time type. */ ...@@ -307,7 +307,7 @@ typedef PORT_LONGLONG mstime_t; /* millisecond time type. */
#define REDIS_SORTKEY_MAX 1024 #define REDIS_SORTKEY_MAX 1024
#ifdef _WIN32 #ifdef _WIN32
// see redisLog.h // see Win32_RedisLog.h
#else #else
/* Log levels */ /* Log levels */
#define REDIS_DEBUG 0 #define REDIS_DEBUG 0
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册