VirtualBox

source: vbox/trunk/src/VBox/Additions/WINNT/Mouse/common/VBoxMouseLog.h@ 68560

Last change on this file since 68560 was 68560, checked in by vboxsync, 7 years ago

merging vbglioc r117712: Mouse logging/assertions.

  • Property svn:eol-style set to native
  • Property svn:keywords set to Author Date Id Revision
File size: 2.5 KB
Line 
1/* $Id: VBoxMouseLog.h 68560 2017-08-31 12:10:10Z vboxsync $ */
2/** @file
3 * VBox Mouse drivers, logging helper
4 */
5
6/*
7 * Copyright (C) 2011-2016 Oracle Corporation
8 *
9 * This file is part of VirtualBox Open Source Edition (OSE), as
10 * available from http://www.virtualbox.org. This file is free software;
11 * you can redistribute it and/or modify it under the terms of the GNU
12 * General Public License (GPL) as published by the Free Software
13 * Foundation, in version 2 as it comes in the "COPYING" file of the
14 * VirtualBox OSE distribution. VirtualBox OSE is distributed in the
15 * hope that it will be useful, but WITHOUT ANY WARRANTY of any kind.
16 */
17
18#ifndef VBOXMOUSELOG_H
19#define VBOXMOUSELOG_H
20
21#include <VBox/log.h>
22#include <iprt/assert.h>
23
24#define VBOX_MOUSE_LOG_NAME "VBoxMouse"
25
26/* Uncomment to show file/line info in the log */
27/*#define VBOX_MOUSE_LOG_SHOWLINEINFO*/
28
29#define VBOX_MOUSE_LOG_PREFIX_FMT VBOX_MOUSE_LOG_NAME"::"LOG_FN_FMT": "
30#define VBOX_MOUSE_LOG_PREFIX_PARMS __PRETTY_FUNCTION__
31
32#ifdef VBOX_MOUSE_LOG_SHOWLINEINFO
33# define VBOX_MOUSE_LOG_SUFFIX_FMT " (%s:%d)\n"
34# define VBOX_MOUSE_LOG_SUFFIX_PARMS ,__FILE__, __LINE__
35#else
36# define VBOX_MOUSE_LOG_SUFFIX_FMT "\n"
37# define VBOX_MOUSE_LOG_SUFFIX_PARMS
38#endif
39
40#define _LOGMSG(_logger, _a) \
41 do \
42 { \
43 _logger((VBOX_MOUSE_LOG_PREFIX_FMT, VBOX_MOUSE_LOG_PREFIX_PARMS)); \
44 _logger(_a); \
45 _logger((VBOX_MOUSE_LOG_SUFFIX_FMT VBOX_MOUSE_LOG_SUFFIX_PARMS)); \
46 } while (0)
47
48#if 1 /* Exclude yourself if you're not keen on this. */
49# define BREAK_WARN() AssertFailed()
50#else
51# define BREAK_WARN() do {} while(0)
52#endif
53
54#define WARN(_a) \
55 do \
56 { \
57 Log((VBOX_MOUSE_LOG_PREFIX_FMT"WARNING! ", VBOX_MOUSE_LOG_PREFIX_PARMS)); \
58 Log(_a); \
59 Log((VBOX_MOUSE_LOG_SUFFIX_FMT VBOX_MOUSE_LOG_SUFFIX_PARMS)); \
60 BREAK_WARN(); \
61 } while (0)
62
63#define LOG(_a) _LOGMSG(Log, _a)
64#define LOGREL(_a) _LOGMSG(LogRel, _a)
65#define LOGF(_a) _LOGMSG(LogFlow, _a)
66#define LOGF_ENTER() LOGF(("ENTER"))
67#define LOGF_LEAVE() LOGF(("LEAVE"))
68
69#endif /* !VBOXMOUSELOG_H */
70
Note: See TracBrowser for help on using the repository browser.

© 2024 Oracle Support Privacy / Do Not Sell My Info Terms of Use Trademark Policy Automated Access Etiquette