Forráskód Böngészése

LogMessage中不发送Log_Debug消息,减少消息。
解决LogEvent时间过长问题。

80374463 6 éve
szülő
commit
181f2c9175
6 módosított fájl, 266 hozzáadás és 333 törlés
  1. 4 0
      .gitignore
  2. 12 12
      libtoolkit/log.c
  3. 22 22
      spbase/SpBase.cpp
  4. 226 226
      spbase/SpBase.vcxproj
  5. 1 1
      spbase/sp_dbg.cpp
  6. 1 72
      spshell/log.cpp

+ 4 - 0
.gitignore

@@ -3,3 +3,7 @@
 ################################################################################
 
 /libtoolkit/libtoolkit.vcxproj.user
+/RVCComm/RVCComm.vcxproj.user
+/spbase/SpBase.vcxproj.user
+/sphost/SpHost.vcxproj.user
+/spshell/SpShell.vcxproj.user

+ 12 - 12
libtoolkit/log.c

@@ -20,18 +20,18 @@ TOOLKIT_API int xlog_init2(const char *inifile, const char *sections);
 TOOLKIT_API int xlog_set_level(const char* inst, int level);
 TOOLKIT_API int xlog_get_level(const char* inst, int *level);
 TOOLKIT_API int xlog_log_f(const char *inst, int level, const char *fmt, ...);
-#define XLOG_TRACE(inst, fmt, ...)	\
-	xlog_log_f(inst, XLOG_LEVEL_TRACE, fmt, __VA_ARGS__)
-#define XLOG_DEBUG(inst, fmt, ...)	\
-	xlog_log_f(inst, XLOG_LEVEL_DEBUG, fmt, __VA_ARGS__)
-#define XLOG_INFO(inst, fmt, ...)	\
-	xlog_log_f(inst, XLOG_LEVEL_INFO, fmt, __VA_ARGS__)
-#define XLOG_WARN(inst, fmt, ...)	\
-	xlog_log_f(inst, XLOG_LEVEL_WARN, fmt, __VA_ARGS__)
-#define XLOG_ERROR(inst, fmt, ...)	\
-	xlog_log_f(inst, XLOG_LEVEL_ERROR, fmt, __VA_ARGS__)
-#define XLOG_FATAL(inst, fmt, ...)	\
-	xlog_log_f(inst, XLOG_LEVEL_FATAL, fmt, __VA_ARGS__)
+// #define XLOG_TRACE(inst, fmt, ...)	\
+// 	xlog_log_f(inst, XLOG_LEVEL_TRACE, fmt, __VA_ARGS__)
+// #define XLOG_DEBUG(inst, fmt, ...)	\
+// 	xlog_log_f(inst, XLOG_LEVEL_DEBUG, fmt, __VA_ARGS__)
+// #define XLOG_INFO(inst, fmt, ...)	\
+// 	xlog_log_f(inst, XLOG_LEVEL_INFO, fmt, __VA_ARGS__)
+// #define XLOG_WARN(inst, fmt, ...)	\
+// 	xlog_log_f(inst, XLOG_LEVEL_WARN, fmt, __VA_ARGS__)
+// #define XLOG_ERROR(inst, fmt, ...)	\
+// 	xlog_log_f(inst, XLOG_LEVEL_ERROR, fmt, __VA_ARGS__)
+// #define XLOG_FATAL(inst, fmt, ...)	\
+// 	xlog_log_f(inst, XLOG_LEVEL_FATAL, fmt, __VA_ARGS__)
 
 static char *find_best_config()
 {

+ 22 - 22
spbase/SpBase.cpp

@@ -177,29 +177,29 @@ extern "C" SPBASE_API void vDbg(const char *str, va_list list)
 
 
 	SpModule *pModule = GetSpModule();
-	sp_dbg_debug("Debug: {%s}", buf);
+	sp_dbg_debug("Debug: {%s}", buf);	//打印到文件
 	
-	if (pModule)
-	{
-		__try
-		{
-			SpEntity *pEntity = (SpEntity*)(getEntityResource()->m_Entity);
-
-			if (pEntity != NULL)
-			{
-				auto pEntCfg = pEntity->get_cfg_ent();
-				if (pEntCfg != NULL && pEntCfg->debug_level > 0)
-				{
-					pEntity->LogMessage(Log_Debug, Severity_None, -1, -1, buf);
-				}
-			}
-		}
-		__finally
-		{
-
-		}
-		
-	}
+	//修改,不发出Log_Debug类消息
+// 	if (pModule)
+// 	{
+// 		__try
+// 		{
+// 			SpEntity *pEntity = (SpEntity*)(getEntityResource()->m_Entity);
+// 
+// 			if (pEntity != NULL)
+// 			{
+// 				auto pEntCfg = pEntity->get_cfg_ent();
+// 				if (pEntCfg != NULL && pEntCfg->debug_level > 0)
+// 				{
+// 					pEntity->LogMessage(Log_Debug, Severity_None, -1, -1, buf);
+// 				}
+// 			}
+// 		}
+// 		__finally
+// 		{
+// 
+// 		}
+// 	}
 }
 
 static bool RegistMain(HMODULE hModule,EntryRoutine Main, EntryRoutine Exit)

