logger.h
来自「robocup 3d, a 3d base team similar to Uv」· C头文件 代码 · 共 81 行
H
81 行
/*********************************************************************************** In the name of Almighty ** ** Logger.h : Robocup 3D Soccer Simulation Team Zigorat ** (This team was previously named Gcyrus) ** ** Date: 03/20/2007 ** Author: Mahdi Hamdarsi ** Comments: Class decleration for Logger, which is used to log information ** ***********************************************************************************//*! \file Logger.h<pre><b>File:</b> Logger.h<b>Project:</b> Robocup Soccer Simulation Team: Zigorat<b>Authors:</b> Mahdi Hamdarsi<b>Created:</b> 03/20/2007<b>Last Revision:</b> $ID$<b>Contents:</b> Class decleration for Logger, which is used to log information<hr size=2><h2><b>Changes</b></h2><b>Date</b> <b>Author</b> <b>Comment</b>03/20/2007 Mahdi Initial version created</pre>*/#ifndef LOGGER#define LOGGER#include <iostream>#include <string>using namespace std;#define endl "\n" /*!< This is to use endl with loggers */// .// /|\ <-- That is because of iostream handling.// |/*****************************************************************************//************************** CLASS LOGGER *************************************//*****************************************************************************//*! The Logger Class is used in the RoboCup Soccer environment to log the agents debugging information to the specified output, so that a backtrace of agents actions could be generated and tested. */class Logger{ ostream *m_OS; /*!< Output stream to log to */ bool m_Created; /*!< Checks if the file is created */ bool m_Enabled; /*!< Sets wheather logger is enabled */public: Logger ( ostream &os = cout, bool bEnabled = true ); Logger ( const char *strFileName, bool bEnabled = true ); ~Logger ( ); Logger & operator << ( const char * strLog ); Logger & operator << ( const char chrLog ); Logger & operator << ( const string strLog ); Logger & operator << ( const int intLog ); Logger & operator << ( const double dblLog ); bool setEnabled ( bool bEnabled ); bool getEnabled ( void );};extern Logger logger; /*!< Logger to log normal information */extern Logger BasicLogger; /*!< Logger to log BasicAgent information */extern Logger WMLogger; /*!< Logger to log WorldModel information */extern Logger CommLogger; /*!< Logger to log Connection messages */#endif
⌨️ 快捷键说明
复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?