flexiblesusy is hosted by Hepforge, IPPP Durham
FlexibleSUSY
logger.hpp
Go to the documentation of this file.
1// ====================================================================
2// This file is part of FlexibleSUSY.
3//
4// FlexibleSUSY is free software: you can redistribute it and/or modify
5// it under the terms of the GNU General Public License as published
6// by the Free Software Foundation, either version 3 of the License,
7// or (at your option) any later version.
8//
9// FlexibleSUSY is distributed in the hope that it will be useful, but
10// WITHOUT ANY WARRANTY; without even the implied warranty of
11// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
12// General Public License for more details.
13//
14// You should have received a copy of the GNU General Public License
15// along with FlexibleSUSY. If not, see
16// <http://www.gnu.org/licenses/>.
17// ====================================================================
18
19#ifndef LOGGER_H
20#define LOGGER_H
21
22#include <functional>
23#include <iostream>
24
46namespace flexiblesusy {
47
48void print_verbose(std::function<void()>&&, const char*, int);
49void print_debug(std::function<void()>&&, const char*, int);
50void print_info(std::function<void()>&&, const char*, int);
51void print_warning(std::function<void()>&&, const char*, int);
52void print_error(std::function<void()>&&, const char*, int);
53void print_fatal(std::function<void()>&&, const char*, int);
54
55} // namespace flexiblesusy
56
57#define VERBOSE_MSG(msg) \
58 flexiblesusy::print_verbose([&] { std::cerr << msg; }, __FILE__, __LINE__)
59#define DEBUG_MSG(msg) \
60 flexiblesusy::print_debug([&] { std::cerr << msg; }, __FILE__, __LINE__)
61#define INFO(msg) \
62 flexiblesusy::print_info([&] { std::cerr << msg; }, __FILE__, __LINE__)
63#define WARNING(msg) \
64 flexiblesusy::print_warning([&] { std::cerr << msg; }, __FILE__, __LINE__)
65#define ERROR(msg) \
66 flexiblesusy::print_error([&] { std::cerr << msg; }, __FILE__, __LINE__)
67#define FATAL(msg) \
68 flexiblesusy::print_fatal([&] { std::cerr << msg; }, __FILE__, __LINE__)
69
70#endif
void print_error(std::function< void()> &&f, const char *, int)
Definition: logger.cpp:116
void print_debug(std::function< void()> &&, const char *, int)
Definition: logger.cpp:98
void print_fatal(std::function< void()> &&f, const char *filename, int line)
Definition: logger.cpp:125
void print_warning(std::function< void()> &&f, const char *, int)
Definition: logger.cpp:107
void print_info(std::function< void()> &&f, const char *, int)
Definition: logger.cpp:101
void print_verbose(std::function< void()> &&, const char *, int)
Definition: logger.cpp:85