/usr/include/stxxl/bits/verbose.h is in libstxxl-dev 1.3.1-5ubuntu1.
This file is owned by root:root, with mode 0o644.
The actual contents of the file can be viewed below.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 | /***************************************************************************
* include/stxxl/bits/verbose.h
*
* Part of the STXXL. See http://stxxl.sourceforge.net
*
* Copyright (C) 2005-2006 Roman Dementiev <dementiev@mpi-sb.mpg.de>
* Copyright (C) 2007-2010 Andreas Beckmann <beckmann@cs.uni-frankfurt.de>
*
* Distributed under the Boost Software License, Version 1.0.
* (See accompanying file LICENSE_1_0.txt or copy at
* http://www.boost.org/LICENSE_1_0.txt)
**************************************************************************/
#ifndef STXXL_VERBOSE_HEADER
#define STXXL_VERBOSE_HEADER
#include <iostream>
#include <sstream>
#include <string>
#include <stxxl/bits/unused.h>
#define _STXXL_PRNT_COUT (1 << 0)
#define _STXXL_PRNT_CERR (1 << 1)
#define _STXXL_PRNT_LOG (1 << 2)
#define _STXXL_PRNT_ERRLOG (1 << 3)
#define _STXXL_PRNT_ADDNEWLINE (1 << 16)
#define _STXXL_PRNT_TIMESTAMP (1 << 17)
#define _STXXL_PRNT_THREAD_ID (1 << 18)
#define _STXXL_PRINT_FLAGS_DEFAULT (_STXXL_PRNT_COUT | _STXXL_PRNT_LOG)
#define _STXXL_PRINT_FLAGS_ERROR (_STXXL_PRNT_CERR | _STXXL_PRNT_ERRLOG)
#define _STXXL_PRINT_FLAGS_VERBOSE (_STXXL_PRINT_FLAGS_DEFAULT | _STXXL_PRNT_TIMESTAMP | _STXXL_PRNT_THREAD_ID)
__STXXL_BEGIN_NAMESPACE
void print_msg(const char * label, const std::string & msg, unsigned flags);
__STXXL_END_NAMESPACE
#define _STXXL_PRINT(label, message, flags) \
do { \
std::ostringstream str_; \
str_ << message; \
stxxl::print_msg(label, str_.str(), flags | _STXXL_PRNT_ADDNEWLINE); \
} while (false)
#define _STXXL_NOT_VERBOSE do { } while (false)
#ifdef STXXL_FORCE_VERBOSE_LEVEL
#undef STXXL_VERBOSE_LEVEL
#define STXXL_VERBOSE_LEVEL STXXL_FORCE_VERBOSE_LEVEL
#endif
#ifdef STXXL_DEFAULT_VERBOSE_LEVEL
#ifndef STXXL_VERBOSE_LEVEL
#define STXXL_VERBOSE_LEVEL STXXL_DEFAULT_VERBOSE_LEVEL
#endif
#endif
#ifndef STXXL_VERBOSE_LEVEL
#define STXXL_VERBOSE_LEVEL -1
#endif
#if STXXL_VERBOSE_LEVEL > -10
#define STXXL_MSG(x) _STXXL_PRINT("STXXL-MSG", x, _STXXL_PRINT_FLAGS_DEFAULT)
#else
// Please do not report STXXL problems with STXXL_MSG disabled!
#define STXXL_MSG(x) _STXXL_NOT_VERBOSE
#endif
#if STXXL_VERBOSE_LEVEL > -100
#define STXXL_ERRMSG(x) _STXXL_PRINT("STXXL-ERRMSG", x, _STXXL_PRINT_FLAGS_ERROR)
#else
// Please do not report STXXL problems with STXXL_ERRMSG disabled!
#define STXXL_ERRMSG(x) _STXXL_NOT_VERBOSE
#endif
// STXXL_VERBOSE0 should be used for current debugging activity only,
// and afterwards be replaced by STXXL_VERBOSE1 or higher.
// Code that actively uses STXXL_VERBOSE0 should never get into a release.
#if STXXL_VERBOSE_LEVEL > -1
#define STXXL_VERBOSE0(x) _STXXL_PRINT("STXXL-VERBOSE0", x, _STXXL_PRINT_FLAGS_VERBOSE)
#else
#define STXXL_VERBOSE0(x) _STXXL_NOT_VERBOSE
#endif
#if STXXL_VERBOSE_LEVEL > 0
#define STXXL_VERBOSE1(x) _STXXL_PRINT("STXXL-VERBOSE1", x, _STXXL_PRINT_FLAGS_VERBOSE)
#else
#define STXXL_VERBOSE1(x) _STXXL_NOT_VERBOSE
#endif
#define STXXL_VERBOSE(x) STXXL_VERBOSE1(x)
#if STXXL_VERBOSE_LEVEL > 1
#define STXXL_VERBOSE2(x) _STXXL_PRINT("STXXL-VERBOSE2", x, _STXXL_PRINT_FLAGS_VERBOSE)
#else
#define STXXL_VERBOSE2(x) _STXXL_NOT_VERBOSE
#endif
#if STXXL_VERBOSE_LEVEL > 2
#define STXXL_VERBOSE3(x) _STXXL_PRINT("STXXL-VERBOSE3", x, _STXXL_PRINT_FLAGS_VERBOSE)
#else
#define STXXL_VERBOSE3(x) _STXXL_NOT_VERBOSE
#endif
////////////////////////////////////////////////////////////////////////////
#ifdef BOOST_MSVC
#define stxxl_win_lasterror_exit(errmsg, exception_type) \
do { \
LPVOID lpMsgBuf; \
DWORD dw = GetLastError(); \
FormatMessage( \
FORMAT_MESSAGE_ALLOCATE_BUFFER | \
FORMAT_MESSAGE_FROM_SYSTEM, \
NULL, \
dw, \
MAKELANGID(LANG_NEUTRAL, SUBLANG_DEFAULT), \
(LPTSTR)&lpMsgBuf, \
0, NULL); \
std::ostringstream str_; \
str_ << "Error in " << errmsg << ", error code " << dw << ": " << ((char *)lpMsgBuf); \
LocalFree(lpMsgBuf); \
throw exception_type(str_.str()); \
} while (false)
#endif
#endif // !STXXL_VERBOSE_HEADER
// vim: et:ts=4:sw=4
|