Author: mkrose Date: 2005-11-12 12:22:53 -0800 (Sat, 12 Nov 2005) New Revision: 1667 Added: trunk/CSP/SimData/Include/SimData/ScopedLock.h trunk/CSP/SimData/Include/SimData/Synchronization.h trunk/CSP/SimData/Include/SimData/ThreadSpecific.h trunk/CSP/SimData/Source/Synchronization.cpp trunk/CSP/SimData/Source/ThreadSpecific.cpp trunk/CSP/SimData/Source/ThreadUtil.cpp Removed: trunk/CSP/SimData/Source/ThreadBase.cpp Modified: trunk/CSP/CSPSim/Source/CSPSim.cpp trunk/CSP/CSPSim/Source/glDiagnostics.cpp trunk/CSP/IndexServer/IndexServer.cpp trunk/CSP/SimCore/Battlefield/Battlefield.cpp trunk/CSP/SimCore/Battlefield/LocalBattlefield.cpp trunk/CSP/SimCore/Util/Log.h trunk/CSP/SimData/CHANGES.current trunk/CSP/SimData/Include/SimData/Composite.h trunk/CSP/SimData/Include/SimData/ExceptionBase.h trunk/CSP/SimData/Include/SimData/HashUtility.h trunk/CSP/SimData/Include/SimData/Log.h trunk/CSP/SimData/Include/SimData/Log.i trunk/CSP/SimData/Include/SimData/LogConstants.h trunk/CSP/SimData/Include/SimData/LogStream.h trunk/CSP/SimData/Include/SimData/Referenced.h trunk/CSP/SimData/Include/SimData/ScopedPointer.h trunk/CSP/SimData/Include/SimData/Singleton.h trunk/CSP/SimData/Include/SimData/Thread.h trunk/CSP/SimData/Include/SimData/ThreadQueue.h trunk/CSP/SimData/Include/SimData/ThreadUtil.h trunk/CSP/SimData/Include/SimData/Trace.h trunk/CSP/SimData/Include/SimData/Verify.h trunk/CSP/SimData/Source/DataArchive.cpp trunk/CSP/SimData/Source/DataManager.cpp trunk/CSP/SimData/Source/ExceptionBase.cpp trunk/CSP/SimData/Source/InterfaceRegistry.cpp trunk/CSP/SimData/Source/Link.cpp trunk/CSP/SimData/Source/LogStream.cpp trunk/CSP/SimData/Source/SConscript trunk/CSP/SimData/Source/TaggedRecordRegistry.cpp trunk/CSP/SimData/Source/Trace.cpp trunk/CSP/SimData/Source/Version.cpp trunk/CSP/SimData/VisualStudio2003/SimData.vcproj trunk/CSP/SimNet/ClientServer.cpp trunk/CSP/SimNet/DispatchHandler.cpp trunk/CSP/SimNet/DispatchManager.cpp trunk/CSP/SimNet/MessageQueue.h trunk/CSP/SimNet/NetLog.h trunk/CSP/SimNet/NetworkInterface.cpp trunk/CSP/SimNet/PeerInfo.cpp trunk/CSP/SimNet/PeerInfo.h trunk/CSP/SimNet/RecordCodec.cpp trunk/CSP/SimNet/ReliablePacket.h trunk/CSP/SimNet/StopWatch.h trunk/CSP/tools/trace Log: Refactor SimData logging, threading, and stack trace code. Details: * Yet another update to the logging system. - Simplified the code by eliminating ThreadLog. - Eliminated TRACE and ALERT priority levels, added FATAL. - Added priorities to LogStream as enums (in addition to macros). - Added LogStream enums for log format options. - Added thread id and short filename formatting options. - Added a LogStream method to log a stack trace. - Reordered priority and category in the SIMDATA_LOG macro. - Created a LogEntry helper class that buffers each log line and atomically writes the full line to the stream. This class automatically adds a newline. - Changed the SIMDATA_LOG macro so that the message is streamed after the macro rather than as the third argument. - Removed SIMDATA_{PRIORITY} macros; use SIMDATA_LOG instead. - Added debug, info, warning, error, and fatal helpers to the swig interface to LogStream. This take a string argument and log to all categories. * Reorganized the thread-related headers, eliminating ThreadBase.h and creating ScopedLock.h, Synchronization.h, and ThreadSpecific.h. * Added a thread::id() helper function. * Made isAborted, isDetached, isRunning, and isComplete public methods of Task to improve flexibility. * Removed iostream include from Log.h. * Improved the stack trace handling in Exception, reducing the time and space overhead. * Simplified and improved stack trace handling under Linux. - Replaced TraceBase with the StackTrace class. - Replaced Trace with AutoTrace. - Removed pre/post-trace callbacks. - Added writeToStream and operator<< helper methods. - Moved specialized code to Trace.cpp. - Added a sigterm handler to AutoTrace. * Added a boolean operator! method to ScopedPointer to test for NULL. * Changed DataArchive to immediately take a reference to newly created Objects. This prevents reference counting problems that can occur in non-trivial postCreate callbacks. * Updated logging in SimNet, and modified SimCore logging to be forward compatible (temporarily). * Added a new trace tool for decoding stack traces under Linux. Browse at: https://www.zerobar.net/viewcvs/viewcvs.cgi?view=rev&rev=1667 Diff omitted (159004 bytes). |