fw4spl
Log.hpp
1 /* ***** BEGIN LICENSE BLOCK *****
2  * FW4SPL - Copyright (C) IRCAD, 2009-2016.
3  * Distributed under the terms of the GNU Lesser General Public License (LGPL) as
4  * published by the Free Software Foundation.
5  * ****** END LICENSE BLOCK ****** */
6 
7 #ifndef __FWLOG_LOG_HPP__
8 #define __FWLOG_LOG_HPP__
9 
10 #include "fwLog/config.hpp"
11 
12 #include <fwCore/BaseObject.hpp>
13 
14 #include <string>
15 
16 namespace fwLog
17 {
18 
23 class FWLOG_CLASS_API Log : public ::fwCore::BaseObject
24 {
25 public:
26 
27  typedef enum
28  {
29  INFORMATION = 0,
30  WARNING = 5,
31  CRITICAL = 10
32  } LevelType;
33 
35  FWLOG_API Log(LevelType level, const std::string& message);
36 
38  FWLOG_API ~Log();
39 
41  void setLevel(LevelType level)
42  {
43  m_level = level;
44  }
45 
47  LevelType getLevel() const
48  {
49  return m_level;
50  }
51 
53  void setMessage(std::string message)
54  {
55  m_message = message;
56  }
57 
58  // Get Log message
59  const std::string getMessage() const
60  {
61  return m_message;
62  }
63 
64 protected:
65 
67  LevelType m_level;
68 
70  std::string m_message;
71 
72 
73 }; // class Logger
74 
75 } // namespace fwLog
76 
77 #endif // __FWLOG_LOG_HPP__
Base class for all FW4SPL&#39;s classes.
Definition: BaseObject.hpp:22
std::string m_message
Log message.
Definition: Log.hpp:70
fwLog contains classes used to manage logs.
Definition: Log.hpp:16
LevelType getLevel() const
Get Log level.
Definition: Log.hpp:47
LevelType m_level
Log level.
Definition: Log.hpp:67
void setLevel(LevelType level)
Set Log level.
Definition: Log.hpp:41
Log.
Definition: Log.hpp:23
void setMessage(std::string message)
Set Log message.
Definition: Log.hpp:53