Stxxl  1.3.2
log.h
1 /***************************************************************************
2  * include/stxxl/bits/common/log.h
3  *
4  * Part of the STXXL. See http://stxxl.sourceforge.net
5  *
6  * Copyright (C) 2004-2005 Roman Dementiev <[email protected]>
7  * Copyright (C) 2009 Andreas Beckmann <[email protected]>
8  *
9  * Distributed under the Boost Software License, Version 1.0.
10  * (See accompanying file LICENSE_1_0.txt or copy at
11  * http://www.boost.org/LICENSE_1_0.txt)
12  **************************************************************************/
13 
14 #ifndef STXXL_LOG_HEADER
15 #define STXXL_LOG_HEADER
16 
17 #include <iostream>
18 #include <fstream>
19 
20 #include <stxxl/bits/namespace.h>
21 #include <stxxl/bits/singleton.h>
22 
23 
24 __STXXL_BEGIN_NAMESPACE
25 
26 class logger : public singleton<logger>
27 {
28  friend class singleton<logger>;
29 
30  std::ofstream log_stream_;
31  std::ofstream errlog_stream_;
32  std::ofstream * waitlog_stream_;
33 
34  logger();
35  ~logger();
36 
37 public:
38  inline std::ofstream & log_stream()
39  {
40  return log_stream_;
41  }
42 
43  inline std::ofstream & errlog_stream()
44  {
45  return errlog_stream_;
46  }
47 
48  inline std::ofstream * waitlog_stream()
49  {
50  return waitlog_stream_;
51  }
52 };
53 
54 __STXXL_END_NAMESPACE
55 
56 #endif // !STXXL_LOG_HEADER