VirtualBox

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

Last change on this file since 76540 was 76540, checked in by vboxsync, 6 years ago

Additions/WINNT: scm --fix-header-guards. bugref:9344

  • Property svn:eol-style set to native
  • Property svn:keywords set to Author Date Id Revision
File size: 2.6 KB
Line 
1/* $Id: VBoxMouseLog.h 76540 2018-12-30 06:26:37Z vboxsync $ */
2/** @file
3 * VBox Mouse drivers, logging helper
4 */
5
6/*
7 * Copyright (C) 2011-2017 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#ifndef RT_WITHOUT_PRAGMA_ONCE
21# pragma once
22#endif
23
24#include <VBox/log.h>
25#include <iprt/assert.h>
26
27#define VBOX_MOUSE_LOG_NAME "VBoxMouse"
28
29/* Uncomment to show file/line info in the log */
30/*#define VBOX_MOUSE_LOG_SHOWLINEINFO*/
31
32#define VBOX_MOUSE_LOG_PREFIX_FMT VBOX_MOUSE_LOG_NAME"::"LOG_FN_FMT": "
33#define VBOX_MOUSE_LOG_PREFIX_PARMS __PRETTY_FUNCTION__
34
35#ifdef VBOX_MOUSE_LOG_SHOWLINEINFO
36# define VBOX_MOUSE_LOG_SUFFIX_FMT " (%s:%d)\n"
37# define VBOX_MOUSE_LOG_SUFFIX_PARMS ,__FILE__, __LINE__
38#else
39# define VBOX_MOUSE_LOG_SUFFIX_FMT "\n"
40# define VBOX_MOUSE_LOG_SUFFIX_PARMS
41#endif
42
43#define _LOGMSG(_logger, _a) \
44 do \
45 { \
46 _logger((VBOX_MOUSE_LOG_PREFIX_FMT, VBOX_MOUSE_LOG_PREFIX_PARMS)); \
47 _logger(_a); \
48 _logger((VBOX_MOUSE_LOG_SUFFIX_FMT VBOX_MOUSE_LOG_SUFFIX_PARMS)); \
49 } while (0)
50
51#if 1 /* Exclude yourself if you're not keen on this. */
52# define BREAK_WARN() AssertFailed()
53#else
54# define BREAK_WARN() do {} while(0)
55#endif
56
57#define WARN(_a) \
58 do \
59 { \
60 Log((VBOX_MOUSE_LOG_PREFIX_FMT"WARNING! ", VBOX_MOUSE_LOG_PREFIX_PARMS)); \
61 Log(_a); \
62 Log((VBOX_MOUSE_LOG_SUFFIX_FMT VBOX_MOUSE_LOG_SUFFIX_PARMS)); \
63 BREAK_WARN(); \
64 } while (0)
65
66#define LOG(_a) _LOGMSG(Log, _a)
67#define LOGREL(_a) _LOGMSG(LogRel, _a)
68#define LOGF(_a) _LOGMSG(LogFlow, _a)
69#define LOGF_ENTER() LOGF(("ENTER"))
70#define LOGF_LEAVE() LOGF(("LEAVE"))
71
72#endif /* !VBOXMOUSELOG_H */
73
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