LSSTApplications
10.0+286,10.0+36,10.0+46,10.0-2-g4f67435,10.1+152,10.1+37,11.0,11.0+1,11.0-1-g47edd16,11.0-1-g60db491,11.0-1-g7418c06,11.0-2-g04d2804,11.0-2-g68503cd,11.0-2-g818369d,11.0-2-gb8b8ce7
LSSTDataManagementBasePackage
Main Page
Related Pages
Modules
Namespaces
Classes
Files
Examples
File List
File Members
home
lsstsw
stack
Linux64
pex_logging
11.0+1
include
lsst
pex
logging
Debug.h
Go to the documentation of this file.
1
// -*- lsst-c++ -*-
2
3
/*
4
* LSST Data Management System
5
* Copyright 2008, 2009, 2010 LSST Corporation.
6
*
7
* This product includes software developed by the
8
* LSST Project (http://www.lsst.org/).
9
*
10
* This program is free software: you can redistribute it and/or modify
11
* it under the terms of the GNU General Public License as published by
12
* the Free Software Foundation, either version 3 of the License, or
13
* (at your option) any later version.
14
*
15
* This program is distributed in the hope that it will be useful,
16
* but WITHOUT ANY WARRANTY; without even the implied warranty of
17
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
18
* GNU General Public License for more details.
19
*
20
* You should have received a copy of the LSST License Statement and
21
* the GNU General Public License along with this program. If not,
22
* see <http://www.lsstcorp.org/LegalNotices/>.
23
*/
24
30
#ifndef LSST_PEX_LOGGING_DEBUG_H
31
#define LSST_PEX_LOGGING_DEBUG_H
32
33
#include "
lsst/pex/logging/Log.h
"
34
#include <cstdarg>
35
36
namespace
lsst {
37
namespace
pex {
38
namespace
logging {
39
40
#ifndef LSST_DEBUGGING_ON
41
#define LSST_DEBUGGING_ON
42
#endif
43
44
#ifdef LSST_NO_DEBUG
45
#undef LSST_DEBUGGING_ON
46
#undef LSST_MAX_DEBUG
47
#endif
48
49
#ifndef LSST_DEBUGGING_ON
50
#ifndef LSST_MAX_DEBUG
51
#define LSST_MAX_DEBUG 0
52
#endif
53
#endif
54
55
#ifndef LSST_MAX_DEBUG
56
#define LSST_MAX_DEBUG 0
57
#endif
58
75
class
Debug
:
public
Log
{
76
public
:
77
78
Debug
(
const
std::string&
name
,
int
verbosity=-1*
Log::INHERIT_THRESHOLD
)
79
:
Log
(
Log
::
getDefaultLog
(), name, -1*verbosity) { }
80
81
Debug
(
const
Log
& parent,
const
std::string&
name
,
82
int
verbosity=-1*
Log::INHERIT_THRESHOLD
)
83
:
Log
(parent, name , -1*verbosity) { }
84
Debug
(
const
Debug
& that) :
Log
(that) { }
85
86
Debug
&
operator=
(
const
Debug
& that) {
87
if
(
this
!= &that)
dynamic_cast<
Log
*
>
(
this
)->
operator
=(that);
88
return
*
this
;
89
}
90
104
void
debug
(
int
verbosity,
const
std::string& message) {
105
log
(-1*verbosity, message);
106
}
107
118
void
debug
(
int
verbosity,
const
boost::format
& message) {
119
log
(-1*verbosity, message);
120
}
121
128
void
debug
(
int
verbosity,
const
char
*fmt, ...) {
129
va_list ap;
130
va_start(ap, fmt);
131
debug
(verbosity, fmt, ap);
132
va_end(ap);
133
}
134
142
void
debug
(
int
verbosity,
const
char
*fmt, va_list ap) {
143
if
(-1 * verbosity <
getThreshold
())
return
;
144
_format
(-1*verbosity, fmt, ap);
145
}
146
152
template
<
int
VERBOSITY>
153
void
debug
(
const
std::string& message) {
154
if
(
LSST_MAX_DEBUG
<= 0 || VERBOSITY <=
LSST_MAX_DEBUG
) {
155
log
(-1*VERBOSITY, message);
156
}
157
}
158
167
template
<
int
VERBOSITY>
168
void
debug
(
const
char
*fmt, ...) {
169
if
(
LSST_MAX_DEBUG
<= 0 || VERBOSITY <=
LSST_MAX_DEBUG
) {
170
va_list ap;
171
va_start(ap, fmt);
172
debug
(VERBOSITY, fmt, ap);
173
va_end(ap);
174
}
175
}
176
177
};
178
185
template
<
int
VERBOSITY>
186
void
debug
(
const
std::string&
name
,
const
std::string& message) {
187
if
(
LSST_MAX_DEBUG
<= 0 || VERBOSITY <=
LSST_MAX_DEBUG
) {
188
Debug
(name).
debug
<VERBOSITY>(message);
189
}
190
}
191
198
template
<
int
VERBOSITY>
199
void
debug
(
const
std::string&
name
,
const
char
*fmt, ...) {
200
if
(
LSST_MAX_DEBUG
<= 0 || VERBOSITY <=
LSST_MAX_DEBUG
) {
201
va_list ap;
202
va_start(ap, fmt);
203
Debug
(name).
debug
(VERBOSITY, fmt, ap);
204
va_end(ap);
205
}
206
}
207
208
209
}}}
// end lsst::pex::logging
210
211
#endif // end LSST_PEX_LOGGING_DEBUG_H
lsst::pex.config.history.format
def format
Definition:
history.py:127
lsst::pex::logging::Debug::operator=
Debug & operator=(const Debug &that)
Definition:
Debug.h:86
name
table::Key< std::string > name
Definition:
ApCorrMap.cc:71
lsst::pex::logging::Log::getThreshold
int getThreshold() const
Definition:
Log.h:281
lsst::pex::logging::Log::_format
void _format(int importance, const char *fmt, va_list ap)
lsst::pex::logging::Debug::debug
void debug(int verbosity, const boost::format &message)
Definition:
Debug.h:118
lsst::pex::logging::Debug::debug
void debug(int verbosity, const char *fmt, va_list ap)
Definition:
Debug.h:142
lsst::pex::logging::Log::log
void log(int importance, const std::string &message, const lsst::daf::base::PropertySet &properties)
lsst::pex::logging::Log
a place to record messages and descriptions of the state of processing.
Definition:
Log.h:154
lsst::pex::logging::Log::getDefaultLog
static Log & getDefaultLog()
lsst::pex::logging::Debug::Debug
Debug(const std::string &name, int verbosity=-1 *Log::INHERIT_THRESHOLD)
Definition:
Debug.h:78
lsst::pex::logging::Debug::debug
void debug(const char *fmt,...)
Definition:
Debug.h:168
lsst::pex::logging::Log::INHERIT_THRESHOLD
static const int INHERIT_THRESHOLD
Definition:
Log.h:183
lsst::pex::logging::Debug::Debug
Debug(const Debug &that)
Definition:
Debug.h:84
LSST_MAX_DEBUG
#define LSST_MAX_DEBUG
Definition:
Debug.h:56
lsst::pex::logging::Debug::debug
void debug(int verbosity, const char *fmt,...)
Definition:
Debug.h:128
lsst::pex::logging::debug
void debug(const std::string &name, const std::string &message)
Definition:
Debug.h:186
lsst::pex::logging::Debug::debug
void debug(int verbosity, const std::string &message)
Definition:
Debug.h:104
Log.h
lsst::pex::logging::Debug::Debug
Debug(const Log &parent, const std::string &name, int verbosity=-1 *Log::INHERIT_THRESHOLD)
Definition:
Debug.h:81
lsst::pex::logging::Debug
Definition:
Debug.h:75
lsst::pex::logging::Debug::debug
void debug(const std::string &message)
Definition:
Debug.h:153
Generated on Thu Sep 24 2015 02:29:23 for LSSTApplications by
1.8.5