/usr/include/wv2/wvlog.h is in libwv2-dev 0.4.2.dfsg.1-4.
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 | /* This file is part of the wvWare 2 project
Copyright (C) 2003 Werner Trobin <trobin@kde.org>
This library is free software; you can redistribute it and/or
modify it under the terms of the GNU Library General Public
License version 2 as published by the Free Software Foundation.
This library is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
Library General Public License for more details.
You should have received a copy of the GNU Library General Public License
along with this library; see the file COPYING.LIB. If not, write to
the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
Boston, MA 02111-1307, USA.
*/
#ifndef WVLOG_H
#define WVLOG_H
#include <iostream>
#include <string> // Make gcc 2.95.x happy
// ...and work around gcc 2.95.x's STL problems (e.g. ostream isn't a template)
#if defined(__GNUC__)
# if __GNUC__ < 3
# define WV2_OLD_STL_WORKAROUND 1
# endif
#endif
/**
* @file A very primitve logging mechanism used to disable any
* debug output for release builds. Use it like std::cerr, as it
* is std::cerr (if it's enabled).
*/
namespace wvWare
{
class wvdebugstream
{
public:
#ifdef WV2_OLD_STL_WORKAROUND
const wvdebugstream& operator<<( ostream& (*__pf)( ostream& ) ) const { std::cerr << __pf; return *this; }
const wvdebugstream& operator<<( ios (*__pf)( ios& ) ) const { std::cerr << __pf; return *this; }
#else
const wvdebugstream& operator<<( std::basic_ostream<char>& (*__pf)( std::basic_ostream<char>& ) ) const { std::cerr << __pf; return *this; }
const wvdebugstream& operator<<( std::ios (*__pf)( std::ios& ) ) const { std::cerr << __pf; return *this; }
const wvdebugstream& operator<<( std::ios_base& (*__pf) ( std::ios_base& ) ) const { std::cerr << __pf; return *this; }
#endif
const wvdebugstream& operator<<( long l ) const { std::cerr << l; return *this; }
const wvdebugstream& operator<<( unsigned long l ) const { std::cerr << l; return *this; }
const wvdebugstream& operator<<( bool b ) const { std::cerr << b; return *this; }
const wvdebugstream& operator<<( short s ) const { std::cerr << s; return *this; }
const wvdebugstream& operator<<( unsigned short s ) const { std::cerr << s; return *this; }
const wvdebugstream& operator<<( int i ) const { std::cerr << i; return *this; }
const wvdebugstream& operator<<( unsigned int i ) const { std::cerr << i; return *this; }
const wvdebugstream& operator<<( double d ) const { std::cerr << d; return *this; }
const wvdebugstream& operator<<( float f ) const { std::cerr << f; return *this; }
const wvdebugstream& operator<<( long double d ) const { std::cerr << d; return *this; }
const wvdebugstream& operator<<( const void* cv ) const { std::cerr << cv; return *this; }
#ifdef WV2_OLD_STL_WORKAROUND
const wvdebugstream& operator<<( streambuf* s ) const { std::cerr << s; return *this; }
#else
const wvdebugstream& operator<<( std::basic_streambuf<char>* s ) const { std::cerr << s; return *this; }
#endif
const wvdebugstream& operator<<( signed char c ) const { std::cerr << c; return *this; }
const wvdebugstream& operator<<( unsigned char c ) const { std::cerr << c; return *this; }
const wvdebugstream& operator<<( const char* s ) const { std::cerr << s; return *this; }
const wvdebugstream& operator<<( const std::string& s ) const { std::cerr << s; return *this; }
};
class wvnodebugstream
{
public:
#ifdef WV2_OLD_STL_WORKAROUND
const wvnodebugstream& operator<<( ostream& (*__pf)( ostream& ) ) const { std::cerr << __pf; return *this; }
const wvnodebugstream& operator<<( ios (*__pf)( ios& ) ) const { std::cerr << __pf; return *this; }
#else
const wvnodebugstream& operator<<( std::basic_ostream<char>& (*__pf)( std::basic_ostream<char>& ) ) const { return *this; }
const wvnodebugstream& operator<<( std::ios (*__pf)( std::ios& ) ) const { return *this; }
const wvnodebugstream& operator<<( std::ios_base& (*__pf) ( std::ios_base& ) ) const { return *this; }
#endif
const wvnodebugstream& operator<<( long ) const { return *this; }
const wvnodebugstream& operator<<( unsigned long ) const { return *this; }
const wvnodebugstream& operator<<( bool ) const { return *this; }
const wvnodebugstream& operator<<( short ) const { return *this; }
const wvnodebugstream& operator<<( unsigned short ) const { return *this; }
const wvnodebugstream& operator<<( int ) const { return *this; }
const wvnodebugstream& operator<<( unsigned int ) const { return *this; }
const wvnodebugstream& operator<<( double ) const { return *this; }
const wvnodebugstream& operator<<( float ) const { return *this; }
const wvnodebugstream& operator<<( long double ) const { return *this; }
const wvnodebugstream& operator<<( const void* ) const { return *this; }
#ifdef WV2_OLD_STL_WORKAROUND
const wvnodebugstream& operator<<( streambuf* ) const { return *this; }
#else
const wvnodebugstream& operator<<( std::basic_streambuf<char>* ) const { return *this; }
#endif
const wvnodebugstream& operator<<( signed char ) const { return *this; }
const wvnodebugstream& operator<<( unsigned char ) const { return *this; }
const wvnodebugstream& operator<<( const char* ) const { return *this; }
const wvnodebugstream& operator<<( const std::string& ) const { return *this; }
};
#ifdef NDEBUG
typedef wvnodebugstream wvlogstream;
#else
typedef wvdebugstream wvlogstream;
#endif
extern const wvlogstream wvlog;
} // wvWare
#endif // WVLOG_H
|