+ 226 - 226
spbase/SpBase.vcxproj

@@ -1,227 +1,227 @@
-<?xml version="1.0" encoding="utf-8"?>
-<Project DefaultTargets="Build" ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
-  <ItemGroup Label="ProjectConfigurations">
-    <ProjectConfiguration Include="Debug|Win32">
-      <Configuration>Debug</Configuration>
-      <Platform>Win32</Platform>
-    </ProjectConfiguration>
-    <ProjectConfiguration Include="Release|Win32">
-      <Configuration>Release</Configuration>
-      <Platform>Win32</Platform>
-    </ProjectConfiguration>
-  </ItemGroup>
-  <PropertyGroup Label="Globals">
-    <ProjectGuid>{C52D8054-7A8C-4A0E-82B2-2DB2779582AE}</ProjectGuid>
-    <Keyword>Win32Proj</Keyword>
-    <RootNamespace>spbase</RootNamespace>
-  </PropertyGroup>
-  <Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" />
-  <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" Label="Configuration">
-    <ConfigurationType>DynamicLibrary</ConfigurationType>
-    <UseDebugLibraries>true</UseDebugLibraries>
-    <CharacterSet>MultiByte</CharacterSet>
-    <PlatformToolset>Windows7.1SDK</PlatformToolset>
-  </PropertyGroup>
-  <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" Label="Configuration">
-    <ConfigurationType>DynamicLibrary</ConfigurationType>
-    <UseDebugLibraries>false</UseDebugLibraries>
-    <CharacterSet>MultiByte</CharacterSet>
-    <PlatformToolset>Windows7.1SDK</PlatformToolset>
-  </PropertyGroup>
-  <Import Project="$(VCTargetsPath)\Microsoft.Cpp.props" />
-  <ImportGroup Label="ExtensionSettings">
-  </ImportGroup>
-  <ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
-    <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
-    <Import Project="..\..\ver.props" />
-    <Import Project="..\out.props" />
-  </ImportGroup>
-  <ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
-    <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
-    <Import Project="..\..\ver.props" />
-    <Import Project="..\out.props" />
-  </ImportGroup>
-  <PropertyGroup Label="UserMacros" />
-  <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
-    <LinkIncremental>true</LinkIncremental>
-    <IntDir>$(SolutionDir)Temp\$(ProjectName)\</IntDir>
-    <LibraryPath>$(LibraryPath)</LibraryPath>
-    <OutDir>..\..\..\..\..\..\Run\version\3.1.0.0\bin</OutDir>
-  </PropertyGroup>
-  <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
-    <IntDir>$(SolutionDir)Temp\$(ProjectName)\</IntDir>
-    <LinkIncremental>false</LinkIncremental>
-    <LibraryPath>D:\工作\加密锁\1.9.3\LR04_ThirdParty_应用库\LR04_ThirdParty_Release\Release;D:\Run\version\1.9.4.0\bin;$(LibraryPath)</LibraryPath>
-  </PropertyGroup>
-  <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
-    <ClCompile>
-      <PrecompiledHeader>
-      </PrecompiledHeader>
-      <WarningLevel>Level3</WarningLevel>
-      <Optimization>Disabled</Optimization>
-      <PreprocessorDefinitions>WIN32;_DEBUG;_WINDOWS;_USRDLL;SPBASE_EXPORTS;SCEW_DLL;%(PreprocessorDefinitions)</PreprocessorDefinitions>
-      <AdditionalIncludeDirectories>..\common;..\libtoolkit;..\..\ThirdParty\scew-1.1.3\scew\;..\..\ThirdParty\Expat-2.1.0\Source\lib;..\..\..\..\LR04_ThirdParty_应用库\LR04_ThirdParty_Release\Include\scew-1.1.3\scew;..\..\..\..\LR04_ThirdParty_应用库\LR04_ThirdParty_Release\Include\Expat-2.1.0\Source\lib</AdditionalIncludeDirectories>
-      <ExceptionHandling>Sync</ExceptionHandling>
-    </ClCompile>
-    <Link>
-      <SubSystem>Windows</SubSystem>
-      <GenerateDebugInformation>true</GenerateDebugInformation>
-      <AdditionalDependencies>psapi.lib;imagehlp.lib;ws2_32.lib;libscew.lib;libtoolkit.lib;%(AdditionalDependencies)</AdditionalDependencies>
-      <AdditionalLibraryDirectories>C:\Run\version\2.2.0.1\bin;..\..\..\..\LR04_ThirdParty_应用库\LR04_ThirdParty_Release\Release;</AdditionalLibraryDirectories>
-      <OutputFile>$(OutDir)$(TargetName)$(TargetExt)</OutputFile>
-    </Link>
-    <PostBuildEvent>
-      <Command>
-      </Command>
-      <Message>
-      </Message>
-    </PostBuildEvent>
-    <PreBuildEvent>
-      <Command>
-      </Command>
-    </PreBuildEvent>
-  </ItemDefinitionGroup>
-  <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
-    <ClCompile>
-      <WarningLevel>Level3</WarningLevel>
-      <PrecompiledHeader>
-      </PrecompiledHeader>
-      <Optimization>MaxSpeed</Optimization>
-      <PreprocessorDefinitions>WIN32;NDEBUG;_WINDOWS;_USRDLL;SPBASE_EXPORTS;SCEW_DLL;%(PreprocessorDefinitions)</PreprocessorDefinitions>
-      <AdditionalIncludeDirectories>..\common;..\libtoolkit;..\..\ThirdParty\scew-1.1.3\scew\;..\..\ThirdParty\Expat-2.1.0\Source\lib</AdditionalIncludeDirectories>
-      <InlineFunctionExpansion>
-      </InlineFunctionExpansion>
-      <BasicRuntimeChecks>
-      </BasicRuntimeChecks>
-      <RuntimeLibrary>MultiThreadedDLL</RuntimeLibrary>
-    </ClCompile>
-    <Link>
-      <SubSystem>Windows</SubSystem>
-      <EnableCOMDATFolding>true</EnableCOMDATFolding>
-      <OptimizeReferences>true</OptimizeReferences>
-      <AdditionalDependencies>ws2_32.lib;libscew.lib;libtoolkit.lib;%(AdditionalDependencies)</AdditionalDependencies>
-      <AdditionalLibraryDirectories>D:\Source\RVC\RVCProject\Release\version\1.0.0.1\bin;..\..\ThirdParty\scew-1.1.3\win32\lib</AdditionalLibraryDirectories>
-      <LinkTimeCodeGeneration>
-      </LinkTimeCodeGeneration>
-      <GenerateDebugInformation>false</GenerateDebugInformation>
-    </Link>
-  </ItemDefinitionGroup>
-  <ItemGroup>
-    <ClCompile Include="..\Common\stdafx.cpp" />
-    <ClCompile Include="Console.cpp" />
-    <ClCompile Include="PadMisc.cpp" />
-    <ClCompile Include="SpAsyncWait.cpp" />
-    <ClCompile Include="SpBase.cpp" />
-    <ClCompile Include="SpBaseRoutine.cpp" />
-    <ClCompile Include="SpBinaryPersistStream.cpp" />
-    <ClCompile Include="SpClientSessionFunction.cpp" />
-    <ClCompile Include="SpEntity.cpp" />
-    <ClCompile Include="SpEntityPrivilege.cpp" />
-    <ClCompile Include="SpFSM.cpp" />
-    <ClCompile Include="SpHelper.cpp" />
-    <ClCompile Include="SpMisc.cpp" />
-    <ClCompile Include="SpModule.cpp" />
-    <ClCompile Include="SpSecureClient.cpp" />
-    <ClCompile Include="SpServerSessionFunction.cpp" />
-    <ClCompile Include="spShareMemoryBase.cpp" />
-    <ClCompile Include="SpTimer.cpp" />
-    <ClCompile Include="SpTransactionContext.cpp" />
-    <ClCompile Include="SpXmlPersistStream.cpp" />
-    <ClCompile Include="CodeSignVerify.cpp" />
-    <ClCompile Include="sp_bcm.c" />
-    <ClCompile Include="sp_btr.c" />
-    <ClCompile Include="sp_cfg.cpp" />
-    <ClCompile Include="sp_checkEntity.cpp" />
-    <ClCompile Include="sp_dbg.cpp" />
-    <ClCompile Include="sp_dir.c" />
-    <ClCompile Include="sp_env.c" />
-    <ClCompile Include="sp_groupProcess.cpp" />
-    <ClCompile Include="sp_gui.cpp" />
-    <ClCompile Include="sp_hcc.c" />
-    <ClCompile Include="sp_iom.c" />
-    <ClCompile Include="sp_log.c" />
-    <ClCompile Include="sp_mod.c" />
-    <ClCompile Include="sp_pst.c" />
-    <ClCompile Include="sp_rpc.c" />
-    <ClCompile Include="sp_rsn.c" />
-    <ClCompile Include="sp_ses.c" />
-    <ClCompile Include="sp_shm.c" />
-    <ClCompile Include="sp_sps.c" />
-    <ClCompile Include="sp_svc.c" />
-    <ClCompile Include="sp_tbs.c" />
-    <ClCompile Include="sp_tmr.c" />
-    <ClCompile Include="sp_uid.c" />
-    <ClCompile Include="sp_var.c" />
-  </ItemGroup>
-  <ItemGroup>
-    <ClInclude Include="..\Common\AutoArray.h" />
-    <ClInclude Include="..\Common\AutoLock.h" />
-    <ClInclude Include="..\Common\Blob.h" />
-    <ClInclude Include="..\Common\ErrorCode.h" />
-    <ClInclude Include="..\Common\GetDevInfoHelper.h" />
-    <ClInclude Include="..\Common\ListEntry.h" />
-    <ClInclude Include="..\Common\rec_common.h" />
-    <ClInclude Include="..\Common\resource1.h" />
-    <ClInclude Include="..\Common\RVCComm.h" />
-    <ClInclude Include="..\Common\SimpleString.h" />
-    <ClInclude Include="..\Common\SmartPointer.h" />
-    <ClInclude Include="..\Common\SpBase.h" />
-    <ClInclude Include="..\Common\SpFSM.h" />
-    <ClInclude Include="..\Common\SpHelper.h" />
-    <ClInclude Include="..\Common\SpIni.h" />
-    <ClInclude Include="..\Common\SpSecureClient.h" />
-    <ClInclude Include="..\Common\spShareMemoryBase.h" />
-    <ClInclude Include="..\Common\stdafx.h" />
-    <ClInclude Include="..\Common\CodeSignVerify.h" />
-    <ClInclude Include="..\Common\version.h" />
-    <ClInclude Include="Console.h" />
-    <ClInclude Include="resource1.h" />
-    <ClInclude Include="SpAsyncWait.h" />
-    <ClInclude Include="SpBaseRoutine.h" />
-    <ClInclude Include="SpBinaryPersistStream.h" />
-    <ClInclude Include="SpClientSessionFunction.h" />
-    <ClInclude Include="SpEntity.h" />
-    <ClInclude Include="SpEntityPrivilege.h" />
-    <ClInclude Include="SpMisc.h" />
-    <ClInclude Include="SpModule.h" />
-    <ClInclude Include="SpServerSessionFunction.h" />
-    <ClInclude Include="SpTimer.h" />
-    <ClInclude Include="SpTransactionContext.h" />
-    <ClInclude Include="SpXmlPersistStream.h" />
-    <ClInclude Include="sp_bcm.h" />
-    <ClInclude Include="sp_btr.h" />
-    <ClInclude Include="sp_cfg.h" />
-    <ClInclude Include="sp_checkEntity.h" />
-    <ClInclude Include="sp_dbg.h" />
-    <ClInclude Include="sp_def.h" />
-    <ClInclude Include="sp_dir.h" />
-    <ClInclude Include="sp_env.h" />
-    <ClInclude Include="sp_groupProcess.h" />
-    <ClInclude Include="sp_gui.h" />
-    <ClInclude Include="sp_hcc.h" />
-    <ClInclude Include="sp_iom.h" />
-    <ClInclude Include="sp_log.h" />
-    <ClInclude Include="sp_mod.h" />
-    <ClInclude Include="sp_pst.h" />
-    <ClInclude Include="sp_rpc.h" />
-    <ClInclude Include="sp_rsn.h" />
-    <ClInclude Include="sp_ses.h" />
-    <ClInclude Include="sp_shm.h" />
-    <ClInclude Include="sp_sps.h" />
-    <ClInclude Include="sp_svc.h" />
-    <ClInclude Include="sp_tbs.h" />
-    <ClInclude Include="sp_tmr.h" />
-    <ClInclude Include="sp_uid.h" />
-    <ClInclude Include="sp_var.h" />
-  </ItemGroup>
-  <ItemGroup>
-    <ResourceCompile Include="..\Common\Version.rc" />
-    <ResourceCompile Include="SpBase.rc" />
-  </ItemGroup>
-  <ItemGroup>
-    <None Include="Logo.png" />
-  </ItemGroup>
-  <Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />
-  <ImportGroup Label="ExtensionTargets">
-  </ImportGroup>
+<?xml version="1.0" encoding="utf-8"?>
+<Project DefaultTargets="Build" ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
+  <ItemGroup Label="ProjectConfigurations">
+    <ProjectConfiguration Include="Debug|Win32">
+      <Configuration>Debug</Configuration>
+      <Platform>Win32</Platform>
+    </ProjectConfiguration>
+    <ProjectConfiguration Include="Release|Win32">
+      <Configuration>Release</Configuration>
+      <Platform>Win32</Platform>
+    </ProjectConfiguration>
+  </ItemGroup>
+  <PropertyGroup Label="Globals">
+    <ProjectGuid>{C52D8054-7A8C-4A0E-82B2-2DB2779582AE}</ProjectGuid>
+    <Keyword>Win32Proj</Keyword>
+    <RootNamespace>spbase</RootNamespace>
+  </PropertyGroup>
+  <Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" />
+  <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" Label="Configuration">
+    <ConfigurationType>DynamicLibrary</ConfigurationType>
+    <UseDebugLibraries>true</UseDebugLibraries>
+    <CharacterSet>MultiByte</CharacterSet>
+    <PlatformToolset>Windows7.1SDK</PlatformToolset>
+  </PropertyGroup>
+  <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" Label="Configuration">
+    <ConfigurationType>DynamicLibrary</ConfigurationType>
+    <UseDebugLibraries>false</UseDebugLibraries>
+    <CharacterSet>MultiByte</CharacterSet>
+    <PlatformToolset>Windows7.1SDK</PlatformToolset>
+  </PropertyGroup>
+  <Import Project="$(VCTargetsPath)\Microsoft.Cpp.props" />
+  <ImportGroup Label="ExtensionSettings">
+  </ImportGroup>
+  <ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
+    <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
+    <Import Project="..\..\ver.props" />
+    <Import Project="..\out.props" />
+  </ImportGroup>
+  <ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
+    <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
+    <Import Project="..\..\ver.props" />
+    <Import Project="..\out.props" />
+  </ImportGroup>
+  <PropertyGroup Label="UserMacros" />
+  <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
+    <LinkIncremental>true</LinkIncremental>
+    <IntDir>$(SolutionDir)Temp\$(ProjectName)\</IntDir>
+    <LibraryPath>$(LibraryPath)</LibraryPath>
+    <OutDir>..\..\..\..\..\..\Run\version\3.1.0.0\bin</OutDir>
+  </PropertyGroup>
+  <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
+    <IntDir>$(SolutionDir)Temp\$(ProjectName)\</IntDir>
+    <LinkIncremental>false</LinkIncremental>
+    <LibraryPath>D:\工作\加密锁\1.9.3\LR04_ThirdParty_应用库\LR04_ThirdParty_Release\Release;D:\Run\version\1.9.4.0\bin;$(LibraryPath)</LibraryPath>
+  </PropertyGroup>
+  <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
+    <ClCompile>
+      <PrecompiledHeader>
+      </PrecompiledHeader>
+      <WarningLevel>Level3</WarningLevel>
+      <Optimization>Disabled</Optimization>
+      <PreprocessorDefinitions>WIN32;_DEBUG;_WINDOWS;_USRDLL;SPBASE_EXPORTS;SCEW_DLL;%(PreprocessorDefinitions)</PreprocessorDefinitions>
+      <AdditionalIncludeDirectories>..\common;..\libtoolkit;..\..\ThirdParty\scew-1.1.3\scew\;..\..\ThirdParty\Expat-2.1.0\Source\lib;..\..\..\..\LR04_ThirdParty_应用库\LR04_ThirdParty_Release\Include\scew-1.1.3\scew;..\..\..\..\LR04_ThirdParty_应用库\LR04_ThirdParty_Release\Include\Expat-2.1.0\Source\lib</AdditionalIncludeDirectories>
+      <ExceptionHandling>Sync</ExceptionHandling>
+    </ClCompile>
+    <Link>
+      <SubSystem>Windows</SubSystem>
+      <GenerateDebugInformation>true</GenerateDebugInformation>
+      <AdditionalDependencies>psapi.lib;imagehlp.lib;ws2_32.lib;libscew.lib;libtoolkit.lib;%(AdditionalDependencies)</AdditionalDependencies>
+      <AdditionalLibraryDirectories>..\..\..\..\..\..\Run\version\3.1.0.0\bin;..\..\..\..\LR04_ThirdParty_应用库\LR04_ThirdParty_Release\Release;</AdditionalLibraryDirectories>
+      <OutputFile>$(OutDir)$(TargetName)$(TargetExt)</OutputFile>
+    </Link>
+    <PostBuildEvent>
+      <Command>
+      </Command>
+      <Message>
+      </Message>
+    </PostBuildEvent>
+    <PreBuildEvent>
+      <Command>
+      </Command>
+    </PreBuildEvent>
+  </ItemDefinitionGroup>
+  <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
+    <ClCompile>
+      <WarningLevel>Level3</WarningLevel>
+      <PrecompiledHeader>
+      </PrecompiledHeader>
+      <Optimization>MaxSpeed</Optimization>
+      <PreprocessorDefinitions>WIN32;NDEBUG;_WINDOWS;_USRDLL;SPBASE_EXPORTS;SCEW_DLL;%(PreprocessorDefinitions)</PreprocessorDefinitions>
+      <AdditionalIncludeDirectories>..\common;..\libtoolkit;..\..\ThirdParty\scew-1.1.3\scew\;..\..\ThirdParty\Expat-2.1.0\Source\lib</AdditionalIncludeDirectories>
+      <InlineFunctionExpansion>
+      </InlineFunctionExpansion>
+      <BasicRuntimeChecks>
+      </BasicRuntimeChecks>
+      <RuntimeLibrary>MultiThreadedDLL</RuntimeLibrary>
+    </ClCompile>
+    <Link>
+      <SubSystem>Windows</SubSystem>
+      <EnableCOMDATFolding>true</EnableCOMDATFolding>
+      <OptimizeReferences>true</OptimizeReferences>
+      <AdditionalDependencies>ws2_32.lib;libscew.lib;libtoolkit.lib;%(AdditionalDependencies)</AdditionalDependencies>
+      <AdditionalLibraryDirectories>D:\Source\RVC\RVCProject\Release\version\1.0.0.1\bin;..\..\ThirdParty\scew-1.1.3\win32\lib</AdditionalLibraryDirectories>
+      <LinkTimeCodeGeneration>
+      </LinkTimeCodeGeneration>
+      <GenerateDebugInformation>false</GenerateDebugInformation>
+    </Link>
+  </ItemDefinitionGroup>
+  <ItemGroup>
+    <ClCompile Include="..\Common\stdafx.cpp" />
+    <ClCompile Include="Console.cpp" />
+    <ClCompile Include="PadMisc.cpp" />
+    <ClCompile Include="SpAsyncWait.cpp" />
+    <ClCompile Include="SpBase.cpp" />
+    <ClCompile Include="SpBaseRoutine.cpp" />
+    <ClCompile Include="SpBinaryPersistStream.cpp" />
+    <ClCompile Include="SpClientSessionFunction.cpp" />
+    <ClCompile Include="SpEntity.cpp" />
+    <ClCompile Include="SpEntityPrivilege.cpp" />
+    <ClCompile Include="SpFSM.cpp" />
+    <ClCompile Include="SpHelper.cpp" />
+    <ClCompile Include="SpMisc.cpp" />
+    <ClCompile Include="SpModule.cpp" />
+    <ClCompile Include="SpSecureClient.cpp" />
+    <ClCompile Include="SpServerSessionFunction.cpp" />
+    <ClCompile Include="spShareMemoryBase.cpp" />
+    <ClCompile Include="SpTimer.cpp" />
+    <ClCompile Include="SpTransactionContext.cpp" />
+    <ClCompile Include="SpXmlPersistStream.cpp" />
+    <ClCompile Include="CodeSignVerify.cpp" />
+    <ClCompile Include="sp_bcm.c" />
+    <ClCompile Include="sp_btr.c" />
+    <ClCompile Include="sp_cfg.cpp" />
+    <ClCompile Include="sp_checkEntity.cpp" />
+    <ClCompile Include="sp_dbg.cpp" />
+    <ClCompile Include="sp_dir.c" />
+    <ClCompile Include="sp_env.c" />
+    <ClCompile Include="sp_groupProcess.cpp" />
+    <ClCompile Include="sp_gui.cpp" />
+    <ClCompile Include="sp_hcc.c" />
+    <ClCompile Include="sp_iom.c" />
+    <ClCompile Include="sp_log.c" />
+    <ClCompile Include="sp_mod.c" />
+    <ClCompile Include="sp_pst.c" />
+    <ClCompile Include="sp_rpc.c" />
+    <ClCompile Include="sp_rsn.c" />
+    <ClCompile Include="sp_ses.c" />
+    <ClCompile Include="sp_shm.c" />
+    <ClCompile Include="sp_sps.c" />
+    <ClCompile Include="sp_svc.c" />
+    <ClCompile Include="sp_tbs.c" />
+    <ClCompile Include="sp_tmr.c" />
+    <ClCompile Include="sp_uid.c" />
+    <ClCompile Include="sp_var.c" />
+  </ItemGroup>
+  <ItemGroup>
+    <ClInclude Include="..\Common\AutoArray.h" />
+    <ClInclude Include="..\Common\AutoLock.h" />
+    <ClInclude Include="..\Common\Blob.h" />
+    <ClInclude Include="..\Common\ErrorCode.h" />
+    <ClInclude Include="..\Common\GetDevInfoHelper.h" />
+    <ClInclude Include="..\Common\ListEntry.h" />
+    <ClInclude Include="..\Common\rec_common.h" />
+    <ClInclude Include="..\Common\resource1.h" />
+    <ClInclude Include="..\Common\RVCComm.h" />
+    <ClInclude Include="..\Common\SimpleString.h" />
+    <ClInclude Include="..\Common\SmartPointer.h" />
+    <ClInclude Include="..\Common\SpBase.h" />
+    <ClInclude Include="..\Common\SpFSM.h" />
+    <ClInclude Include="..\Common\SpHelper.h" />
+    <ClInclude Include="..\Common\SpIni.h" />
+    <ClInclude Include="..\Common\SpSecureClient.h" />
+    <ClInclude Include="..\Common\spShareMemoryBase.h" />
+    <ClInclude Include="..\Common\stdafx.h" />
+    <ClInclude Include="..\Common\CodeSignVerify.h" />
+    <ClInclude Include="..\Common\version.h" />
+    <ClInclude Include="Console.h" />
+    <ClInclude Include="resource1.h" />
+    <ClInclude Include="SpAsyncWait.h" />
+    <ClInclude Include="SpBaseRoutine.h" />
+    <ClInclude Include="SpBinaryPersistStream.h" />
+    <ClInclude Include="SpClientSessionFunction.h" />
+    <ClInclude Include="SpEntity.h" />
+    <ClInclude Include="SpEntityPrivilege.h" />
+    <ClInclude Include="SpMisc.h" />
+    <ClInclude Include="SpModule.h" />
+    <ClInclude Include="SpServerSessionFunction.h" />
+    <ClInclude Include="SpTimer.h" />
+    <ClInclude Include="SpTransactionContext.h" />
+    <ClInclude Include="SpXmlPersistStream.h" />
+    <ClInclude Include="sp_bcm.h" />
+    <ClInclude Include="sp_btr.h" />
+    <ClInclude Include="sp_cfg.h" />
+    <ClInclude Include="sp_checkEntity.h" />
+    <ClInclude Include="sp_dbg.h" />
+    <ClInclude Include="sp_def.h" />
+    <ClInclude Include="sp_dir.h" />
+    <ClInclude Include="sp_env.h" />
+    <ClInclude Include="sp_groupProcess.h" />
+    <ClInclude Include="sp_gui.h" />
+    <ClInclude Include="sp_hcc.h" />
+    <ClInclude Include="sp_iom.h" />
+    <ClInclude Include="sp_log.h" />
+    <ClInclude Include="sp_mod.h" />
+    <ClInclude Include="sp_pst.h" />
+    <ClInclude Include="sp_rpc.h" />
+    <ClInclude Include="sp_rsn.h" />
+    <ClInclude Include="sp_ses.h" />
+    <ClInclude Include="sp_shm.h" />
+    <ClInclude Include="sp_sps.h" />
+    <ClInclude Include="sp_svc.h" />
+    <ClInclude Include="sp_tbs.h" />
+    <ClInclude Include="sp_tmr.h" />
+    <ClInclude Include="sp_uid.h" />
+    <ClInclude Include="sp_var.h" />
+  </ItemGroup>
+  <ItemGroup>
+    <ResourceCompile Include="..\Common\Version.rc" />
+    <ResourceCompile Include="SpBase.rc" />
+  </ItemGroup>
+  <ItemGroup>
+    <None Include="Logo.png" />
+  </ItemGroup>
+  <Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />
+  <ImportGroup Label="ExtensionTargets">
+  </ImportGroup>
 </Project>

