31 #ifdef ENABLE_ILDG_TAG
37 #ifdef ENABLE_ILDG_TAG
57 if (filename ==
"stdout") {
58 os_ =
new std::ostream(std::cout.rdbuf());
60 os_ =
new std::ofstream(filename.c_str());
64 fprintf(stderr,
"%s: init: unable to open log file \"%s\".\n",
class_name.c_str(), filename.c_str());
79 os_ =
new std::ostream(ost.rdbuf());
82 fprintf(stderr,
"%s: init: unable to open stream.\n",
class_name.c_str());
118 std::ostream *otmp =
stack_.top();
119 if (otmp)
delete otmp;
123 #ifdef ENABLE_ILDG_TAG
135 if ((str ==
"Crucial") || (str ==
"crucial") || (str ==
"CRUCIAL"))
return Bridge::CRUCIAL;
137 if ((str ==
"General") || (str ==
"general") || (str ==
"GENERAL"))
return Bridge::GENERAL;
139 if ((str ==
"Detailed") || (str ==
"detailed") || (str ==
"DETAILED"))
return Bridge::DETAILED;
141 if ((str ==
"Paranoiac") || (str ==
"paranoiac") || (str ==
"PARANOIAC"))
return Bridge::PARANOIAC;
188 va_start(arg, format);
207 va_start(arg, format);
226 va_start(arg, format);
245 va_start(arg, format);
263 va_start(arg, format);
280 va_start(arg, format);
297 va_start(arg, format);
314 va_start(arg, format);
332 va_start(arg, format);
349 va_start(arg, format);
366 va_start(arg, format);
383 va_start(arg, format);
408 int node,
const char *format, va_list& arg)
412 std::cerr <<
"ERROR: BridgeIO: no output stream." << std::endl;
416 vsprintf(
buff_, format, arg);
424 std::cerr <<
"ERROR: BridgeIO: output failed." << std::endl;
431 #ifdef ENABLE_ILDG_TAG
437 ildg_os_ =
new std::ostream(ost.rdbuf());
440 fprintf(stderr,
"%s: init: unable to ildg open stream.\n",
class_name.c_str());
452 if (filename ==
"stdout") {
453 ildg_os_ =
new std::ostream(std::cout.rdbuf());
455 ildg_os_ =
new std::ofstream(filename.c_str());
459 fprintf(stderr,
"%s: init: unable to open ildg log file \"%s\".\n",
class_name.c_str(), filename.c_str());
470 std::cerr <<
"ERROR: BridgeIO: no ildg output stream." << std::endl;
476 va_start(arg, format);
477 vsprintf(
buff_, format, arg);
486 std::cerr <<
"ERROR: BridgeIO: ildg output failed." << std::endl;
void detailed(const char *format,...)
void general(const char *format,...)
static Bridge::VerboseLevel Vlevel()
void ildg_init(const std::ostream &os)
void init(const std::string &filename)
static int get_thread_id()
returns thread id.
std::stack< std::ostream * > stack_
void ildg(const char *format,...)
BridgeIO(const std::string &filename="stdout")
void paranoiac(const char *format,...)
void crucial(const char *format,...)
std::ostream & getStream()
static std::string get_verbose_level(const VerboseLevel vl)
void print(VerboseLevel level, VerboseLevel write_level, int node, const char *format, va_list &arg)
static const std::string class_name
static int nodeid()
alternative name for self().
static void assert_single_thread(const std::string &class_name)
assert currently running on single thread.
static VerboseLevel set_verbose_level(const std::string &str)
std::ostream & getILDGStream()