initial commit

This commit is contained in:
NanamiAdmin 2025-08-19 16:50:37 +08:00
commit 6ff5e69fa9
32 changed files with 325 additions and 0 deletions

BIN
.vs/Logger/v17/.suo Normal file

Binary file not shown.

BIN
.vs/Logger/v17/Browse.VC.db Normal file

Binary file not shown.

View File

@ -0,0 +1,37 @@
{
"Version": 1,
"WorkspaceRootPath": "F:\\Codes\\C\u002B\u002B\\Logger\\",
"Documents": [
{
"AbsoluteMoniker": "D:0:0:{A5E588FD-FFA1-40EC-AC4E-AD3B2C3B89C0}|Logger.vcxproj|F:\\Codes\\C\u002B\u002B\\Logger\\Logger.cpp||{D0E1A5C6-B359-4E41-9B60-3365922C2A22}",
"RelativeMoniker": "D:0:0:{A5E588FD-FFA1-40EC-AC4E-AD3B2C3B89C0}|Logger.vcxproj|solutionrelative:Logger.cpp||{D0E1A5C6-B359-4E41-9B60-3365922C2A22}"
}
],
"DocumentGroupContainers": [
{
"Orientation": 0,
"VerticalTabListWidth": 256,
"DocumentGroups": [
{
"DockedWidth": 200,
"SelectedChildIndex": 0,
"Children": [
{
"$type": "Document",
"DocumentIndex": 0,
"Title": "Logger.cpp",
"DocumentMoniker": "F:\\Codes\\C\u002B\u002B\\Logger\\Logger.cpp",
"RelativeDocumentMoniker": "Logger.cpp",
"ToolTip": "F:\\Codes\\C\u002B\u002B\\Logger\\Logger.cpp*",
"RelativeToolTip": "Logger.cpp*",
"ViewState": "AgIAAAAAAAAAAAAAAAAAABAAAAACAAAAAAAAAA==",
"Icon": "ae27a6b0-e345-4288-96df-5eaf394ee369.000677|",
"WhenOpened": "2025-08-19T04:36:46.727Z",
"EditorCaption": ""
}
]
}
]
}
]
}

View File

@ -0,0 +1,37 @@
{
"Version": 1,
"WorkspaceRootPath": "F:\\Codes\\C\u002B\u002B\\Logger\\",
"Documents": [
{
"AbsoluteMoniker": "D:0:0:{A5E588FD-FFA1-40EC-AC4E-AD3B2C3B89C0}|Logger.vcxproj|F:\\Codes\\C\u002B\u002B\\Logger\\Logger.cpp||{D0E1A5C6-B359-4E41-9B60-3365922C2A22}",
"RelativeMoniker": "D:0:0:{A5E588FD-FFA1-40EC-AC4E-AD3B2C3B89C0}|Logger.vcxproj|solutionrelative:Logger.cpp||{D0E1A5C6-B359-4E41-9B60-3365922C2A22}"
}
],
"DocumentGroupContainers": [
{
"Orientation": 0,
"VerticalTabListWidth": 256,
"DocumentGroups": [
{
"DockedWidth": 200,
"SelectedChildIndex": 0,
"Children": [
{
"$type": "Document",
"DocumentIndex": 0,
"Title": "Logger.cpp",
"DocumentMoniker": "F:\\Codes\\C\u002B\u002B\\Logger\\Logger.cpp",
"RelativeDocumentMoniker": "Logger.cpp",
"ToolTip": "F:\\Codes\\C\u002B\u002B\\Logger\\Logger.cpp",
"RelativeToolTip": "Logger.cpp",
"ViewState": "AgIAAAAAAAAAAAAAAAAAAAwAAAAZAAAAAAAAAA==",
"Icon": "ae27a6b0-e345-4288-96df-5eaf394ee369.000677|",
"WhenOpened": "2025-08-19T04:36:46.727Z",
"EditorCaption": ""
}
]
}
]
}
]
}

Binary file not shown.

45
Logger.cpp Normal file
View File

@ -0,0 +1,45 @@
#include <iostream>
#include <string>
#include <Windows.h>
#include <ctime>
using namespace std;
string timeNow;
void getSystemTime() {
time_t now = time(0);
tm ltm;
localtime_s(&ltm, &now);
string sec;
if (ltm.tm_sec < 10) {
sec = "0" + to_string(ltm.tm_sec);
}
timeNow = to_string(ltm.tm_year + 1900) + "-" +
to_string(ltm.tm_mon + 1) + "-" +
to_string(ltm.tm_mday) + " " +
to_string(ltm.tm_hour) + ":" +
to_string(ltm.tm_min) + ":" +
to_string(ltm.tm_sec);
}
void postLog(int level, const string &message) {
string levelStr;
switch (level) {
case 0:
levelStr = "DEBUG";
break;
case 1:
levelStr = "INFO";
break;
case 2:
levelStr = "WARNING";
break;
case 3:
levelStr = "ERROR";
break;
default:
levelStr = "UNKNOWN";
}
cout << "[" << timeNow << " - " << levelStr << "] " << message << endl;
}

