diff options
Diffstat (limited to 'protocols/Tox/src/tox_logger.h')
-rw-r--r-- | protocols/Tox/src/tox_logger.h | 28 |
1 files changed, 28 insertions, 0 deletions
diff --git a/protocols/Tox/src/tox_logger.h b/protocols/Tox/src/tox_logger.h new file mode 100644 index 0000000000..b460f87de7 --- /dev/null +++ b/protocols/Tox/src/tox_logger.h @@ -0,0 +1,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_
\ No newline at end of file |