Logger.h
Go to the documentation of this file.
00001 /*
00002  * Karto(tm) Robot Navigation Software - Software Development Kit
00003  * Release 2.1
00004  *
00005  * Copyright (C) 2006-2011, SRI International (R)
00006  *
00007  * The material contained in this release is copyrighted. It may not be copied,
00008  * reproduced, translated, reverse engineered, modified or reduced to any electronic
00009  * medium or machine-readable form without the prior written consent of
00010  * SRI International (R).
00011  *
00012  * Portions of files in this release may be unpublished work
00013  * containing SRI International (R) CONFIDENTIAL AND PROPRIETARY INFORMATION.
00014  * Disclosure, use, reverse engineering, modification, or reproduction without
00015  * written authorization of SRI International (R) is likewise prohibited.
00016  *
00017  * Karto (tm) is a Trademark of SRI International (R).
00018  *
00019  * Author(s): Michael A. Eriksen (eriksen@ai.sri.com)
00020  */
00021 
00022 #pragma once
00023 
00024 #ifndef __KARTO_LOGGER__
00025 #define __KARTO_LOGGER__
00026 
00027 #include <OpenKarto/String.h>
00028 #include <OpenKarto/Event.h>
00029 
00030 namespace karto
00031 {
00032   
00034 
00035 
00039 
00043   enum LogLevel 
00044   {
00048     LOG_NONE = 0,
00049 
00053     LOG_FATAL = 1,
00054 
00058     LOG_ERROR = 3,  
00059 
00063     LOG_WARNING = 4,  
00064 
00068     LOG_INFORMATION = 6, 
00069 
00073     LOG_DEBUG = 7    
00074   };
00075 
00084   extern KARTO_EXPORT void Log(LogLevel level, const karto::String& rMessage);
00085 
00090   extern KARTO_EXPORT LogLevel GetLogLevel();
00091 
00096   extern KARTO_EXPORT void SetLogLevel(LogLevel level);
00097 
00098   //@cond EXCLUDE
00103   void InitializeLogger(const karto::String& rApplicationName = "Karto", const String& rLogLevel = "NONE");
00104 
00109   void TerminateLogger();
00110   //@endcond
00111   
00115 
00119   class KARTO_EXPORT LogMessageArguments : public EventArguments
00120   {
00121   public:
00127     LogMessageArguments(LogLevel level, const karto::String& rMessage)
00128       : m_Level(level)
00129       , m_Message(rMessage)
00130     {
00131     }
00132 
00136     virtual ~LogMessageArguments()
00137     {
00138     }
00139 
00140   public:
00145     const LogLevel GetLevel() const
00146     {
00147       return m_Level;
00148     }
00149 
00154     const karto::String& GetMessage() const
00155     {
00156       return m_Message;
00157     }
00158 
00159   private:
00160     LogLevel m_Level;
00161     karto::String m_Message;
00162   };
00163 
00164 #ifdef WIN32
00165   EXPORT_KARTO_EVENT(KARTO_EXPORT, LogMessageArguments)
00166 #endif
00167 
00171   extern KARTO_EXPORT BasicEvent<LogMessageArguments> LogMessage;
00172 
00174 
00175 }
00176 
00177 #endif // __KARTO_LOGGER__
00178 


nav2d_karto
Author(s): Sebastian Kasperski
autogenerated on Mon Oct 6 2014 02:44:17