3 /// General header for the Barry library
7 Copyright (C) 2008-2010, Net Direct Inc. (http://www.netdirect.ca/)
9 This program is free software; you can redistribute it and/or modify
10 it under the terms of the GNU General Public License as published by
11 the Free Software Foundation; either version 2 of the License, or
12 (at your option) any later version.
14 This program is distributed in the hope that it will be useful,
15 but WITHOUT ANY WARRANTY; without even the implied warranty of
16 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
18 See the GNU General Public License in the COPYING file at the
19 root directory of this project for more details.
22 #ifndef __BARRY_LOG_H__
23 #define __BARRY_LOG_H__
33 /// RAII locking class used to protect the logStream passed into
34 /// Barry::Init() (common.h). If the application uses the same stream for
35 /// its own logging, it should use this lock class, or use the macros
38 class BXEXPORT LogLock
45 BXEXPORT
bool LogVerbose();
46 BXEXPORT
std::ostream
* GetLogStream();
50 #define barrylog(x) { ::Barry::LogLock lock; (*::Barry::GetLogStream()) << x << std::endl; }
52 // controlled by command line -v switch
53 #define barryverbose(x) if(::Barry::LogVerbose()) { ::Barry::LogLock lock; (*::Barry::GetLogStream()) << x << std::endl; }
55 #endif // __BARRY_LOG_H__