DebConfig.hh 1.22 KB
Newer Older
1
2
3
4
5
6
// (C) Copyright 2016 by Autodesk, Inc.

#ifndef BASE_DEBCONFIG_HH_INCLUDED
#define BASE_DEBCONFIG_HH_INCLUDED
#ifdef DEB_ON

Max Lyon's avatar
Max Lyon committed
7
#include <Base/Config/BaseDefines.hh>
8
9
10
11
12
13
14
#include <string>
#include <vector>

namespace Debug {

/*! 
Access the global, per-process, configuration options of the Debug system.
15
\todo Make this a per-thread configuration.
16
*/
Max Lyon's avatar
Max Lyon committed
17
class BASEDLLEXPORT Config
18
19
20
{
public:
  static const Config& query(); 
21
  static Config& modify();
22
23

public:
24
25
26
27
28
29
30
31
32
33
34
35
  //! Turn on/off the console. This could be extended to redirect it.
  void set_console(const bool _on = true);

  //! Get if the console is turned on/off. 
  bool console() const;

  //! Turn on/off the logfile. This could be extended to provide a FILE*.
  void set_logfile(const bool _on);

  //! Get if the logfile is turned on/off. 
  bool logfile() const;

36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
  //! Get the level for this filename and function
  int level(const char* const _flnm, const char* const _fnct) const;

private:
  class Impl;
  Impl* impl_;

private:
  //! Private constructor
  Config();

  //! Private destructor
  ~Config();

  //! Disable copy
  Config(const Config&);

  //! Disable assignment
  Config& operator=(const Config&);
}; 

};//namespace Debug

#endif//DEB_ON
#endif//BASE_DEBCONFIG_HH_INCLUDED