38 #include <boost/any.hpp>
48 namespace dafBase = lsst::daf::base;
49 namespace pexExcept = lsst::pex::exceptions;
72 std::vector<std::string> comments;
77 else if (level >=
Log::WARN) levstr =
" WARNING: ";
78 else if (level <
Log::INFO) levstr =
" DEBUG: ";
79 }
catch (pexExcept::TypeError
const & ex) {
80 }
catch (pexExcept::NotFoundError
const & ex) {}
84 }
catch (pexExcept::TypeError
const & ex) {
85 log =
"mis-specified_log_name";
86 }
catch (pexExcept::NotFoundError
const & ex) {}
90 }
catch (pexExcept::TypeError
const & ex) {
91 comments.push_back(
"(mis-specified_comment)");
92 }
catch (pexExcept::NotFoundError
const & ex) {}
94 for (
auto const& vi : comments) {
95 (*strm) << log << levstr << vi << std::endl;
100 for (
auto const& vi : names) {
105 (*strm) <<
" " << vi <<
": ";
106 pi.write(strm) << std::endl;
109 (*strm) << std::endl;
128 std::vector<std::string> comments;
133 else if (level >=
Log::WARN) levstr =
" WARNING: ";
134 else if (level <
Log::INFO) levstr =
" DEBUG: ";
135 }
catch (pexExcept::TypeError
const & ex) {
136 }
catch (pexExcept::NotFoundError
const & ex) {}
140 }
catch (pexExcept::TypeError
const & ex) {
141 log =
"mis-specified_log_name";
142 }
catch (pexExcept::NotFoundError
const & ex) {}
146 }
catch (pexExcept::TypeError
const & ex) {
147 comments.push_back(
"(mis-specified_comment)");
148 }
catch (pexExcept::NotFoundError
const & ex) {}
150 std::ostringstream indentstr;
153 for (
int i=level; i < 0; ++i) {
157 string indent(indentstr.str());
159 for (
auto const& vi : comments) {
160 (*strm) << indent << log << levstr << vi << std::endl;
165 for (
auto const& vi : names) {
170 (*strm) << indent <<
" " << vi <<
": ";
171 pi.write(strm) << std::endl;
174 (*strm) << std::endl;
193 #define LSST_TL_ADD(T, C) _tplookup[typeid(T).name()] = C
196 LSST_TL_ADD(
int,
'i');
197 LSST_TL_ADD(
long,
'l');
198 LSST_TL_ADD(
long long,
'L');
199 LSST_TL_ADD(
char,
'c');
200 LSST_TL_ADD(std::string,
's');
202 LSST_TL_ADD(
float,
'f');
203 LSST_TL_ADD(
double,
'd');
204 LSST_TL_ADD(
bool,
'b');
212 if (
this == &that)
return *
this;
227 std::vector<std::string> comments;
229 std::vector<std::string> names = rec.data().paramNames(
false);
230 for (
auto const& vi : names) {
231 char tp =
_tplookup[rec.data().typeOf(vi).name()];
238 PropertyPrinter pp(rec.data(), vi);
240 (*strm) << tp <<
" " << vi <<
_midfix;
241 pi.write(strm) << newl;
242 if (!wrote) wrote =
true;
246 if (wrote) (*strm) << std::endl;
265 date =
"(failed to get timestamp): ";
273 else if (level >=
Log::WARN) levstr =
" WARNING: ";
274 else if (level <
Log::INFO) levstr =
" DEBUG: ";
275 }
catch (pexExcept::TypeError
const & ex) {
276 }
catch (pexExcept::NotFoundError
const & ex) {}
281 }
catch (pexExcept::TypeError
const & ex) {
282 log =
"mis-specified_log_name";
283 }
catch (pexExcept::NotFoundError
const & ex) {}
285 std::vector<std::string> comments;
288 }
catch (pexExcept::TypeError
const & ex) {
289 comments.push_back(
"(mis-specified_comment)");
290 }
catch (pexExcept::NotFoundError
const & ex) {}
295 }
catch (pexExcept::TypeError
const & ex) {
296 label =
"mis-specified_label";
297 }
catch (pexExcept::NotFoundError
const & ex) {}
299 for (
auto const& vi : comments) {
300 (*strm) << date << label <<
": " << log << levstr << vi << std::endl;
304 std::vector<std::string> names = rec.data().paramNames(
false);
305 for (
auto const& vi : names) {
308 PropertyPrinter pp(rec.data(), vi);
310 (*strm) <<
" " << vi <<
": ";
311 pi.write(strm) << std::endl;
314 (*strm) << std::endl;
PrinterList::iterator iterator
std::vector< std::string > paramNames(bool topLevelOnly=true) const
Class for handling dates/times, including MJD, UTC, and TAI.
virtual bool notAtEnd() const
an class for printing the values associated with a name in a PropertySet.
a container for constructing a single Log record
definition of the LogRecord, RecordProperty and Prop classes
definition of the PropertyPrinter class and its helpers
T get(std::string const &name) const
const lsst::daf::base::PropertySet & data() const
Interface for PropertySet class.
Include files required for standard LSST Exception handling.
std::vector< T > getArray(std::string const &name) const
a wrapper PrinterIter class that hides the polymorphic (and possibly templatized) nature of an underl...