VirtualBox

source: vbox/trunk/src/VBox/Additions/WINNT/Graphics/Video/common/VBoxVideoLog.h@ 37490

Last change on this file since 37490 was 37490, checked in by vboxsync, 14 years ago

wddm: autoresize fixes

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

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