MURE
Loading...
Searching...
No Matches
MUREGlobal.hxx
Go to the documentation of this file.
1/*
2 This file is part of MURE,
3 Copyright (C) 2007-2021 MURE developers.
4
5 MURE is free software: you can redistribute it and/or modify
6 it under the terms of the GNU Lesser General Public License as published by
7 the Free Software Foundation, either version 3 of the License, or
8 (at your option) any later version.
9
10 MURE is distributed in the hope that it will be useful,
11 but WITHOUT ANY WARRANTY; without even the implied warranty of
12 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 GNU Lesser General Public License for more details.
14
15 You should have received a copy of the GNU Lesser General Public License
16 along with MURE. If not, see <http://www.gnu.org/licenses/>.
17*/
18
19#ifndef _MUREGlobal_
20#define _MUREGlobal_
21
24#define LOG_LEVEL_DEBUG 0
26#define LOG_LEVEL_WARNING 2
28#define LOG_LEVEL_IMPORTANT_WARNING 3
30#define LOG_LEVEL_ALERT 4
32#define LOG_LEVEL_ERROR 5
33
39#define __METHOD_NAME__ __macro_method_name__(__PRETTY_FUNCTION__)
40const int NODEBUG = 0;
41const int DODEBUG = 0;
45#define LOG_DEBUG(msg) {if ((!NODEBUG)&&((DODEBUG)||(!gMURE->GetSilentDebug()))&&(gMURE->GetMessageLevel()<=LOG_LEVEL_DEBUG)) cout<<__METHOD_NAME__<<" : "<<msg<<endl;}
47#define LOG_INFO(msg) { cout<<msg<<endl;}
49#define LOG_WARN(msg) {if ((!gMURE->GetSilentDebug())&&(gMURE->GetMessageLevel()<=LOG_LEVEL_WARNING)) {ostringstream s;s<<msg;cout<<left<<setw(75)<<setfill('*')<<("**** WARNING in "+__METHOD_NAME__+" ")<<endl;cout<<wordwrap(s.str(),75)<<endl;}}
51#define LOG_IMP_WARN(msg) {if (gMURE->GetMessageLevel()<=LOG_LEVEL_IMPORTANT_WARNING) {ostringstream s;s<<msg;cout<<left<<setw(75)<<setfill('*')<<("**** WARNING in "+__METHOD_NAME__+" ")<<endl;cout<<wordwrap(s.str(),75)<<endl;cout<<left<<setw(75)<<setfill('*')<<"*"<<endl;}}
53#define LOG_ALERT(msg) {if (gMURE->GetMessageLevel()<=LOG_LEVEL_ALERT) {ostringstream s;s<<msg;cout<<left<<setw(75)<<setfill('!')<<("!!!! ALERT in "+__METHOD_NAME__+" ")<<endl;cout<<wordwrap(s.str(),75)<<endl;cout<<setw(75)<<setfill('=')<<"!"<<endl;}}
55#define LOG_ERROR(msg) {if (gMURE->GetMessageLevel()<=LOG_LEVEL_ERROR) {ostringstream s;s<<msg;cout<<left<<setw(75)<<setfill('=')<<("==== ERROR in "+__METHOD_NAME__+" ")<<endl;cout<<wordwrap(s.str(),75)<<endl;cout<<setw(75)<<setfill('=')<<"= Exiting MURE ="<<endl;} exit(999);}
56
57#include <memory>
58#include "MURE.hxx"
59#include "NucleiTree.hxx"
60
67// extern MURE *gMURE;
68// extern std::shared_ptr<MURE> gMURE;
69extern std::unique_ptr<MURE> gMURE;
70
71// extern NucleiTree *gTREE;
72extern std::unique_ptr<NucleiTree> gTREE;
73
74#endif
const int DODEBUG
Definition MUREGlobal.hxx:41
const int NODEBUG
Definition MUREGlobal.hxx:40
std::unique_ptr< MURE > gMURE
std::unique_ptr< NucleiTree > gTREE
Definition NucleiTree.cxx:48
Header file for (super)class MURE; also definitions for debugging message macros.
Header file for NucleiTree class.

MURE Project, documentation generated by Doxygen 1.9.7 - Fri Jan 19 2024