├── .gitattributes ├── .gitignore ├── LogUtil ├── CLogImp.cpp ├── CLogImp.h ├── Common.cpp ├── Common.h ├── ILog.cpp ├── ILog.h ├── LogUtil.filters ├── LogUtil.rc ├── LogUtil.vcxproj ├── ReadMe.txt ├── dllmain.cpp ├── resource.h ├── stdafx.cpp ├── stdafx.h └── targetver.h ├── LogUtilMan v1.0.1.6.rar ├── LogUtilMan v1.0.1.7.rar ├── LogUtilMan v1.0.1.8.rar ├── LogUtilMan v1.0.1.9.rar ├── LogUtilMan v1.0.2.0.rar ├── LogUtilMan.sln ├── README.md ├── TestCase ├── ReadMe.txt ├── TestCase.cpp ├── TestCase.vcxproj ├── TestCase.vcxproj.filters ├── stdafx.cpp ├── stdafx.h └── targetver.h ├── 性能测试数据分析.xlsx ├── 总完成时长.png └── 最大入队时长.png /.gitattributes: -------------------------------------------------------------------------------- 1 | *.* linguist-language=C++ 2 | *.h linguist-language=C++ 3 | *.hpp linguist-language=C++ 4 | *.cpp linguist-language=C++ 5 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | ## Ignore Visual Studio temporary files, build results, and 2 | ## files generated by popular Visual Studio add-ons. 3 | ## 4 | ## Get latest from https://github.com/github/gitignore/blob/master/VisualStudio.gitignore 5 | 6 | # User-specific files 7 | *.rsuser 8 | *.suo 9 | *.user 10 | *.userosscache 11 | *.sln.docstates 12 | 13 | # User-specific files (MonoDevelop/Xamarin Studio) 14 | *.userprefs 15 | 16 | # Build results 17 | [Dd]ebug/ 18 | [Dd]ebugPublic/ 19 | [Rr]elease/ 20 | [Rr]eleases/ 21 | x64/ 22 | x86/ 23 | [Aa][Rr][Mm]/ 24 | [Aa][Rr][Mm]64/ 25 | bld/ 26 | [Bb]in/ 27 | [Oo]bj/ 28 | [Ll]og/ 29 | 30 | # Visual Studio 2015/2017 cache/options directory 31 | .vs/ 32 | # Uncomment if you have tasks that create the project's static files in wwwroot 33 | #wwwroot/ 34 | 35 | # Visual Studio 2017 auto generated files 36 | Generated\ Files/ 37 | 38 | # MSTest test Results 39 | [Tt]est[Rr]esult*/ 40 | [Bb]uild[Ll]og.* 41 | 42 | # NUNIT 43 | *.VisualState.xml 44 | TestResult.xml 45 | 46 | # Build Results of an ATL Project 47 | [Dd]ebugPS/ 48 | [Rr]eleasePS/ 49 | dlldata.c 50 | 51 | # Benchmark Results 52 | BenchmarkDotNet.Artifacts/ 53 | 54 | # .NET Core 55 | project.lock.json 56 | project.fragment.lock.json 57 | artifacts/ 58 | 59 | # StyleCop 60 | StyleCopReport.xml 61 | 62 | # Files built by Visual Studio 63 | *_i.c 64 | *_p.c 65 | *_h.h 66 | *.ilk 67 | *.meta 68 | *.obj 69 | *.iobj 70 | *.pch 71 | *.pdb 72 | *.ipdb 73 | *.pgc 74 | *.pgd 75 | *.rsp 76 | *.sbr 77 | *.tlb 78 | *.tli 79 | *.tlh 80 | *.tmp 81 | *.tmp_proj 82 | *_wpftmp.csproj 83 | *.log 84 | *.vspscc 85 | *.vssscc 86 | .builds 87 | *.pidb 88 | *.svclog 89 | *.scc 90 | 91 | # Chutzpah Test files 92 | _Chutzpah* 93 | 94 | # Visual C++ cache files 95 | ipch/ 96 | *.aps 97 | *.ncb 98 | *.opendb 99 | *.opensdf 100 | *.sdf 101 | *.cachefile 102 | *.VC.db 103 | *.VC.VC.opendb 104 | 105 | # Visual Studio profiler 106 | *.psess 107 | *.vsp 108 | *.vspx 109 | *.sap 110 | 111 | # Visual Studio Trace Files 112 | *.e2e 113 | 114 | # TFS 2012 Local Workspace 115 | $tf/ 116 | 117 | # Guidance Automation Toolkit 118 | *.gpState 119 | 120 | # ReSharper is a .NET coding add-in 121 | _ReSharper*/ 122 | *.[Rr]e[Ss]harper 123 | *.DotSettings.user 124 | 125 | # JustCode is a .NET coding add-in 126 | .JustCode 127 | 128 | # TeamCity is a build add-in 129 | _TeamCity* 130 | 131 | # DotCover is a Code Coverage Tool 132 | *.dotCover 133 | 134 | # AxoCover is a Code Coverage Tool 135 | .axoCover/* 136 | !.axoCover/settings.json 137 | 138 | # Visual Studio code coverage results 139 | *.coverage 140 | *.coveragexml 141 | 142 | # NCrunch 143 | _NCrunch_* 144 | .*crunch*.local.xml 145 | nCrunchTemp_* 146 | 147 | # MightyMoose 148 | *.mm.* 149 | AutoTest.Net/ 150 | 151 | # Web workbench (sass) 152 | .sass-cache/ 153 | 154 | # Installshield output folder 155 | [Ee]xpress/ 156 | 157 | # DocProject is a documentation generator add-in 158 | DocProject/buildhelp/ 159 | DocProject/Help/*.HxT 160 | DocProject/Help/*.HxC 161 | DocProject/Help/*.hhc 162 | DocProject/Help/*.hhk 163 | DocProject/Help/*.hhp 164 | DocProject/Help/Html2 165 | DocProject/Help/html 166 | 167 | # Click-Once directory 168 | publish/ 169 | 170 | # Publish Web Output 171 | *.[Pp]ublish.xml 172 | *.azurePubxml 173 | # Note: Comment the next line if you want to checkin your web deploy settings, 174 | # but database connection strings (with potential passwords) will be unencrypted 175 | *.pubxml 176 | *.publishproj 177 | 178 | # Microsoft Azure Web App publish settings. Comment the next line if you want to 179 | # checkin your Azure Web App publish settings, but sensitive information contained 180 | # in these scripts will be unencrypted 181 | PublishScripts/ 182 | 183 | # NuGet Packages 184 | *.nupkg 185 | # The packages folder can be ignored because of Package Restore 186 | **/[Pp]ackages/* 187 | # except build/, which is used as an MSBuild target. 188 | !**/[Pp]ackages/build/ 189 | # Uncomment if necessary however generally it will be regenerated when needed 190 | #!**/[Pp]ackages/repositories.config 191 | # NuGet v3's project.json files produces more ignorable files 192 | *.nuget.props 193 | *.nuget.targets 194 | 195 | # Microsoft Azure Build Output 196 | csx/ 197 | *.build.csdef 198 | 199 | # Microsoft Azure Emulator 200 | ecf/ 201 | rcf/ 202 | 203 | # Windows Store app package directories and files 204 | AppPackages/ 205 | BundleArtifacts/ 206 | Package.StoreAssociation.xml 207 | _pkginfo.txt 208 | *.appx 209 | 210 | # Visual Studio cache files 211 | # files ending in .cache can be ignored 212 | *.[Cc]ache 213 | # but keep track of directories ending in .cache 214 | !?*.[Cc]ache/ 215 | 216 | # Others 217 | ClientBin/ 218 | ~$* 219 | *~ 220 | *.dbmdl 221 | *.dbproj.schemaview 222 | *.jfm 223 | *.pfx 224 | *.publishsettings 225 | orleans.codegen.cs 226 | 227 | # Including strong name files can present a security risk 228 | # (https://github.com/github/gitignore/pull/2483#issue-259490424) 229 | #*.snk 230 | 231 | # Since there are multiple workflows, uncomment next line to ignore bower_components 232 | # (https://github.com/github/gitignore/pull/1529#issuecomment-104372622) 233 | #bower_components/ 234 | 235 | # RIA/Silverlight projects 236 | Generated_Code/ 237 | 238 | # Backup & report files from converting an old project file 239 | # to a newer Visual Studio version. Backup files are not needed, 240 | # because we have git ;-) 241 | _UpgradeReport_Files/ 242 | Backup*/ 243 | UpgradeLog*.XML 244 | UpgradeLog*.htm 245 | ServiceFabricBackup/ 246 | *.rptproj.bak 247 | 248 | # SQL Server files 249 | *.mdf 250 | *.ldf 251 | *.ndf 252 | 253 | # Business Intelligence projects 254 | *.rdl.data 255 | *.bim.layout 256 | *.bim_*.settings 257 | *.rptproj.rsuser 258 | *- Backup*.rdl 259 | 260 | # Microsoft Fakes 261 | FakesAssemblies/ 262 | 263 | # GhostDoc plugin setting file 264 | *.GhostDoc.xml 265 | 266 | # Node.js Tools for Visual Studio 267 | .ntvs_analysis.dat 268 | node_modules/ 269 | 270 | # Visual Studio 6 build log 271 | *.plg 272 | 273 | # Visual Studio 6 workspace options file 274 | *.opt 275 | 276 | # Visual Studio 6 auto-generated workspace file (contains which files were open etc.) 277 | *.vbw 278 | 279 | # Visual Studio LightSwitch build output 280 | **/*.HTMLClient/GeneratedArtifacts 281 | **/*.DesktopClient/GeneratedArtifacts 282 | **/*.DesktopClient/ModelManifest.xml 283 | **/*.Server/GeneratedArtifacts 284 | **/*.Server/ModelManifest.xml 285 | _Pvt_Extensions 286 | 287 | # Paket dependency manager 288 | .paket/paket.exe 289 | paket-files/ 290 | 291 | # FAKE - F# Make 292 | .fake/ 293 | 294 | # JetBrains Rider 295 | .idea/ 296 | *.sln.iml 297 | 298 | # CodeRush personal settings 299 | .cr/personal 300 | 301 | # Python Tools for Visual Studio (PTVS) 302 | __pycache__/ 303 | *.pyc 304 | 305 | # Cake - Uncomment if you are using it 306 | # tools/** 307 | # !tools/packages.config 308 | 309 | # Tabs Studio 310 | *.tss 311 | 312 | # Telerik's JustMock configuration file 313 | *.jmconfig 314 | 315 | # BizTalk build output 316 | *.btp.cs 317 | *.btm.cs 318 | *.odx.cs 319 | *.xsd.cs 320 | 321 | # OpenCover UI analysis results 322 | OpenCover/ 323 | 324 | # Azure Stream Analytics local run output 325 | ASALocalRun/ 326 | 327 | # MSBuild Binary and Structured Log 328 | *.binlog 329 | 330 | # NVidia Nsight GPU debugger configuration file 331 | *.nvuser 332 | 333 | # MFractors (Xamarin productivity tool) working folder 334 | .mfractor/ 335 | 336 | # Local History for Visual Studio 337 | .localhistory/ 338 | 339 | # BeatPulse healthcheck temp database 340 | healthchecksdb 341 | -------------------------------------------------------------------------------- /LogUtil/CLogImp.cpp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ccpwcn/LogUtilMan/4b7910b01bc56949081ef90b3607365e4d4e2717/LogUtil/CLogImp.cpp -------------------------------------------------------------------------------- /LogUtil/CLogImp.h: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ccpwcn/LogUtilMan/4b7910b01bc56949081ef90b3607365e4d4e2717/LogUtil/CLogImp.h -------------------------------------------------------------------------------- /LogUtil/Common.cpp: -------------------------------------------------------------------------------- 1 | #include "stdafx.h" 2 | #include 3 | #include "Common.h" 4 | 5 | CLock::CLock() 6 | { 7 | InitializeCriticalSection(&m_cs); 8 | } 9 | CLock::~CLock() 10 | { 11 | DeleteCriticalSection(&m_cs); 12 | } 13 | 14 | void CLock::Lock() 15 | { 16 | EnterCriticalSection(&m_cs); 17 | } 18 | void CLock::Unlock() 19 | { 20 | LeaveCriticalSection(&m_cs); 21 | } -------------------------------------------------------------------------------- /LogUtil/Common.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #include 4 | 5 | class CLock 6 | { 7 | public: 8 | CLock(); 9 | ~CLock(); 10 | 11 | void Lock(); 12 | void Unlock(); 13 | 14 | private: 15 | CRITICAL_SECTION m_cs; 16 | }; 17 | 18 | typedef CLock THREAD_SAFE_LOCK; -------------------------------------------------------------------------------- /LogUtil/ILog.cpp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ccpwcn/LogUtilMan/4b7910b01bc56949081ef90b3607365e4d4e2717/LogUtil/ILog.cpp -------------------------------------------------------------------------------- /LogUtil/ILog.h: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ccpwcn/LogUtilMan/4b7910b01bc56949081ef90b3607365e4d4e2717/LogUtil/ILog.h -------------------------------------------------------------------------------- /LogUtil/LogUtil.filters: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | 5 | {4FC737F1-C7A5-4376-A066-2A32D752A2FF} 6 | cpp;c;cc;cxx;def;odl;idl;hpj;bat;asm;asmx 7 | 8 | 9 | {93995380-89BD-4b04-88EB-625FBE52EBFB} 10 | h;hh;hpp;hxx;hm;inl;inc;xsd 11 | 12 | 13 | {67DA6AB6-F800-4c08-8B7A-83BB121AAD01} 14 | rc;ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe;resx;tiff;tif;png;wav;mfcribbon-ms 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 头文件 23 | 24 | 25 | 头文件 26 | 27 | 28 | 头文件 29 | 30 | 31 | 头文件 32 | 33 | 34 | 头文件 35 | 36 | 37 | 头文件 38 | 39 | 40 | 41 | 42 | 源文件 43 | 44 | 45 | 源文件 46 | 47 | 48 | 源文件 49 | 50 | 51 | 源文件 52 | 53 | 54 | 55 | 56 | 资源文件 57 | 58 | 59 | -------------------------------------------------------------------------------- /LogUtil/LogUtil.rc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ccpwcn/LogUtilMan/4b7910b01bc56949081ef90b3607365e4d4e2717/LogUtil/LogUtil.rc -------------------------------------------------------------------------------- /LogUtil/LogUtil.vcxproj: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | 5 | Debug 6 | Win32 7 | 8 | 9 | Release 10 | Win32 11 | 12 | 13 | Debug 14 | x64 15 | 16 | 17 | Release 18 | x64 19 | 20 | 21 | 22 | {48B67E07-BBEE-4B62-A03F-778AF2CD4A50} 23 | Win32Proj 24 | LogUtil 25 | 10.0 26 | LogUtil 27 | 28 | 29 | 30 | DynamicLibrary 31 | true 32 | v143 33 | Unicode 34 | 35 | 36 | DynamicLibrary 37 | false 38 | v143 39 | true 40 | Unicode 41 | 42 | 43 | DynamicLibrary 44 | true 45 | v143 46 | Unicode 47 | 48 | 49 | DynamicLibrary 50 | false 51 | v143 52 | true 53 | Unicode 54 | 55 | 56 | 57 | 58 | 59 | 60 | 61 | 62 | 63 | 64 | 65 | 66 | 67 | 68 | 69 | 70 | 71 | 72 | 73 | 74 | true 75 | 76 | 77 | true 78 | 79 | 80 | false 81 | 82 | 83 | false 84 | 85 | 86 | 87 | Use 88 | Level3 89 | Disabled 90 | WIN32;_DEBUG;_WINDOWS;_USRDLL;LOGUTIL_EXPORTS;%(PreprocessorDefinitions) 91 | true 92 | Async 93 | 94 | 95 | Windows 96 | true 97 | 98 | 99 | 100 | 101 | Use 102 | Level3 103 | Disabled 104 | _DEBUG;_WINDOWS;_USRDLL;LOGUTIL_EXPORTS;%(PreprocessorDefinitions) 105 | true 106 | 107 | 108 | Windows 109 | true 110 | 111 | 112 | 113 | 114 | Level3 115 | Use 116 | MaxSpeed 117 | true 118 | true 119 | WIN32;NDEBUG;_WINDOWS;_USRDLL;LOGUTIL_EXPORTS;%(PreprocessorDefinitions) 120 | true 121 | 122 | 123 | Windows 124 | true 125 | true 126 | true 127 | 128 | 129 | 130 | 131 | Level3 132 | Use 133 | MaxSpeed 134 | true 135 | true 136 | NDEBUG;_WINDOWS;_USRDLL;LOGUTIL_EXPORTS;%(PreprocessorDefinitions) 137 | true 138 | 139 | 140 | Windows 141 | true 142 | true 143 | true 144 | 145 | 146 | 147 | 148 | 149 | 150 | 151 | 152 | 153 | 154 | 155 | 156 | 157 | 158 | 159 | 160 | 161 | false 162 | 163 | 164 | false 165 | 166 | 167 | false 168 | 169 | 170 | false 171 | 172 | 173 | 174 | 175 | 176 | Create 177 | Create 178 | Create 179 | Create 180 | 181 | 182 | 183 | 184 | 185 | 186 | 187 | 188 | -------------------------------------------------------------------------------- /LogUtil/ReadMe.txt: -------------------------------------------------------------------------------- 1 | ======================================================================== 2 | 动态链接库:LogUtil 项目概述 3 | ======================================================================== 4 | 5 | 应用程序向导已为您创建了此 LogUtil DLL。 6 | 7 | 本文件概要介绍组成 LogUtil 应用程序的每个文件的内容。 8 | 9 | 10 | LogUtil.vcxproj 11 | 这是使用应用程序向导生成的 VC++ 项目的主项目文件,其中包含生成该文件的 Visual C++ 的版本信息,以及有关使用应用程序向导选择的平台、配置和项目功能的信息。 12 | 13 | LogUtil.vcxproj.filters 14 | 这是使用“应用程序向导”生成的 VC++ 项目筛选器文件。它包含有关项目文件与筛选器之间的关联信息。在 IDE 中,通过这种关联,在特定节点下以分组形式显示具有相似扩展名的文件。例如,“.cpp”文件与“源文件”筛选器关联。 15 | 16 | LogUtil.cpp 17 | 这是主 DLL 源文件。 18 | 19 | 此 DLL 在创建时不导出任何符号。因此,生成时不会产生 .lib 文件。如果希望此项目成为其他某个项目的项目依赖项,则需要添加代码以从 DLL 导出某些符号,以便产生一个导出库,或者,也可以在项目“属性页”对话框中的“链接器”文件夹中,将“常规”属性页上的“忽略输入库”属性设置为“是”。 20 | 21 | ///////////////////////////////////////////////////////////////////////////// 22 | 其他标准文件: 23 | 24 | StdAfx.h, StdAfx.cpp 25 | 这些文件用于生成名为 ClassFactory.pch 的预编译头 (PCH) 文件和名为 StdAfx.obj 的预编译类型文件。 26 | 27 | ///////////////////////////////////////////////////////////////////////////// 28 | 其他注释: 29 | 30 | 应用程序向导使用“TODO:”注释来指示应添加或自定义的源代码部分。 31 | 32 | ///////////////////////////////////////////////////////////////////////////// 33 | -------------------------------------------------------------------------------- /LogUtil/dllmain.cpp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ccpwcn/LogUtilMan/4b7910b01bc56949081ef90b3607365e4d4e2717/LogUtil/dllmain.cpp -------------------------------------------------------------------------------- /LogUtil/resource.h: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ccpwcn/LogUtilMan/4b7910b01bc56949081ef90b3607365e4d4e2717/LogUtil/resource.h -------------------------------------------------------------------------------- /LogUtil/stdafx.cpp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ccpwcn/LogUtilMan/4b7910b01bc56949081ef90b3607365e4d4e2717/LogUtil/stdafx.cpp -------------------------------------------------------------------------------- /LogUtil/stdafx.h: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ccpwcn/LogUtilMan/4b7910b01bc56949081ef90b3607365e4d4e2717/LogUtil/stdafx.h -------------------------------------------------------------------------------- /LogUtil/targetver.h: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ccpwcn/LogUtilMan/4b7910b01bc56949081ef90b3607365e4d4e2717/LogUtil/targetver.h -------------------------------------------------------------------------------- /LogUtilMan v1.0.1.6.rar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ccpwcn/LogUtilMan/4b7910b01bc56949081ef90b3607365e4d4e2717/LogUtilMan v1.0.1.6.rar -------------------------------------------------------------------------------- /LogUtilMan v1.0.1.7.rar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ccpwcn/LogUtilMan/4b7910b01bc56949081ef90b3607365e4d4e2717/LogUtilMan v1.0.1.7.rar -------------------------------------------------------------------------------- /LogUtilMan v1.0.1.8.rar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ccpwcn/LogUtilMan/4b7910b01bc56949081ef90b3607365e4d4e2717/LogUtilMan v1.0.1.8.rar -------------------------------------------------------------------------------- /LogUtilMan v1.0.1.9.rar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ccpwcn/LogUtilMan/4b7910b01bc56949081ef90b3607365e4d4e2717/LogUtilMan v1.0.1.9.rar -------------------------------------------------------------------------------- /LogUtilMan v1.0.2.0.rar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ccpwcn/LogUtilMan/4b7910b01bc56949081ef90b3607365e4d4e2717/LogUtilMan v1.0.2.0.rar -------------------------------------------------------------------------------- /LogUtilMan.sln: -------------------------------------------------------------------------------- 1 |  2 | Microsoft Visual Studio Solution File, Format Version 12.00 3 | # Visual Studio Version 16 4 | VisualStudioVersion = 16.0.31729.503 5 | MinimumVisualStudioVersion = 10.0.40219.1 6 | Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "TestCase", "TestCase\TestCase.vcxproj", "{66FAE115-78ED-4CA7-A4C4-9F940D8DC870}" 7 | ProjectSection(ProjectDependencies) = postProject 8 | {48B67E07-BBEE-4B62-A03F-778AF2CD4A50} = {48B67E07-BBEE-4B62-A03F-778AF2CD4A50} 9 | EndProjectSection 10 | EndProject 11 | Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "LogUtil", "LogUtil\LogUtil.vcxproj", "{48B67E07-BBEE-4B62-A03F-778AF2CD4A50}" 12 | EndProject 13 | Global 14 | GlobalSection(SolutionConfigurationPlatforms) = preSolution 15 | Debug|x64 = Debug|x64 16 | Debug|x86 = Debug|x86 17 | Release|x64 = Release|x64 18 | Release|x86 = Release|x86 19 | EndGlobalSection 20 | GlobalSection(ProjectConfigurationPlatforms) = postSolution 21 | {66FAE115-78ED-4CA7-A4C4-9F940D8DC870}.Debug|x64.ActiveCfg = Debug|x64 22 | {66FAE115-78ED-4CA7-A4C4-9F940D8DC870}.Debug|x64.Build.0 = Debug|x64 23 | {66FAE115-78ED-4CA7-A4C4-9F940D8DC870}.Debug|x86.ActiveCfg = Debug|Win32 24 | {66FAE115-78ED-4CA7-A4C4-9F940D8DC870}.Debug|x86.Build.0 = Debug|Win32 25 | {66FAE115-78ED-4CA7-A4C4-9F940D8DC870}.Release|x64.ActiveCfg = Release|x64 26 | {66FAE115-78ED-4CA7-A4C4-9F940D8DC870}.Release|x64.Build.0 = Release|x64 27 | {66FAE115-78ED-4CA7-A4C4-9F940D8DC870}.Release|x86.ActiveCfg = Release|Win32 28 | {66FAE115-78ED-4CA7-A4C4-9F940D8DC870}.Release|x86.Build.0 = Release|Win32 29 | {48B67E07-BBEE-4B62-A03F-778AF2CD4A50}.Debug|x64.ActiveCfg = Debug|x64 30 | {48B67E07-BBEE-4B62-A03F-778AF2CD4A50}.Debug|x64.Build.0 = Debug|x64 31 | {48B67E07-BBEE-4B62-A03F-778AF2CD4A50}.Debug|x86.ActiveCfg = Debug|Win32 32 | {48B67E07-BBEE-4B62-A03F-778AF2CD4A50}.Debug|x86.Build.0 = Debug|Win32 33 | {48B67E07-BBEE-4B62-A03F-778AF2CD4A50}.Release|x64.ActiveCfg = Release|x64 34 | {48B67E07-BBEE-4B62-A03F-778AF2CD4A50}.Release|x64.Build.0 = Release|x64 35 | {48B67E07-BBEE-4B62-A03F-778AF2CD4A50}.Release|x86.ActiveCfg = Release|Win32 36 | {48B67E07-BBEE-4B62-A03F-778AF2CD4A50}.Release|x86.Build.0 = Release|Win32 37 | EndGlobalSection 38 | GlobalSection(SolutionProperties) = preSolution 39 | HideSolutionNode = FALSE 40 | EndGlobalSection 41 | GlobalSection(ExtensibilityGlobals) = postSolution 42 | SolutionGuid = {CE8F3ACA-EE77-4E89-8ED3-DD19D0973323} 43 | EndGlobalSection 44 | EndGlobal 45 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # LogUtilMan 2 | 3 | Windows应用程序日志库,支持printf语法,支持百万级日志快速输出,为您的应用程序加油🍕🍕🍕 4 | 5 | ### 日志类 6 | * 支持多线程高并发,实测达到200W级,300W级因为我的电脑太烂了,测不了,如果谁发现BUG,请告诉我 7 | * 支持日志分级,有info、error、debug、warning四个级别 8 | * 支持以printf函数的语法输入日志 9 | * 智能性能并发让步机制,根据计算机性能自动测算延迟保存系数,不影响业务模块资源引用 10 | * 进程内单例模式运行,不会造成资源冲突 11 | * 支持Windows环境下的多进程引用,不会出现问题 12 | 13 | #### 已经明确的使用规则: 14 | 1. 按照printf函数的语法提供输入 15 | 2. 日志处理速度和要写入的数量量有关,数量量特别大时,会有轻微的延迟 16 | 3. info、error、debug、warning四个级别的日志输出函数,会返回已经处理完毕的此条日志消息的长度,处理失败返回-1 17 | 18 | #### 异步写入,支持高并发 19 | | 并发线程数 | 总日志量 | 入队消耗总时长 | 保存消耗总时长 | 20 | | ------------:| ----------:| ----------------:| ------------------:| 21 | | 10 | 5W | 0.062s | 0.312s | 22 | | 50 | 15W | 0.312s | 1.529s | 23 | | 500 | 50W | 1.029s | 5.086s | 24 | 25 | 26 | 上面的表格是上一个版本的过于追求高并发了,此版本调整了这个设计,使用更加严格的策略控制CPU和内存占用。 27 | 28 | 高并发场景在客户端软件中其实并不常用,系统资源低占用又好用才是王道。所以改了一版。 29 | 30 | 当然了,新版本的性能我也进行了实测,有轻微下降,但是并不影响使用。 31 | 32 | ### 性能表现 33 | 日志进入队列时的性能表现: 34 | ![总完成时长](https://raw.githubusercontent.com/ccpwcn/LogUtilMan/master/%E6%80%BB%E5%AE%8C%E6%88%90%E6%97%B6%E9%95%BF.png) 35 | 36 | 日志保存到磁盘中的性能表现: 37 | ![最大入队时长](https://raw.githubusercontent.com/ccpwcn/LogUtilMan/master/%E6%9C%80%E5%A4%A7%E5%85%A5%E9%98%9F%E6%97%B6%E9%95%BF.png) 38 | 39 | ### 公开的接口 40 | ``` 41 | class DLL_API ILog 42 | { 43 | public: 44 | virtual ~ILog() = 0; 45 | virtual size_t info(__in_opt const TCHAR *fmt, ...) = 0; 46 | virtual size_t error(__in_opt const TCHAR *fmt, ...) = 0; 47 | virtual size_t debug(__in_opt const TCHAR *fmt, ...) = 0; 48 | virtual size_t warning(__in_opt const TCHAR *fmt, ...) = 0; 49 | }; 50 | 51 | extern "C" { 52 | DLL_API ILog * GetClassObject(__in const LPCTSTR lpszLogFilename); 53 | DLL_API void ReleaseClassObject(__in const ILog * instance); 54 | } 55 | ``` 56 | 57 | ### 使用方法 58 | LogUtil是日志库文件 59 | TestCase是测试用例,里面有库文件引用的详细的示例代码 60 | 只需要ILog.h这个头文件和编译好的DLL就可以使用了 61 | 1. 使用导出函数GetClassObject获得日志对象实例 62 | 2. 调用日志接口方法,info、error、debug、warning写入日志 63 | 3. 调用ReleaseClassObject关闭日志文件,保存日志数据,这一步是必须的,否则有可能造成资源泄漏或者日志数据丢失 64 | 4. 不要在一个进程内反复创建同一个日志文件的读写实例,防止多头写入造成日志文件覆盖或丢失。 -------------------------------------------------------------------------------- /TestCase/ReadMe.txt: -------------------------------------------------------------------------------- 1 | ======================================================================== 2 | 控制台应用程序:TestCase 项目概述 3 | ======================================================================== 4 | 5 | 应用程序向导已为您创建了此 TestCase 应用程序。 6 | 7 | 本文件概要介绍组成 TestCase 应用程序的每个文件的内容。 8 | 9 | 10 | TestCase.vcxproj 11 | 这是使用应用程序向导生成的 VC++ 项目的主项目文件,其中包含生成该文件的 Visual C++ 的版本信息,以及有关使用应用程序向导选择的平台、配置和项目功能的信息。 12 | 13 | TestCase.vcxproj.filters 14 | 这是使用“应用程序向导”生成的 VC++ 项目筛选器文件。它包含有关项目文件与筛选器之间的关联信息。在 IDE 中,通过这种关联,在特定节点下以分组形式显示具有相似扩展名的文件。例如,“.cpp”文件与“源文件”筛选器关联。 15 | 16 | TestCase.cpp 17 | 这是主应用程序源文件。 18 | 19 | ///////////////////////////////////////////////////////////////////////////// 20 | 其他标准文件: 21 | 22 | StdAfx.h, StdAfx.cpp 23 | 这些文件用于生成名为 TestCase.pch 的预编译头 (PCH) 文件和名为 StdAfx.obj 的预编译类型文件。 24 | 25 | ///////////////////////////////////////////////////////////////////////////// 26 | 其他注释: 27 | 28 | 应用程序向导使用“TODO:”注释来指示应添加或自定义的源代码部分。 29 | 30 | ///////////////////////////////////////////////////////////////////////////// 31 | -------------------------------------------------------------------------------- /TestCase/TestCase.cpp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ccpwcn/LogUtilMan/4b7910b01bc56949081ef90b3607365e4d4e2717/TestCase/TestCase.cpp -------------------------------------------------------------------------------- /TestCase/TestCase.vcxproj: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | 5 | Debug 6 | Win32 7 | 8 | 9 | Release 10 | Win32 11 | 12 | 13 | Debug 14 | x64 15 | 16 | 17 | Release 18 | x64 19 | 20 | 21 | 22 | {66FAE115-78ED-4CA7-A4C4-9F940D8DC870} 23 | Win32Proj 24 | TestCase 25 | 10.0 26 | 27 | 28 | 29 | Application 30 | true 31 | v143 32 | Unicode 33 | 34 | 35 | Application 36 | false 37 | v143 38 | true 39 | Unicode 40 | 41 | 42 | Application 43 | true 44 | v143 45 | Unicode 46 | 47 | 48 | Application 49 | false 50 | v143 51 | true 52 | Unicode 53 | 54 | 55 | 56 | 57 | 58 | 59 | 60 | 61 | 62 | 63 | 64 | 65 | 66 | 67 | 68 | 69 | 70 | 71 | 72 | 73 | true 74 | 75 | 76 | true 77 | 78 | 79 | false 80 | 81 | 82 | false 83 | 84 | 85 | 86 | Use 87 | Level3 88 | Disabled 89 | WIN32;_DEBUG;_CONSOLE;%(PreprocessorDefinitions) 90 | true 91 | 92 | 93 | Console 94 | true 95 | 96 | 97 | 98 | 99 | Use 100 | Level3 101 | Disabled 102 | _DEBUG;_CONSOLE;%(PreprocessorDefinitions) 103 | true 104 | 105 | 106 | Console 107 | true 108 | 109 | 110 | 111 | 112 | Level3 113 | Use 114 | MaxSpeed 115 | true 116 | true 117 | WIN32;NDEBUG;_CONSOLE;%(PreprocessorDefinitions) 118 | true 119 | 120 | 121 | Console 122 | true 123 | true 124 | true 125 | 126 | 127 | 128 | 129 | Level3 130 | Use 131 | MaxSpeed 132 | true 133 | true 134 | NDEBUG;_CONSOLE;%(PreprocessorDefinitions) 135 | true 136 | 137 | 138 | Console 139 | true 140 | true 141 | true 142 | 143 | 144 | 145 | 146 | 147 | 148 | 149 | 150 | 151 | 152 | 153 | Create 154 | Create 155 | Create 156 | Create 157 | 158 | 159 | 160 | 161 | 162 | 163 | 164 | 165 | 166 | -------------------------------------------------------------------------------- /TestCase/TestCase.vcxproj.filters: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | 5 | {4FC737F1-C7A5-4376-A066-2A32D752A2FF} 6 | cpp;c;cc;cxx;def;odl;idl;hpj;bat;asm;asmx 7 | 8 | 9 | {93995380-89BD-4b04-88EB-625FBE52EBFB} 10 | h;hh;hpp;hxx;hm;inl;inc;xsd 11 | 12 | 13 | {67DA6AB6-F800-4c08-8B7A-83BB121AAD01} 14 | rc;ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe;resx;tiff;tif;png;wav;mfcribbon-ms 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 头文件 23 | 24 | 25 | 头文件 26 | 27 | 28 | 29 | 30 | 源文件 31 | 32 | 33 | 源文件 34 | 35 | 36 | 37 | 38 | 39 | -------------------------------------------------------------------------------- /TestCase/stdafx.cpp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ccpwcn/LogUtilMan/4b7910b01bc56949081ef90b3607365e4d4e2717/TestCase/stdafx.cpp -------------------------------------------------------------------------------- /TestCase/stdafx.h: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ccpwcn/LogUtilMan/4b7910b01bc56949081ef90b3607365e4d4e2717/TestCase/stdafx.h -------------------------------------------------------------------------------- /TestCase/targetver.h: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ccpwcn/LogUtilMan/4b7910b01bc56949081ef90b3607365e4d4e2717/TestCase/targetver.h -------------------------------------------------------------------------------- /性能测试数据分析.xlsx: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ccpwcn/LogUtilMan/4b7910b01bc56949081ef90b3607365e4d4e2717/性能测试数据分析.xlsx -------------------------------------------------------------------------------- /总完成时长.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ccpwcn/LogUtilMan/4b7910b01bc56949081ef90b3607365e4d4e2717/总完成时长.png -------------------------------------------------------------------------------- /最大入队时长.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ccpwcn/LogUtilMan/4b7910b01bc56949081ef90b3607365e4d4e2717/最大入队时长.png --------------------------------------------------------------------------------