summaryrefslogtreecommitdiff
path: root/protocols/YAMN/src/debug.cpp
blob: 92d5a0b3c4427ca0d53de801e2b4d926e995e246 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
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
/*
 * YAMN plugin main file
 * Miranda homepage: http://miranda-icq.sourceforge.net/
 *
 * Debug functions used in DEBUG release (you need to global #define DEBUG to get debug version)
 *
 * (c) majvan 2002-2004
 */

#include "stdafx.h"

#ifdef _DEBUG

#ifdef DEBUG_COMM
HANDLE CommFile;
#endif

#ifdef DEBUG_DECODE
HANDLE DecodeFile;
#endif

//--------------------------------------------------------------------------------------------------
//--------------------------------------------------------------------------------------------------

void InitDebug()
{
#ifdef DEBUG_COMM
	CommFile = mir_createLog("YAMN_comm", L"", VARSW(L"%miranda_userdata%\\yamn-debug.comm.log"), 0);
	mir_writeLogA(CommFile,"Communication debug file created by %s\n",YAMN_VER);
#endif

#ifdef DEBUG_DECODE
	DecodeFile = mir_createLog("YAMN_comm", L"", VARSW(L"%miranda_userdata%\\yamn-debug.decode.log"), 0);
	mir_writeLogA(DecodeFile, "Decoding kernel debug file created by %s\n", YAMN_VER);
#endif
}

void UnInitDebug()
{
#ifdef DEBUG_COMM
	mir_writeLogA(CommFile,"File is being closed normally.");
#endif
#ifdef DEBUG_DECODE
	mir_writeLogA(DecodeFile,"File is being closed normally.");
#endif
}

#endif	//ifdef DEBUG