R3BROOT
R3B analysis software
Loading...
Searching...
No Matches
R3BLogger.h
Go to the documentation of this file.
1/******************************************************************************
2 * Copyright (C) 2021 GSI Helmholtzzentrum für Schwerionenforschung GmbH *
3 * Copyright (C) 2021-2026 Members of R3B Collaboration *
4 * *
5 * This software is distributed under the terms of the *
6 * GNU General Public Licence (GPL) version 3, *
7 * copied verbatim in the file "LICENSE". *
8 * *
9 * In applying this license GSI does not waive the privileges and immunities *
10 * granted to it by virtue of its status as an Intergovernmental Organization *
11 * or submit itself to any jurisdiction. *
12 ******************************************************************************/
13
14// ----------------------------------------------------------------------
15// ----- R3BLogger -----
16// ----- Created 15/12/21 by J.L. Rodriguez-Sanchez -----
17// ----------------------------------------------------------------------
18
19#pragma once
20
21#include <FairLogger.h>
22#include <Rtypes.h>
23#include <cstdlib>
24#include <fairlogger/Logger.h>
25
26#include <Rtypes.h>
27#include <cstdlib>
28
29class R3BLogger : public FairLogger
30{
31 public:
32// NOLINTBEGIN
33#define R3BLOG(severity, x) \
34 do \
35 { \
36 std::string infile(__FILE__); \
37 std::stringstream ss; \
38 ss << infile.substr(infile.find_last_of("/") + 1) << ":" << __LINE__ << ":" << __FUNCTION__ << "(): "; \
39 LOG(severity) << ss.str() << x; \
40 } while (0)
41
42#define R3BLOG_IF(severity, condition, x) \
43 do \
44 { \
45 if (condition) \
46 { \
47 std::string infile(__FILE__); \
48 std::stringstream ss; \
49 ss << infile.substr(infile.find_last_of("/") + 1) << ":" << __LINE__ << ":" << __FUNCTION__ << "(): "; \
50 LOG(severity) << ss.str() << x; \
51 } \
52 } while (0)
53 // NOLINTEND
54 private:
56 ~R3BLogger() = default;
57
58 public:
60};
~R3BLogger()=default
ClassDefOverride(R3BLogger, 0)