STXXL  1.4.0
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
log.h
Go to the documentation of this file.
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_COMMON_LOG_HEADER
15 #define STXXL_COMMON_LOG_HEADER
16 
17 #include <fstream>
18 
19 #include <stxxl/bits/namespace.h>
20 #include <stxxl/bits/singleton.h>
21 
22 
24 
25 class logger : public singleton<logger>
26 {
27  friend class singleton<logger>;
28 
29  std::ofstream log_stream_;
30  std::ofstream errlog_stream_;
31  std::ofstream* waitlog_stream_;
32 
33  logger();
34  ~logger();
35 
36 public:
37  inline std::ofstream & log_stream()
38  {
39  return log_stream_;
40  }
41 
42  inline std::ofstream & errlog_stream()
43  {
44  return errlog_stream_;
45  }
46 
47  inline std::ofstream * waitlog_stream()
48  {
49  return waitlog_stream_;
50  }
51 };
52 
54 
55 #endif // !STXXL_COMMON_LOG_HEADER
std::ofstream & log_stream()
Definition: log.h:37
#define STXXL_BEGIN_NAMESPACE
Definition: namespace.h:16
std::ofstream log_stream_
Definition: log.h:29
std::ofstream * waitlog_stream()
Definition: log.h:47
std::ofstream * waitlog_stream_
Definition: log.h:31
std::ofstream errlog_stream_
Definition: log.h:30
std::ofstream & errlog_stream()
Definition: log.h:42
#define STXXL_END_NAMESPACE
Definition: namespace.h:17