From 9f06e7ffdd6458dd25bfd5b915cb788bab03bea0 Mon Sep 17 00:00:00 2001 From: George Hazan Date: Mon, 12 Aug 2013 21:55:48 +0000 Subject: simple core logger git-svn-id: http://svn.miranda-ng.org/main/trunk@5664 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c --- src/mir_core/mir_core.def | 5 +++++ src/mir_core/mir_core_10.vcxproj | 1 + src/mir_core/mir_core_10.vcxproj.filters | 3 +++ src/mir_core/mir_core_11.vcxproj | 1 + src/mir_core/mir_core_11.vcxproj.filters | 3 +++ src/mir_core/miranda.cpp | 11 +++++++++++ 6 files changed, 24 insertions(+) (limited to 'src/mir_core') 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 @@ ..\commonheaders.h ..\commonheaders.h + Create 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 @@ Source Files\json + + Source Files + 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 @@ ../commonheaders.h ../commonheaders.h + Create 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 @@ Source Files\json + + Source Files + 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(); } -- cgit v1.2.3