1 #ifndef sensei_Common_h 2 #define sensei_Common_h 4 #include "senseiConfig.h" 11 SENSEI_EXPORT
int haveTty();
20 std::ostream &operator<<(std::ostream &os,
const parallelId &
id);
22 SENSEI_EXPORT
int ioEnabled(
int active_rank);
25 #define ANSI_RED "\033[1;31m" 26 #define ANSI_GREEN "\033[1;32m" 27 #define ANSI_YELLOW "\033[1;33m" 28 #define ANSI_WHITE "\033[1;37m" 29 #define ANSI_OFF "\033[0m" 31 #define BEGIN_HL(Color) (sensei::haveTty()?Color:"") 32 #define END_HL (sensei::haveTty()?ANSI_OFF:"") 34 #define SENSEI_MESSAGE(Rank, Head, HeadColor, Msg) \ 35 if (sensei::ioEnabled(Rank)) \ 37 std::cerr << BEGIN_HL(HeadColor) << Head << END_HL << " [" \ 38 << sensei::parallelId() << "][" << __FILE__ << ":" << __LINE__ \ 39 << "][" SENSEI_VERSION "]" << std::endl << BEGIN_HL(HeadColor) << Head \ 40 << END_HL << " " << BEGIN_HL(ANSI_WHITE) << "" Msg << END_HL << std::endl; \ 43 #define SENSEI_ERROR(Msg) SENSEI_MESSAGE(-1, "ERROR:", ANSI_RED, Msg) 44 #define SENSEI_WARNING(Msg) SENSEI_MESSAGE(0, "WARNING:", ANSI_YELLOW, Msg) 45 #define SENSEI_STATUS(Msg) SENSEI_MESSAGE(0, "STATUS:", ANSI_GREEN, Msg) 46 #define SENSEI_STATUS_ALL(Msg) SENSEI_MESSAGE(-1, "STATUS:", ANSI_GREEN, Msg) SENSEI.
Definition: ADIOS2AnalysisAdaptor.h:27