summaryrefslogtreecommitdiff
path: root/protocols/Tox/src/tox_logger.h
blob: b460f87de713f81b03393e59a47aa6716320a0aa (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
#ifndef _TOX_LOGGER_H_
#define _TOX_LOGGER_H_

class CLogger
{
private:
	HANDLE hNetlibUser;

public:
	CLogger(HANDLE hNetlibUser) : hNetlibUser(hNetlibUser) {}

	__inline void Log(LPCSTR szFormat, ...) const
	{
		va_list args;
		va_start(args, szFormat);
		CallService(MS_NETLIB_LOG, (WPARAM)hNetlibUser, (LPARAM)(CMStringA().FormatV(szFormat, args)));
		va_end(args);
	}
	__inline void Log(LPCWSTR wszFormat, ...) const
	{
		va_list args;
		va_start(args, wszFormat);
		CallService(MS_NETLIB_LOGW, (WPARAM)hNetlibUser, (LPARAM)(CMStringW().FormatV(wszFormat, args)));
		va_end(args);
	}
};

#endif //_TOX_LOGGER_H_