From: <sv...@ww...> - 2004-09-26 05:42:56
|
Author: mkrose Date: 2004-09-25 22:42:44 -0700 (Sat, 25 Sep 2004) New Revision: 1249 Added: trunk/CSP/SimCore/Battlefield/Battlefield.cpp trunk/CSP/SimCore/Battlefield/Battlefield.h trunk/CSP/SimCore/Battlefield/SceneManager.cpp trunk/CSP/SimCore/Battlefield/SceneManager.h trunk/CSP/SimCore/Battlefield/SimObject.cpp trunk/CSP/SimCore/Battlefield/SimObject.h trunk/CSP/SimCore/Util/Dispatch.h trunk/CSP/SimCore/Util/Log.h trunk/CSP/SimCore/Util/SynchronousUpdate.cpp trunk/CSP/SimCore/Util/SynchronousUpdate.h Log: Ok, readded as copies from CSPSim. Should preserve the history now. They will be removed from CSPSim in a separate step. Browse at: https://www.zerobar.net/viewcvs/viewcvs.cgi?view=rev&rev=1249 Copied: trunk/CSP/SimCore/Battlefield/Battlefield.cpp (from rev 1239, trunk/CSP/CSPSim/Source/Battlefield.cpp) Copied: trunk/CSP/SimCore/Battlefield/Battlefield.h (from rev 1239, trunk/CSP/CSPSim/Include/Battlefield.h) Copied: trunk/CSP/SimCore/Battlefield/SceneManager.cpp (from rev 1239, trunk/CSP/CSPSim/Source/SceneManager.cpp) Copied: trunk/CSP/SimCore/Battlefield/SceneManager.h (from rev 1239, trunk/CSP/CSPSim/Include/SceneManager.h) Copied: trunk/CSP/SimCore/Battlefield/SimObject.cpp (from rev 1239, trunk/CSP/CSPSim/Source/SimObject.cpp) Copied: trunk/CSP/SimCore/Battlefield/SimObject.h (from rev 1240, trunk/CSP/CSPSim/Include/SimObject.h) Copied: trunk/CSP/SimCore/Util/Dispatch.h (from rev 1239, trunk/CSP/CSPSim/Include/Dispatch.h) Copied: trunk/CSP/SimCore/Util/Log.h (from rev 1239, trunk/CSP/CSPSim/Include/Log.h) =================================================================== --- trunk/CSP/CSPSim/Include/Log.h 2004-09-25 05:02:03 UTC (rev 1239) +++ trunk/CSP/SimCore/Util/Log.h 2004-09-26 05:42:44 UTC (rev 1249) @@ -0,0 +1,92 @@ +// Combat Simulator Project - FlightSim Demo +// Copyright (C) 2002 The Combat Simulator Project +// http://csp.sourceforge.net +// +// This program is free software; you can redistribute it and/or +// modify it under the terms of the GNU General Public License +// as published by the Free Software Foundation; either version 2 +// of the License, or (at your option) any later version. +// +// This program is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. +// +// You should have received a copy of the GNU General Public License +// along with this program; if not, write to the Free Software +// Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. + + +/** + * @file Log.h + * + **/ + + +#ifndef __CSP_LOG_H__ +#define __CSP_LOG_H__ + +#include <SimData/Log.h> + +#undef ERROR + +/** + * Define the possible classes/categories of logging messages + */ +enum { + CSP_NONE = 0x00000000, + + CSP_AUDIO = 0x00000001, + CSP_OPENGL = 0x00000002, + CSP_PROFILE = 0x00000004, + CSP_FILE = 0x00000008, + CSP_INPUT = 0x00000010, + CSP_MATH = 0x00000020, + CSP_NETWORK = 0x00000040, + CSP_SHARED = 0x00000080, + CSP_WINDOW = 0x00000100, + CSP_FACTORY = 0x00000200, + CSP_FRAMEWORK = 0x00000400, + CSP_LOG = 0x00000800, + CSP_TERRAIN = 0x00001000, + CSP_APP = 0x00002000, + CSP_GEOMETRY = 0x00004000, + CSP_PHYSICS = 0x00008000, + CSP_UNDEFD = 0x00010000, // for range checking + CSP_SCENE = 0x00020000, + CSP_BATTLEFIELD = 0x00040000, + CSP_OBJECT = 0x00080000, + + CSP_ALL = 0xFFFFFFFF +}; + + + +/** + * @relates LogStream + * Return the one and only csp LogStream instance. + * We use a function together with lazy construction so we are assured + * that cerr has been initialised. + * @return csp LogStream + */ +inline simdata::LogStream& csplog() { + static simdata::LogStream *log_stream = 0; + if (log_stream == 0) log_stream = simdata::LogStream::getOrCreateNamedLog("CSP"); + return *log_stream; +} + + +#ifdef CSP_NDEBUG +# define CSP_NOTEWORTHY(C,P) false +#else +# define CSP_NOTEWORTHY(C,P) ::csplog().isNoteworthy(simdata::LOG_##P, CSP_##C) +#endif + +# define CSP_LOG(C,P,M) \ + if (CSP_NOTEWORTHY(C, P)) \ + ::csplog().entry(simdata::LOG_##P, CSP_##C, __FILE__, __LINE__) << M << std::endl + + +#endif // __CSP_LOG_H__ + + Copied: trunk/CSP/SimCore/Util/SynchronousUpdate.cpp (from rev 1239, trunk/CSP/CSPSim/Source/SynchronousUpdate.cpp) Copied: trunk/CSP/SimCore/Util/SynchronousUpdate.h (from rev 1239, trunk/CSP/CSPSim/Include/SynchronousUpdate.h) |