Fix #3198585: Extra line breaks
[siplcs.git] / src / miranda / miranda-debug.c
blob368a923e5a3e97e81651f9a0e30c0447249e008e
1 /**
2 * @file miranda-debug.c
4 * pidgin-sipe
6 * Copyright (C) 2010 SIPE Project <http://sipe.sourceforge.net/>
8 * This program is free software; you can redistribute it and/or modify
9 * it under the terms of the GNU General Public License as published by
10 * the Free Software Foundation; either version 2 of the License, or
11 * (at your option) any later version.
13 * This program is distributed in the hope that it will be useful,
14 * but WITHOUT ANY WARRANTY; without even the implied warranty of
15 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
16 * GNU General Public License for more details.
18 * You should have received a copy of the GNU General Public License
19 * along with this program; if not, write to the Free Software
20 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
23 #include <windows.h>
24 #include <process.h>
25 #include <stdio.h>
27 #include <glib.h>
29 #include "newpluginapi.h"
30 #include "m_protosvc.h"
31 #include "m_protoint.h"
32 #include "m_netlib.h"
34 #include "sipe-backend.h"
35 #include "miranda-private.h"
37 extern HANDLE sipe_miranda_debug_netlibuser;
39 void sipe_backend_debug_literal(sipe_debug_level level,
40 const gchar *msg)
42 if (sipe_miranda_debug_netlibuser)
44 CallService(MS_NETLIB_LOG, (WPARAM)sipe_miranda_debug_netlibuser, (LPARAM)msg);
48 void sipe_backend_debug(sipe_debug_level level,
49 const gchar *format,
50 ...) G_GNUC_PRINTF(2, 3)
52 va_list ap;
54 va_start(ap,format);
56 if (sipe_backend_debug_enabled()) {
57 gchar *msg = g_strdup_vprintf(format, ap);
58 sipe_backend_debug_literal(level, msg);
59 g_free(msg);
62 va_end(ap);
65 gboolean sipe_backend_debug_enabled(void)
67 return TRUE;
71 Local Variables:
72 mode: c
73 c-file-style: "bsd"
74 indent-tabs-mode: t
75 tab-width: 8
76 End: