All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
LoggerFeature.h
Go to the documentation of this file.
1 /**
2  * \file LoggerFeature.h
3  *
4  * \ingroup Base
5  *
6  * \brief Class definition file of LoggerFeature
7  *
8  * @author Kazu - Nevis 2015
9  */
10 
11 /** \addtogroup Base
12 
13  @{*/
14 
15 #ifndef __OPT0FINDERLOGGERFEATURE_H__
16 #define __OPT0FINDERLOGGERFEATURE_H__
17 
18 #include <vector>
19 #include "OpT0FinderLogger.h"
20 
21 namespace flashmatch {
22 
23  /**
24  \class LoggerFeature
25  Framework base class equipped with a logger class
26  */
27  class LoggerFeature {
28 
29  public:
30 
31  /// Default constructor
32  LoggerFeature(const std::string logger_name="LoggerFeature")
33  : _logger(nullptr)
34  { _logger = &(::flashmatch::logger::get(logger_name)); }
35 
36  /// Default copy constructor
37  LoggerFeature(const LoggerFeature &original) : _logger(original._logger) {}
38 
39  /// Default destructor
40  virtual ~LoggerFeature(){};
41 
42  /// Logger getter
43  inline const flashmatch::logger& logger() const
44  { return *_logger; }
45 
46  /// Verbosity level
48  { _logger->set(level); }
49 
50  /// Name getter, defined in a logger instance attribute
51  const std::string& name() const
52  { return logger().name(); }
53 
54  private:
55 
57 
58  };
59 }
60 #endif
61 
62 /** @} */ // end of doxygen group
void set_verbosity(::flashmatch::msg::Level_t level)
Verbosity level.
Definition: LoggerFeature.h:47
const flashmatch::logger & logger() const
Logger getter.
Definition: LoggerFeature.h:43
virtual ~LoggerFeature()
Default destructor.
Definition: LoggerFeature.h:40
Utility class used to show formatted message on the screen. A logger class for flashmatch. Simply shows a formatted colored message on a screen. A static getter method is provided to create a sharable logger instance (see OpT0FinderBase for useage). .
const std::string & name() const
Logger&#39;s name.
LoggerFeature(const std::string logger_name="LoggerFeature")
Default constructor.
Definition: LoggerFeature.h:32
LoggerFeature(const LoggerFeature &original)
Default copy constructor.
Definition: LoggerFeature.h:37
flashmatch::logger * _logger
logger
Definition: LoggerFeature.h:56
Level_t
Verbosity message level.
static logger & get(const std::string name)
Getter of a message instance.
logger utility class definition header file.
const std::string & name() const
Name getter, defined in a logger instance attribute.
Definition: LoggerFeature.h:51
void set(const msg::Level_t level)
Verbosity level setter.