summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorGeorge Hazan <george.hazan@gmail.com>2013-08-12 21:55:48 +0000
committerGeorge Hazan <george.hazan@gmail.com>2013-08-12 21:55:48 +0000
commit9f06e7ffdd6458dd25bfd5b915cb788bab03bea0 (patch)
tree28acaca0e311896ee60299e4ca055a5cc7a5cb3a /src
parentd60f928fe512a067719cfc6e9a88eb9d56ad47ac (diff)
simple core logger
git-svn-id: http://svn.miranda-ng.org/main/trunk@5664 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c
Diffstat (limited to 'src')
-rw-r--r--src/mir_core/mir_core.def5
-rw-r--r--src/mir_core/mir_core_10.vcxproj1
-rw-r--r--src/mir_core/mir_core_10.vcxproj.filters3
-rw-r--r--src/mir_core/mir_core_11.vcxproj1
-rw-r--r--src/mir_core/mir_core_11.vcxproj.filters3
-rw-r--r--src/mir_core/miranda.cpp11
6 files changed, 24 insertions, 0 deletions
diff --git a/src/mir_core/mir_core.def b/src/mir_core/mir_core.def
index 32b1adecd8..c820c2dd59 100644
--- a/src/mir_core/mir_core.def
+++ b/src/mir_core/mir_core.def
@@ -222,3 +222,8 @@ ProtoGetAvatarFormat @219
ProtoGetAvatarExtension @220
ProtoGetBufferFormat @221
ProtoGetAvatarFileFormat @222
+mir_createLog @223
+mir_writeLogA @224
+mir_writeLogW @225
+mir_writeLogVA @226
+mir_writeLogVW @227
diff --git a/src/mir_core/mir_core_10.vcxproj b/src/mir_core/mir_core_10.vcxproj
index d8c3514a63..0b5efe22f5 100644
--- a/src/mir_core/mir_core_10.vcxproj
+++ b/src/mir_core/mir_core_10.vcxproj
@@ -98,6 +98,7 @@
<PrecompiledHeaderFile Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">..\commonheaders.h</PrecompiledHeaderFile>
<PrecompiledHeaderFile Condition="'$(Configuration)|$(Platform)'=='Release|x64'">..\commonheaders.h</PrecompiledHeaderFile>
</ClCompile>
+ <ClCompile Include="logger.cpp" />
<ClCompile Include="protos.cpp" />
<ClCompile Include="stdafx.cpp">
<PrecompiledHeader>Create</PrecompiledHeader>
diff --git a/src/mir_core/mir_core_10.vcxproj.filters b/src/mir_core/mir_core_10.vcxproj.filters
index 6d0a431685..1fafc175f9 100644
--- a/src/mir_core/mir_core_10.vcxproj.filters
+++ b/src/mir_core/mir_core_10.vcxproj.filters
@@ -97,6 +97,9 @@
<ClCompile Include="json\libJSON.cpp">
<Filter>Source Files\json</Filter>
</ClCompile>
+ <ClCompile Include="logger.cpp">
+ <Filter>Source Files</Filter>
+ </ClCompile>
</ItemGroup>
<ItemGroup>
<ClInclude Include="commonheaders.h">
diff --git a/src/mir_core/mir_core_11.vcxproj b/src/mir_core/mir_core_11.vcxproj
index f65e731e1d..e30f2719cc 100644
--- a/src/mir_core/mir_core_11.vcxproj
+++ b/src/mir_core/mir_core_11.vcxproj
@@ -93,6 +93,7 @@
<PrecompiledHeaderFile Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">../commonheaders.h</PrecompiledHeaderFile>
<PrecompiledHeaderFile Condition="'$(Configuration)|$(Platform)'=='Release|x64'">../commonheaders.h</PrecompiledHeaderFile>
</ClCompile>
+ <ClCompile Include="logger.cpp" />
<ClCompile Include="protos.cpp" />
<ClCompile Include="stdafx.cpp">
<PrecompiledHeader>Create</PrecompiledHeader>
diff --git a/src/mir_core/mir_core_11.vcxproj.filters b/src/mir_core/mir_core_11.vcxproj.filters
index 5603f49551..75eaf973e4 100644
--- a/src/mir_core/mir_core_11.vcxproj.filters
+++ b/src/mir_core/mir_core_11.vcxproj.filters
@@ -94,6 +94,9 @@
<ClCompile Include="json\libJSON.cpp">
<Filter>Source Files\json</Filter>
</ClCompile>
+ <ClCompile Include="logger.cpp">
+ <Filter>Source Files</Filter>
+ </ClCompile>
</ItemGroup>
<ItemGroup>
<ClInclude Include="commonheaders.h">
diff --git a/src/mir_core/miranda.cpp b/src/mir_core/miranda.cpp
index 571bbb811a..1508e3f4e7 100644
--- a/src/mir_core/miranda.cpp
+++ b/src/mir_core/miranda.cpp
@@ -29,6 +29,10 @@ HWND hAPCWindow = NULL;
int InitPathUtils(void);
void (*RecalculateTime)(void);
+void CheckLogs();
+void InitLogs();
+void UninitLogs();
+
int hLangpack = 0;
HINSTANCE hInst = 0;
@@ -47,8 +51,12 @@ static LRESULT CALLBACK APCWndProc(HWND hwnd, UINT msg, WPARAM wParam, LPARAM lP
return 0;
}
+ if (msg == WM_TIMER)
+ CheckLogs();
+
if (msg == WM_TIMECHANGE && RecalculateTime)
RecalculateTime();
+
return DefWindowProc(hwnd, msg, wParam, lParam);
}
@@ -68,6 +76,7 @@ static void LoadCoreModule(void)
hAPCWindow = CreateWindowEx(0, _T("STATIC"), NULL, 0, 0, 0, 0, 0, NULL, NULL, NULL, NULL);
SetWindowLongPtr(hAPCWindow, GWLP_WNDPROC, (LONG_PTR)APCWndProc);
+ SetTimer(hAPCWindow, 1, 60*1000, NULL);
hStackMutex = CreateMutex(NULL, FALSE, NULL);
hThreadQueueEmpty = CreateEvent(NULL, TRUE, TRUE, NULL);
@@ -79,6 +88,7 @@ static void LoadCoreModule(void)
RecalculateTime = (void (*)()) GetProcAddress(mirInst, "RecalculateTime");
InitPathUtils();
+ InitLogs();
InitialiseModularEngine();
InitProtocols();
}
@@ -93,6 +103,7 @@ MIR_CORE_DLL(void) UnloadCoreModule(void)
UninitSubclassing();
UninitProtocols();
DestroyModularEngine();
+ UninitLogs();
UnloadLangPackModule();
}