ReFRACtor
fp_logger.cc
Go to the documentation of this file.
1 #include "fp_logger.h"
2 #include "fp_exception.h"
3 #include <iostream>
4 
5 using namespace FullPhysics;
6 
7 #ifdef HAVE_LUA
8 #include "register_lua.h"
10 .def(luabind::constructor<int>())
12 #endif
13 
14 
15 //-----------------------------------------------------------------------
17 //-----------------------------------------------------------------------
18 
20 {
21  std::string s = os.str();
22  os.str("");
23  if((int) l > verbosity_level_)
24  return;
25  switch(l) {
26  case LogImp::DEBUG:
27  *stream() << "DEBUG: " << s;
28  stream()->flush();
29  break;
30  case LogImp::INFO:
31  *stream() << "INFO: " << s;
32  stream()->flush();
33  break;
34  case LogImp::WARNING:
35  *stream() << "WARNING: " << s;
36  stream()->flush();
37  break;
38  case LogImp::ERROR:
39  std::cerr << "ERROR: " << s;
40  break;
41  case LogImp::FATAL:
42  std::cerr << "FATAL: " << s;
43  break;
44  default:
45  throw Exception("Unknown log level");
46  }
47 }
const Unit s("s", 1.0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0)
std::ostringstream os
Definition: logger.h:35
virtual void flush(log_level l)
Flush data to log.
Definition: fp_logger.cc:19
This is the base of the exception hierarchy for Full Physics code.
Definition: fp_exception.h:16
#define REGISTER_LUA_DERIVED_CLASS(X, Y)
Definition: register_lua.h:136
The actual implementation of the Logger.
Definition: logger.h:11
virtual std::ostream * stream()
Underlying stream, can be null if no underlying stream.
Definition: fp_logger.h:22
Contains classes to abstract away details in various Spurr Radiative Transfer software.
Definition: doxygen_python.h:1
#define REGISTER_LUA_END()
Definition: register_lua.h:134
This is the implementation of the Logger used for the Full Physics program.
Definition: fp_logger.h:12

Copyright © 2017, California Institute of Technology.
ALL RIGHTS RESERVED.
U.S. Government Sponsorship acknowledged.
Generated Fri Aug 24 2018 15:44:08