log.cc
Go to the documentation of this file.00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022 #include "log.h"
00023 #include <pthread.h>
00024
00025 namespace Barry {
00026
00027 extern bool __data_dump_mode__;
00028 extern std::ostream *LogStream;
00029 extern pthread_mutex_t LogStreamMutex;
00030
00031 LogLock::LogLock()
00032 {
00033 while( pthread_mutex_lock(&LogStreamMutex) != 0 )
00034 ;
00035 }
00036
00037 LogLock::~LogLock()
00038 {
00039 pthread_mutex_unlock(&LogStreamMutex);
00040 }
00041
00042
00043 bool LogVerbose()
00044 {
00045 return __data_dump_mode__;
00046 }
00047
00048 std::ostream* GetLogStream()
00049 {
00050 return LogStream;
00051 }
00052
00053 }
00054