STXXL  1.4.1
 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 
23 
24 class logger : public singleton<logger>
25 {
26  friend class singleton<logger>;
27 
28  std::ofstream log_stream_;
29  std::ofstream errlog_stream_;
30  std::ofstream* waitlog_stream_;
31 
32  logger();
33  ~logger();
34 
35 public:
36  inline std::ofstream & log_stream()
37  {
38  return log_stream_;
39  }
40 
41  inline std::ofstream & errlog_stream()
42  {
43  return errlog_stream_;
44  }
45 
46  inline std::ofstream * waitlog_stream()
47  {
48  return waitlog_stream_;
49  }
50 };
51 
53 
54 #endif // !STXXL_COMMON_LOG_HEADER
std::ofstream & log_stream()
Definition: log.h:36
#define STXXL_BEGIN_NAMESPACE
Definition: namespace.h:16
std::ofstream log_stream_
Definition: log.h:28
std::ofstream * waitlog_stream()
Definition: log.h:46
std::ofstream * waitlog_stream_
Definition: log.h:30
std::ofstream errlog_stream_
Definition: log.h:29
std::ofstream & errlog_stream()
Definition: log.h:41
#define STXXL_END_NAMESPACE
Definition: namespace.h:17