+ 1 - 1
spbase/sp_dbg.cpp

@@ -61,7 +61,7 @@ int spDbg::sp_dbg_term()
 
 void spDbg::sp_dbg_log(int level, const char *str, va_list arg)
 {
-	xlog_log_v(m_inst, level, str, arg);
+	xlog_log_v(m_inst, level, str, arg);	//输出日志
 	
 	// 只显示警告以上级别信息
 	if (level >= XLOG_LEVEL_WARN && level <= XLOG_LEVEL_FATAL)

+ 1 - 72
spshell/log.cpp

@@ -262,7 +262,6 @@ static void on_log(void *inst,
 		LARGE_INTEGER t;
 		char *escape = str_xml_escape(msg);
 		t.QuadPart = log_id;
-		//__log_write_record(log, &st, t.HighPart, t.LowPart, str_types[log_type], mod->name, ent ? ent->name : "$Anonymous$", log_sys_error, log_usr_error, str_severity[log_severity], escape);
 		__log_write_record(log, 
 			log_id, &st, log_type, 
 			prev_rsn, curr_rsn, original_rsn_type, rsn_depth, 
@@ -334,74 +333,4 @@ int log_destroy(log_t *log)
 	}
 
 	return 0;
-}
-
-//int log_on_dbg_log_callback(int level, const char *format, va_list arg)
-//{
-//	int i;
-//	int rc;
-//	iobuffer_t *info_pkt;
-//	sp_env_t *env = sp_get_env();
-//	app_t *app = get_app_instance();
-//	sp_iom_t *iom = app->iom;
-//	int local_epid = sp_iom_get_epid(iom);
-//	unsigned __int64 log_id = 0;
-//	y2k_time_t log_time;
-//	sp_rsn_context_t *rsn_ctx;
-//	sp_entity_t *ent;
-//	int local_svc_id = 0;
-//	int sys_error = -1;
-//	int usr_error = -1;
-//	int param_cnt = 0;
-//	int pkt_id =0;
-//	int pkt_type = SP_PKT_LOG | 0x01;		// LOG_CMD_RECORD;
-//	int instance_id =0;
-//	int severityLevel =Severity_None;
-//	int logType =Log_Debug; 
-//
-//	int nMsgLen = format ? _vscprintf(format, arg) : 0;
-//	if (nMsgLen < 0 || nMsgLen > SP_LOG_MAX_LEN)
-//		return Error_Param;
-//
-//	log_time = y2k_time_now();
-//	rsn_ctx = sp_svc_get_runserial_context(app->svc);
-//
-//	info_pkt = iobuffer_create(-1, nMsgLen + 112);
-//	iobuffer_write(info_pkt, IOBUF_T_I4, &instance_id, 0);
-//	iobuffer_write(info_pkt, IOBUF_T_I8, &log_id, 0);
-//	if (rsn_ctx) {
-//		iobuffer_write(info_pkt, IOBUF_T_I8, &rsn_ctx->previous_rsn, 0);
-//		iobuffer_write(info_pkt, IOBUF_T_I8, &rsn_ctx->current_rsn, 0);
-//		iobuffer_write(info_pkt, IOBUF_T_I4, &rsn_ctx->original_type, 0);
-//		iobuffer_write(info_pkt, IOBUF_T_I4, &rsn_ctx->depth, 0);
-//	} else {
-//		unsigned __int64 invalid_rsn = 0;
-//		int t = 0;
-//		iobuffer_write(info_pkt, IOBUF_T_I8, &invalid_rsn, 0);
-//		iobuffer_write(info_pkt, IOBUF_T_I8, &invalid_rsn, 0);
-//		iobuffer_write(info_pkt, IOBUF_T_I4, &t, 0);
-//		iobuffer_write(info_pkt, IOBUF_T_I4, &t, 0);
-//	}
-//	iobuffer_write(info_pkt, IOBUF_T_I4, &log_time, 0);
-//	iobuffer_write(info_pkt, IOBUF_T_I4, &logType, 0);
-//	iobuffer_write(info_pkt, IOBUF_T_I4, &local_svc_id, 0);
-//	iobuffer_write(info_pkt, IOBUF_T_I4, &local_epid, 0);
-//	iobuffer_write(info_pkt, IOBUF_T_I4, &severityLevel, 0);
-//	iobuffer_write(info_pkt, IOBUF_T_I4, &sys_error, 0);
-//	iobuffer_write(info_pkt, IOBUF_T_I4, &usr_error, 0);
-//	iobuffer_write(info_pkt, IOBUF_T_I4, &param_cnt, 0);
-//	iobuffer_write(info_pkt, IOBUF_T_7BIT, &nMsgLen, 0);
-//	if (nMsgLen > 0) {
-//		nMsgLen = vsprintf(iobuffer_data(info_pkt, -1), format, arg);
-//		iobuffer_push_count(info_pkt, nMsgLen);
-//	}
-//
-//	iobuffer_write_head(info_pkt, IOBUF_T_I4, &pkt_id, 0);
-//	iobuffer_write_head(info_pkt, IOBUF_T_I4, &pkt_type, 0);
-//	iobuffer_write_head(info_pkt, IOBUF_T_I4, &local_svc_id, 0);
-//	iobuffer_write_head(info_pkt, IOBUF_T_I4, &local_epid, 0);
-//
-//	sp_log_daemon_queue_pkg(app->log->log_daemon, info_pkt);
-//	return 0;
-//}
-
+}