Logger.h
Go to the documentation of this file.
1 /*
2  * Karto(tm) Robot Navigation Software - Software Development Kit
3  * Release 2.1
4  *
5  * Copyright (C) 2006-2011, SRI International (R)
6  *
7  * The material contained in this release is copyrighted. It may not be copied,
8  * reproduced, translated, reverse engineered, modified or reduced to any electronic
9  * medium or machine-readable form without the prior written consent of
10  * SRI International (R).
11  *
12  * Portions of files in this release may be unpublished work
13  * containing SRI International (R) CONFIDENTIAL AND PROPRIETARY INFORMATION.
14  * Disclosure, use, reverse engineering, modification, or reproduction without
15  * written authorization of SRI International (R) is likewise prohibited.
16  *
17  * Karto (tm) is a Trademark of SRI International (R).
18  *
19  * Author(s): Michael A. Eriksen (eriksen@ai.sri.com)
20  */
21 
22 #pragma once
23 
24 #ifndef __KARTO_LOGGER__
25 #define __KARTO_LOGGER__
26 
27 #include <OpenKarto/String.h>
28 #include <OpenKarto/Event.h>
29 
30 namespace karto
31 {
32 
34 
35 
39 
43  enum LogLevel
44  {
48  LOG_NONE = 0,
49 
53  LOG_FATAL = 1,
54 
58  LOG_ERROR = 3,
59 
64 
69 
73  LOG_DEBUG = 7
74  };
75 
84  extern KARTO_EXPORT void Log(LogLevel level, const karto::String& rMessage);
85 
91 
96  extern KARTO_EXPORT void SetLogLevel(LogLevel level);
97 
98  //@cond EXCLUDE
103  void InitializeLogger(const karto::String& rApplicationName = "Karto", const String& rLogLevel = "NONE");
104 
109  void TerminateLogger();
110  //@endcond
111 
115 
120  {
121  public:
128  : m_Level(level)
129  , m_Message(rMessage)
130  {
131  }
132 
137  {
138  }
139 
140  public:
145  const LogLevel GetLevel() const
146  {
147  return m_Level;
148  }
149 
154  const karto::String& GetMessage() const
155  {
156  return m_Message;
157  }
158 
159  private:
162  };
163 
164 #ifdef WIN32
165  EXPORT_KARTO_EVENT(KARTO_EXPORT, LogMessageArguments)
166 #endif
167 
172 
174 
175 }
176 
177 #endif // __KARTO_LOGGER__
178 
LogLevel GetLogLevel()
Definition: Logger.cpp:178
#define KARTO_EXPORT
Definition: Macros.h:78
void Log(LogLevel level, const karto::String &rMessage)
Definition: Logger.cpp:183
LogLevel
Definition: Logger.h:43
void TerminateLogger()
Definition: Logger.cpp:228
BasicEvent< LogMessageArguments > LogMessage
Definition: Logger.cpp:44
void SetLogLevel(LogLevel level)
Definition: Logger.cpp:165
LogMessageArguments(LogLevel level, const karto::String &rMessage)
Definition: Logger.h:127
const LogLevel GetLevel() const
Definition: Logger.h:145
void InitializeLogger(const String &rApplicationName, const String &rLogLevel)
Definition: Logger.cpp:46
virtual ~LogMessageArguments()
Definition: Logger.h:136
karto::String m_Message
Definition: Logger.h:161
Definition: Any.cpp:20
const karto::String & GetMessage() const
Definition: Logger.h:154


nav2d_karto
Author(s): Sebastian Kasperski
autogenerated on Tue Nov 7 2017 06:02:36