22#define DEBUG_LOG(str) do { std::cout << "DEBUG: FILE::" << __FILE__ << " LINE::" <<__LINE__ << std::endl << " -> " << str << " <- " << std::endl; } while (false)
24#define DEBUG_LOG(str) do { } while (false)
73 void log(
int level, std::string errstate,
const char *file_input =
nullptr,
int line_input = -1,
int stop = 0)
const;
81 void debug(std::string errstate,
const char *file_input =
nullptr,
int line_input = -1)
const;
90 void info(std::string errstate,
const char *file_input =
nullptr,
int line_input = -1)
const;
99 void warning(std::string errstate,
const char *file_input =
nullptr,
int line_input = -1)
const;
108 void error(std::string errstate,
const char *file_input =
nullptr,
int line_input = -1,
bool stop =
true)
const;
120 void error(std::string errstate,
const char *file_input =
nullptr,
int line_input = -1,
bool stop =
true, E&& err=
nullptr)
const{
123 int num_thread=omp_get_thread_num();
128 std::ostringstream oss;
129 oss <<
" LOG::ERROR (Thread " << num_thread <<
"): " << std::endl;
130 oss <<
" Message : " << errstate << std::endl;
132 oss <<
" From file: " << std::string(file_input) << std::endl;
134 oss <<
" From line: " << line_input << std::endl;
135 std::string err_mess=oss.str();
137 throw err.istance(err_mess);
139 std::cerr << oss.str();
155 void critical(std::string errstate,
const char *file_input =
nullptr,
int line_input = -1)
const;
167 void critical(std::string errstate,
const char *file_input =
nullptr,
int line_input = -1, E&& err=
nullptr)
const{
170 int num_thread=omp_get_thread_num();
175 std::ostringstream oss;
176 oss <<
" LOG::CRITICAL (Thread " << num_thread <<
"): " << std::endl;
177 oss <<
" Message : " << errstate << std::endl;
179 oss <<
" From file: " << std::string(file_input) << std::endl;
181 oss <<
" From line: " << line_input << std::endl;
182 std::string err_mess=oss.str();
183 throw err.istance(err_mess);
194 int num_thread=omp_get_thread_num();
199 std::cout<<
"\nLOG::DEBUG (Thread " << num_thread <<
")"<< std::endl;
205 template<
typename T,
typename... Tail>
208 std::cout << head <<
" ";
218 int num_thread=omp_get_thread_num();
223 std::cout<<
"\nLOG::INFO (Thread " << num_thread <<
")"<< std::endl;
229 template<
typename T,
typename... Tail>
230 void pinfo(T head, Tail... tail)
const {
232 std::cout << head <<
" ";
242 int num_thread=omp_get_thread_num();
247 std::cerr<<
"\nLOG::WARNING (Thread " << num_thread <<
")"<< std::endl;
254 template<
typename T,
typename... Tail>
258 std::cerr << head <<
" ";
void error(std::string errstate, const char *file_input=nullptr, int line_input=-1, bool stop=true) const
Definition: sevnlog.cpp:105
int get_level()
Definition: sevnlog.h:306
static unsigned int count_info
Definition: sevnlog.h:368
static unsigned int count_debug
Definition: sevnlog.h:367
unsigned int get_Ninfo()
Definition: sevnlog.h:317
void pwarning(T head, Tail... tail) const
Definition: sevnlog.h:255
void set_level(std::string level)
Definition: sevnlog.cpp:29
void critical(std::string errstate, const char *file_input=nullptr, int line_input=-1, E &&err=nullptr) const
Definition: sevnlog.h:167
void debug(std::string errstate, const char *file_input=nullptr, int line_input=-1) const
Definition: sevnlog.cpp:194
unsigned int get_Nerror()
Definition: sevnlog.h:327
_LOG_LEVEL
Definition: sevnlog.h:345
@ _notset
Definition: sevnlog.h:346
@ _debug
Definition: sevnlog.h:347
@ _warning
Definition: sevnlog.h:349
@ _error
Definition: sevnlog.h:350
@ _info
Definition: sevnlog.h:348
@ _critical
Definition: sevnlog.h:351
SevnLogging(int level)
Definition: sevnlog.h:57
SevnLogging()
Definition: sevnlog.h:50
unsigned int get_Nwarning()
Definition: sevnlog.h:322
static int log_level
Definition: sevnlog.h:364
static unsigned int count_warning
Definition: sevnlog.h:369
void set_level(int level)
Definition: sevnlog.h:360
~SevnLogging()
Definition: sevnlog.h:63
void info(std::string errstate, const char *file_input=nullptr, int line_input=-1) const
Definition: sevnlog.cpp:166
unsigned int get_Ncustom()
Definition: sevnlog.h:332
void pdebug(T head, Tail... tail) const
Definition: sevnlog.h:206
unsigned int get_Ndebug()
Definition: sevnlog.h:312
void pinfo() const
Definition: sevnlog.h:215
void pinfo(T head, Tail... tail) const
Definition: sevnlog.h:230
static unsigned int count_custom_log
Definition: sevnlog.h:371
static unsigned int count_error
Definition: sevnlog.h:370
void critical(std::string errstate, const char *file_input=nullptr, int line_input=-1) const
Definition: sevnlog.cpp:85
void pdebug() const
Variadic prints.
Definition: sevnlog.h:191
void error(std::string errstate, const char *file_input=nullptr, int line_input=-1, bool stop=true, E &&err=nullptr) const
Definition: sevnlog.h:120
void pwarning() const
Definition: sevnlog.h:238
void warning(std::string errstate, const char *file_input=nullptr, int line_input=-1) const
Definition: sevnlog.cpp:137
void log(int level, std::string errstate, const char *file_input=nullptr, int line_input=-1, int stop=0) const
Definition: sevnlog.cpp:51