31
Logger.sln Normal file
View File

@ -0,0 +1,31 @@

Microsoft Visual Studio Solution File, Format Version 12.00
# Visual Studio Version 17
VisualStudioVersion = 17.14.36408.4 d17.14
MinimumVisualStudioVersion = 10.0.40219.1
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "Logger", "Logger.vcxproj", "{A5E588FD-FFA1-40EC-AC4E-AD3B2C3B89C0}"
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Debug|x64 = Debug|x64
Debug|x86 = Debug|x86
Release|x64 = Release|x64
Release|x86 = Release|x86
EndGlobalSection
GlobalSection(ProjectConfigurationPlatforms) = postSolution
{A5E588FD-FFA1-40EC-AC4E-AD3B2C3B89C0}.Debug|x64.ActiveCfg = Debug|x64
{A5E588FD-FFA1-40EC-AC4E-AD3B2C3B89C0}.Debug|x64.Build.0 = Debug|x64
{A5E588FD-FFA1-40EC-AC4E-AD3B2C3B89C0}.Debug|x86.ActiveCfg = Debug|Win32
{A5E588FD-FFA1-40EC-AC4E-AD3B2C3B89C0}.Debug|x86.Build.0 = Debug|Win32
{A5E588FD-FFA1-40EC-AC4E-AD3B2C3B89C0}.Release|x64.ActiveCfg = Release|x64
{A5E588FD-FFA1-40EC-AC4E-AD3B2C3B89C0}.Release|x64.Build.0 = Release|x64
{A5E588FD-FFA1-40EC-AC4E-AD3B2C3B89C0}.Release|x86.ActiveCfg = Release|Win32
{A5E588FD-FFA1-40EC-AC4E-AD3B2C3B89C0}.Release|x86.Build.0 = Release|Win32
EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE
EndGlobalSection
GlobalSection(ExtensibilityGlobals) = postSolution
SolutionGuid = {CE7130CB-CE23-48D4-B5AB-5467E89F2E3C}
EndGlobalSection
EndGlobal

131
Logger.vcxproj Normal file
View File

@ -0,0 +1,131 @@
<?xml version="1.0" encoding="utf-8"?>
<Project DefaultTargets="Build" 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>
<ProjectConfiguration Include="Debug|x64">
<Configuration>Debug</Configuration>
<Platform>x64</Platform>
</ProjectConfiguration>
<ProjectConfiguration Include="Release|x64">
<Configuration>Release</Configuration>
<Platform>x64</Platform>
</ProjectConfiguration>
</ItemGroup>
<PropertyGroup Label="Globals">
<VCProjectVersion>17.0</VCProjectVersion>
<Keyword>Win32Proj</Keyword>
<ProjectGuid>{a5e588fd-ffa1-40ec-ac4e-ad3b2c3b89c0}</ProjectGuid>
<RootNamespace>Logger</RootNamespace>
<WindowsTargetPlatformVersion>10.0</WindowsTargetPlatformVersion>
</PropertyGroup>
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" />
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" Label="Configuration">
<ConfigurationType>Application</ConfigurationType>
<UseDebugLibraries>true</UseDebugLibraries>
<PlatformToolset>v143</PlatformToolset>
<CharacterSet>Unicode</CharacterSet>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" Label="Configuration">
<ConfigurationType>Application</ConfigurationType>
<UseDebugLibraries>false</UseDebugLibraries>
<PlatformToolset>v143</PlatformToolset>
<WholeProgramOptimization>true</WholeProgramOptimization>
<CharacterSet>Unicode</CharacterSet>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'" Label="Configuration">
<ConfigurationType>Application</ConfigurationType>
<UseDebugLibraries>true</UseDebugLibraries>
<PlatformToolset>v143</PlatformToolset>
<CharacterSet>Unicode</CharacterSet>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'" Label="Configuration">
<ConfigurationType>Application</ConfigurationType>
<UseDebugLibraries>false</UseDebugLibraries>
<PlatformToolset>v143</PlatformToolset>
<WholeProgramOptimization>true</WholeProgramOptimization>
<CharacterSet>Unicode</CharacterSet>
</PropertyGroup>
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.props" />
<ImportGroup Label="ExtensionSettings">
</ImportGroup>
<ImportGroup Label="Shared">
</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" />
</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" />
</ImportGroup>
<ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
</ImportGroup>
<ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
</ImportGroup>
<PropertyGroup Label="UserMacros" />
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
<ClCompile>
<WarningLevel>Level3</WarningLevel>
<SDLCheck>true</SDLCheck>
<PreprocessorDefinitions>WIN32;_DEBUG;_CONSOLE;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<ConformanceMode>true</ConformanceMode>
</ClCompile>
<Link>
<SubSystem>Console</SubSystem>
<GenerateDebugInformation>true</GenerateDebugInformation>
</Link>
</ItemDefinitionGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
<ClCompile>
<WarningLevel>Level3</WarningLevel>
<FunctionLevelLinking>true</FunctionLevelLinking>
<IntrinsicFunctions>true</IntrinsicFunctions>
<SDLCheck>true</SDLCheck>
<PreprocessorDefinitions>WIN32;NDEBUG;_CONSOLE;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<ConformanceMode>true</ConformanceMode>
</ClCompile>
<Link>
<SubSystem>Console</SubSystem>
<GenerateDebugInformation>true</GenerateDebugInformation>
</Link>
</ItemDefinitionGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
<ClCompile>
<WarningLevel>Level3</WarningLevel>
<SDLCheck>true</SDLCheck>
<PreprocessorDefinitions>_DEBUG;_CONSOLE;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<ConformanceMode>true</ConformanceMode>
</ClCompile>
<Link>
<SubSystem>Console</SubSystem>
<GenerateDebugInformation>true</GenerateDebugInformation>
</Link>
</ItemDefinitionGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
<ClCompile>
<WarningLevel>Level3</WarningLevel>
<FunctionLevelLinking>true</FunctionLevelLinking>
<IntrinsicFunctions>true</IntrinsicFunctions>
<SDLCheck>true</SDLCheck>
<PreprocessorDefinitions>NDEBUG;_CONSOLE;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<ConformanceMode>true</ConformanceMode>
</ClCompile>
<Link>
<SubSystem>Console</SubSystem>
<GenerateDebugInformation>true</GenerateDebugInformation>
</Link>
</ItemDefinitionGroup>
<ItemGroup>
<ClCompile Include="Logger.cpp" />
</ItemGroup>
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />
<ImportGroup Label="ExtensionTargets">
</ImportGroup>
</Project>

