Belle II Software  release-05-02-19
LogMethod.h
1 /**************************************************************************
2  * BASF2 (Belle Analysis Framework 2) *
3  * Copyright(C) 2010 - Belle II Collaboration *
4  * *
5  * Author: The Belle II Collaboration *
6  * Contributors: Andreas Moll *
7  * *
8  * This software is provided "as is" without any warranty. *
9  **************************************************************************/
10 
11 #pragma once
12 
13 #include <framework/logging/Logger.h>
14 
15 #include <string>
16 
17 namespace Belle2 {
33  class LogMethod {
34 
35  public:
36 
45  LogMethod(const char* package, std::string function, std::string file, unsigned int line);
46 
48  ~LogMethod();
49 
50 
51  protected:
52 
53  private:
54 
55  const char* m_package;
56  std::string m_function;
57  std::string m_file;
58  unsigned int m_line;
60  };
61 
63 } // end namespace Belle2
64 
65 
73 #ifdef LOG_NO_B2METHOD
74 #define B2METHOD() _B2_DO_NOTHING
75 #else
76 #define B2METHOD() Belle2::LogMethod logMethod(PACKAGENAME(), FUNCTIONNAME(), __FILE__, __LINE__)
77 #endif
Belle2::LogMethod::m_package
const char * m_package
The package name where the message was sent from.
Definition: LogMethod.h:63
Belle2::LogMethod::~LogMethod
~LogMethod()
The LogMethod destructor.
Definition: LogMethod.cc:31
Belle2::LogMethod::m_file
std::string m_file
The file name where the message was sent from.
Definition: LogMethod.h:65
Belle2::LogMethod::m_line
unsigned int m_line
The line number in the source code where the message was sent from.
Definition: LogMethod.h:66
Belle2::LogMethod::m_function
std::string m_function
The function name where the message was sent from.
Definition: LogMethod.h:64
Belle2
Abstract base class for different kinds of events.
Definition: MillepedeAlgorithm.h:19
Belle2::LogMethod::LogMethod
LogMethod(const char *package, std::string function, std::string file, unsigned int line)
The LogMethod constructor.
Definition: LogMethod.cc:21