Stxxl
1.2.1
|
00001 /*************************************************************************** 00002 * include/stxxl/bits/common/log.h 00003 * 00004 * Part of the STXXL. See http://stxxl.sourceforge.net 00005 * 00006 * Copyright (C) 2004-2005 Roman Dementiev <dementiev@ira.uka.de> 00007 * 00008 * Distributed under the Boost Software License, Version 1.0. 00009 * (See accompanying file LICENSE_1_0.txt or copy at 00010 * http://www.boost.org/LICENSE_1_0.txt) 00011 **************************************************************************/ 00012 00013 #ifndef STXXL_LOG_HEADER 00014 #define STXXL_LOG_HEADER 00015 00016 #include <iostream> 00017 #include <fstream> 00018 00019 #include <stxxl/bits/namespace.h> 00020 #include <stxxl/bits/singleton.h> 00021 00022 00023 __STXXL_BEGIN_NAMESPACE 00024 00025 class logger : public singleton<logger> 00026 { 00027 friend class singleton<logger>; 00028 00029 std::ofstream log_stream_; 00030 std::ofstream errlog_stream_; 00031 00032 inline logger() : 00033 log_stream_("stxxl.log"), 00034 errlog_stream_("stxxl.errlog") 00035 { } 00036 00037 public: 00038 inline std::ofstream & log_stream() 00039 { 00040 return log_stream_; 00041 } 00042 00043 inline std::ofstream & errlog_stream() 00044 { 00045 return errlog_stream_; 00046 } 00047 }; 00048 00049 __STXXL_END_NAMESPACE 00050 00051 #endif // !STXXL_LOG_HEADER