22
Logger.vcxproj.filters Normal file
View File

@ -0,0 +1,22 @@
<?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<ItemGroup>
<Filter Include="Source Files">
<UniqueIdentifier>{4FC737F1-C7A5-4376-A066-2A32D752A2FF}</UniqueIdentifier>
<Extensions>cpp;c;cc;cxx;c++;cppm;ixx;def;odl;idl;hpj;bat;asm;asmx</Extensions>
</Filter>
<Filter Include="Header Files">
<UniqueIdentifier>{93995380-89BD-4b04-88EB-625FBE52EBFB}</UniqueIdentifier>
<Extensions>h;hh;hpp;hxx;h++;hm;inl;inc;ipp;xsd</Extensions>
</Filter>
<Filter Include="Resource Files">
<UniqueIdentifier>{67DA6AB6-F800-4c08-8B7A-83BB121AAD01}</UniqueIdentifier>
<Extensions>rc;ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe;resx;tiff;tif;png;wav;mfcribbon-ms</Extensions>
</Filter>
</ItemGroup>
<ItemGroup>
<ClCompile Include="Logger.cpp">
<Filter>Source Files</Filter>
</ClCompile>
</ItemGroup>
</Project>

4
Logger.vcxproj.user Normal file
View File

@ -0,0 +1,4 @@
<?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="Current" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<PropertyGroup />
</Project>

View File

@ -0,0 +1,11 @@
<?xml version="1.0" encoding="utf-8"?>
<Project>
<ProjectOutputs>
<ProjectOutput>
<FullPath>F:\Codes\C++\Logger\x64\Debug\Logger.exe</FullPath>
</ProjectOutput>
</ProjectOutputs>
<ContentFiles />
<SatelliteDlls />
<NonRecipeFileRefs />
</Project>

BIN
Logger/x64/Debug/Logger.ilk Normal file

Binary file not shown.

View File

@ -0,0 +1,2 @@
 Logger.cpp
Logger.vcxproj -> F:\Codes\C++\Logger\x64\Debug\Logger.exe

BIN
Logger/x64/Debug/Logger.obj Normal file

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

View File

@ -0,0 +1 @@
F:\Codes\C++\Logger\Logger.cpp;F:\Codes\C++\Logger\Logger\x64\Debug\Logger.obj

View File

@ -0,0 +1,2 @@
PlatformToolSet=v143:VCToolArchitecture=Native64Bit:VCToolsVersion=14.44.35207:TargetPlatformVersion=10.0.26100.0:
Debug|x64|F:\Codes\C++\Logger\|

Binary file not shown.

Binary file not shown.

View File

@ -0,0 +1,2 @@
^F:\CODES\C++\LOGGER\LOGGER\X64\DEBUG\LOGGER.OBJ
F:\Codes\C++\Logger\Logger\x64\Debug\Logger.ilk

Binary file not shown.

BIN
Logger/x64/Debug/vc143.idb Normal file

Binary file not shown.

BIN
Logger/x64/Debug/vc143.pdb Normal file

Binary file not shown.

BIN
x64/Debug/Logger.exe Normal file

Binary file not shown.

BIN
x64/Debug/Logger.pdb Normal file

Binary file not shown.