~c-e-pidcott/maus/devel

« back to all changes in this revision

Viewing changes to src/legacy/Interface/Squeak.hh

  • Committer: Chris Rogers
  • Date: 2012-10-03 07:19:33 UTC
  • mfrom: (659.1.40 release-candidate)
  • Revision ID: chris.rogers@stfc.ac.uk-20121003071933-kgrhvl1ec6w2jmug
Tags: MAUS-v0.3.3
MAUS-v0.3.3

Show diffs side-by-side

added added

removed removed

Lines of Context:
26
26
 
27
27
#include "json/value.h"
28
28
 
29
 
#include "Utils/JsonWrapper.hh"
30
29
#include "Interface/Squeal.hh"
31
30
 
32
31
/// Squeak class is designed to redirect output to std::out or file
68
67
  static std::ostream & mout(Squeal::exceptionLevel level);
69
68
 
70
69
  /// Set the ostream for a given error level (Squeal)
71
 
  static void setOutput(errorLevel level, std::ostream& out);
 
70
  static void setAnOutput(errorLevel level, std::ostream& out);
 
71
 
 
72
  /// Set the ostream for all items below "verboseLevel" to /dev/null
 
73
 
 
74
  /// If verboseLevel is less than or equal to
 
75
  /// - Squeak::debug then mout(Squeak::debug) redirects to std::cout
 
76
  /// - Squeak::info then mout(Squeak::info) redirects to std::clog
 
77
  /// - Squeak::warning then mout(Squeak::warning) redirects to std::cerr
 
78
  /// - Squeak::error then mout(Squeak::error) redirects to std::cerr
 
79
  /// - Squeak::fatal then mout(Squeak::fatal) redirects to std::cerr
 
80
  /// Note that the redirection is independent of setStandardOutputs status
 
81
  static void setOutputs(int verboseLevel);
72
82
 
73
83
  /// Turn on/off std::cout, std::cerr, std::clog
74
84
 
75
85
  /// Set standard outputs to /dev/null depending on verboseLevel:
76
 
  ///   * if verboseLevel > int(Squeak::debug), set std::cout to /dev/null
77
 
  ///   * if verboseLevel > int(Squeak::info), set std::clog to /dev/null
78
 
  ///   * if verboseLevel > int(Squeak::warning), set std::cerr to /dev/null
79
 
  ///   * if verboseLevel < 0, take default from int datacard "VerboseLevel"
 
86
  /// - if verboseLevel > int(Squeak::debug), set std::cout to /dev/null
 
87
  /// - if verboseLevel > int(Squeak::info), set std::clog to /dev/null
 
88
  /// - if verboseLevel > int(Squeak::warning), set std::cerr to /dev/null
80
89
  /// GEANT4 has very verbose output that hides important run control info, so
81
90
  /// we can just turn it off by redirecting std::cout here.
82
 
  static void setStandardOutputs(int verboseLevel=-1);
 
91
  static void setStandardOutputs(int verboseLevel);
83
92
 
84
93
  /// Activate std::cout
85
94
 
112
121
  static std::ostream& cerrOut();
113
122
 
114
123
 private:
115
 
  errorLevel GetVerboseLevel();
116
124
  // constructor is called by any call to mout
117
125
  // defines std::map output
118
126
  Squeak();
125
133
  static std::ostream*                       stdout;
126
134
  static std::ostream*                       stdlog;
127
135
  static std::ostream*                       stderr;
 
136
  static const errorLevel default_error_level;
128
137
  // pointer to the singleton instance of the class
129
138
  static Squeak * instance;
130
139
  // called automagically by mout
131
140
  static Squeak *   getInstance();
132
 
  // mout tries to find the datacards in the MICERun, otherwise it operates
133
 
  // verbose
134
 
  static Json::Value* datacards;
135
141
  // Set outputs
136
142
  static void       initialiseOutputs();
137
143
  // Setup Squeal