4
* Copyright (C) 2006-2007 Hubert Figuiere
6
* This library is free software: you can redistribute it and/or
7
* modify it under the terms of the GNU Lesser General Public License
8
* as published by the Free Software Foundation, either version 3 of
9
* the License, or (at your option) any later version.
11
* This library is distributed in the hope that it will be useful,
12
* but WITHOUT ANY WARRANTY; without even the implied warranty of
13
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
14
* Lesser General Public License for more details.
16
* You should have received a copy of the GNU Lesser General Public
17
* License along with this library. If not, see
18
* <http://www.gnu.org/licenses/>.
22
#ifndef _OPENRAWPP_DEBUG_H_
23
#define _OPENRAWPP_DEBUG_H_
29
#include <boost/bind.hpp>
31
#include <libopenraw/debug.h>
36
/** a basic Trace class for debug */
41
Trace(debug_level level)
45
Trace & operator<<(int i);
46
Trace & operator<<(const char * s);
47
Trace & operator<<(void *);
48
Trace & operator<<(const std::string & s);
51
Trace & operator<<(const std::vector<T> & v);
53
static void setDebugLevel(debug_level lvl);
55
static void print(int i);
56
static int debugLevel; // global debug level
62
Trace & Trace::operator<<(const std::vector<T> & v)
64
if (m_level <= debugLevel) {
65
std::for_each(v.begin(), v.end(), boost::bind(&print, _1));