ATLAS Offline Software
Loading...
Searching...
No Matches
VP1Msg.h
Go to the documentation of this file.
1/*
2 Copyright (C) 2002-2022 CERN for the benefit of the ATLAS collaboration
3*/
4
5
7// //
8// Header file for class VP1Msg //
9// //
10// Description: Static methods for consistent message output //
11// //
12// Author: Thomas H. Kittelmann (Thomas.Kittelmann@cern.ch) //
13// Initial version: March 2008 //
14// //
16
17#ifndef VP1MSG_H
18#define VP1MSG_H
19
20#include <QStringList>
21#include "VP1Base/VP1String.h"
22
23
24#pragma once
25
26
27
28class IVP1System;
29class VP1Msg : public VP1String {
30public:
31 static bool verbose() { return m_verbose; } // Returns true if env var VP1_VERBOSE_OUTPUT=1
32 static bool debug() { return m_debug; } // Returns true if env var VP1_DEBUG_OUTPUT=1
33
34 #if defined BUILDVP1LIGHT
35 static void enableMsg(const QString&, const QString&);
36 #else
37 static void enableMsg(const QString&);
38 #endif
39
40 static void message(const QString&, IVP1System*sys = 0);//Non-zero sys pointer to get message in GUI
41 static void messageDebug(const QString&);
42 static void messageWarning(const QString&, IVP1System*sys = 0 );
43 static void messageVerbose(const QString&);//This outputs only if verbose() is true.
44 static void messageWarningRed( const QString& str, IVP1System*sys = 0 );
45 static void messageWarningAllRed( const QString& str, IVP1System*sys = 0 );
46 //static void messageWarningAllBlue( const QString& str, IVP1System*sys = 0 );
47
48 //Overloaded convenience methods, for outputting several lines:
49 static void message(const QStringList&, const QString& addtoend = "", IVP1System*sys = 0 );
50 static void messageDebug(const QStringList&, const QString& addtoend = "" );
51 static void messageVerbose(const QStringList&, const QString& addtoend = "" );
52 static void message(const QString& addtostart, const QStringList&, const QString& addtoend = "", IVP1System*sys = 0 );
53 static void messageDebug(const QString& addtostart, const QStringList&, const QString& addtoend = "" );
54 static void messageVerbose(const QString& addtostart, const QStringList&, const QString& addtoend = "" );
55
56 static const char* prefix_msg() { return "VP1MESSAGE";}
57 static const char* prefix_debug() { return "VP1MSG_DEBUG";}
58 static const char* prefix_warning() { return "VP1MSG_WARNING";}
59 static const char* prefix_verbose() { return "VP1MSG_VERBOSE";}
60
61private:
64 static std::atomic<bool> m_verbose;
65 static std::atomic<bool> m_debug;
66};
67
68#endif
static bool debug()
Definition VP1Msg.h:32
static const char * prefix_warning()
Definition VP1Msg.h:58
static void messageVerbose(const QString &)
Definition VP1Msg.cxx:84
static bool verbose()
Definition VP1Msg.h:31
static void messageDebug(const QString &)
Definition VP1Msg.cxx:39
static void message(const QString &, IVP1System *sys=0)
Definition VP1Msg.cxx:30
static std::atomic< bool > m_debug
Definition VP1Msg.h:65
static void messageWarningRed(const QString &str, IVP1System *sys=0)
Definition VP1Msg.cxx:57
static void messageWarningAllRed(const QString &str, IVP1System *sys=0)
Definition VP1Msg.cxx:70
~VP1Msg()
Definition VP1Msg.h:63
VP1Msg()
Definition VP1Msg.h:62
static std::atomic< bool > m_verbose
Definition VP1Msg.h:64
static const char * prefix_msg()
Definition VP1Msg.h:56
static void messageWarning(const QString &, IVP1System *sys=0)
Definition VP1Msg.cxx:48
static const char * prefix_debug()
Definition VP1Msg.h:57
static const char * prefix_verbose()
Definition VP1Msg.h:59
static void enableMsg(const QString &)
Definition VP1Msg.cxx:198