gambit is hosted by Hepforge, IPPP Durham
GAMBIT  v1.5.0-252-gf9a3f78
a Global And Modular Bsm Inference Tool
Gambit::Logging::LogMaster Class Reference

Logging "controller" object Keeps track of the various "Logger" objects. More...

#include <logmaster.hpp>

Collaboration diagram for Gambit::Logging::LogMaster:

Public Member Functions

void set_log_debug_messages (bool flag)
 Choose whether "Debug" tagged log messages will be ignored (i.e. not logged) More...
 

Private Attributes

std::map< std::set< int >, BaseLogger * > loggers
 Map to identify loggers. More...
 
std::set< intignore
 Global ignore set; if these tags/integers are seen, ignore messages containing them. More...
 
bool loggers_readyQ
 Flag to set whether loggers have been initialised not. More...
 
bool silenced
 Flag to silence logger. More...
 
bool separate_file_per_process
 Flag to store log messages for different processes in separate files. More...
 
bool log_debug_messages
 Flag to ignore Debug tagged messages. More...
 
int MPIrank
 MPI variables. More...
 
int MPIsize
 
int globlMaxThreads
 Max number of threads that could potentially be running. More...
 
intcurrent_module
 Variables that need to be threadsafe. More...
 
intcurrent_backend
 
std::ostringstream * stream
 Buffer variables needed for stream logging. More...
 
std::set< int > * streamtags
 
std::deque< Message > * backlog
 Messages sent before logger objects are created will be buffered Same for messages sent while inside omp parallel blocks. More...
 
 LogMaster ()
 Default constructor. More...
 
 LogMaster (std::map< std::set< int >, BaseLogger *> &)
 Alternate constructor Mainly for testing; lets you pass in pre-built loggers and their tags. More...
 
 ~LogMaster ()
 Destructor If errors happen before the inifile is loaded, we need to dump the log messages (that have been buffered) into a default log file. More...
 
void init_memory ()
 Initialise dynamic memory required for thread safety. More...
 
void initialise (std::vector< std::pair< std::set< std::string >, std::string >> &)
 Function to construct loggers according to blueprint. More...
 
void initialise (std::map< std::set< std::string >, std::string > &)
 
void initialise (std::map< std::string, std::string > &)
 
void disable ()
 
bool disabled ()
 
void enable ()
 
void emit_backlog (bool verbose)
 Print the backlogs to the default log file. More...
 
void input (const std::string &)
 Functions for stream input (actual stream operators which use these are defined in logger.cpp) More...
 
void input (const LogTag &)
 Handle LogTag input. More...
 
void input (const endofmessage &)
 Handle end of message character. More...
 
void input (const manip1)
 Handle various stream manipulators. More...
 
void input (const manip2)
 
void input (const manip3)
 
void send (const std::string &)
 Main logging function (user-friendly overloaded version) More...
 
void send (const std::string &, LogTag)
 
void send (const std::string &, LogTag, LogTag)
 
void send (const std::string &, LogTag, LogTag, LogTag)
 
void send (const std::string &, LogTag, LogTag, LogTag, LogTag)
 
void send (const std::string &, LogTag, LogTag, LogTag, LogTag, LogTag)
 
void send (const std::ostringstream &)
 stringstream versions.... More...
 
void send (const std::ostringstream &, LogTag)
 
void send (const std::ostringstream &, LogTag, LogTag)
 
void send (const std::ostringstream &, LogTag, LogTag, LogTag)
 
void send (const std::ostringstream &, LogTag, LogTag, LogTag, LogTag)
 
void send (const std::ostringstream &, LogTag, LogTag, LogTag, LogTag, LogTag)
 
void send (const std::string &, std::set< LogTag > &)
 Internal version of main logging function. More...
 
void send (const std::string &, std::set< int > &)
 Serious version of main logging function. More...
 
void finalsend (const Message &)
 Version of send function used by buffer dump; skips all the tag modification stuff. More...
 
void send (const std::ostringstream &, std::set< LogTag > &)
 stringstream overloads... More...
 
void send (const std::ostringstream &, std::set< int > &)
 
void entering_module (int)
 Set the internal variables tracking which module and/or backend is currently running. More...
 
void leaving_module ()
 
void entering_backend (int)
 
void leaving_backend ()
 
void empty_backlog ()
 Empty the backlog buffer to the 'send' function. More...
 

Detailed Description

Logging "controller" object Keeps track of the various "Logger" objects.

Definition at line 49 of file logmaster.hpp.

Constructor & Destructor Documentation

◆ LogMaster() [1/2]

Gambit::Logging::LogMaster::LogMaster ( )

Default constructor.

Logger class member function definitions.

Logging "controller" object Keeps track of the individual logging objects.

Definition at line 55 of file logmaster.cpp.

56  : loggers_readyQ (false)
57  , silenced (false)
59  , log_debug_messages(false)
60  , MPIrank (0)
61  , MPIsize (1)
62  , globlMaxThreads(omp_get_max_threads())
63  , current_module (NULL)
64  , current_backend(NULL)
65  , stream (NULL)
66  , streamtags (NULL)
67  , backlog (NULL)
68  {
69  // Note! MPIrank and MPIsize will not be correct until initialisation occurs!
70  }
std::deque< Message > * backlog
Messages sent before logger objects are created will be buffered Same for messages sent while inside ...
Definition: logmaster.hpp:183
bool log_debug_messages
Flag to ignore Debug tagged messages.
Definition: logmaster.hpp:162
bool loggers_readyQ
Flag to set whether loggers have been initialised not.
Definition: logmaster.hpp:153
int * current_module
Variables that need to be threadsafe.
Definition: logmaster.hpp:174
std::ostringstream * stream
Buffer variables needed for stream logging.
Definition: logmaster.hpp:178
bool separate_file_per_process
Flag to store log messages for different processes in separate files.
Definition: logmaster.hpp:159
int MPIrank
MPI variables.
Definition: logmaster.hpp:165
bool silenced
Flag to silence logger.
Definition: logmaster.hpp:156
std::set< int > * streamtags
Definition: logmaster.hpp:179
int globlMaxThreads
Max number of threads that could potentially be running.
Definition: logmaster.hpp:169

◆ LogMaster() [2/2]

Gambit::Logging::LogMaster::LogMaster ( std::map< std::set< int >, BaseLogger *> &  loggersIN)

Alternate constructor Mainly for testing; lets you pass in pre-built loggers and their tags.

Alternate constructor.

Definition at line 74 of file logmaster.cpp.

75  : loggers (loggersIN)
76  , loggers_readyQ (true)
77  , silenced (false)
79  , log_debug_messages(false)
80  , MPIrank (0)
81  , MPIsize (1)
82  , globlMaxThreads(omp_get_max_threads())
83  , current_module (NULL)
84  , current_backend(NULL)
85  , stream (NULL)
86  , streamtags (NULL)
87  , backlog (NULL)
88  {
89  // Note! MPIrank and MPIsize will not be correct until initialisation occurs!
90  }
std::deque< Message > * backlog
Messages sent before logger objects are created will be buffered Same for messages sent while inside ...
Definition: logmaster.hpp:183
bool log_debug_messages
Flag to ignore Debug tagged messages.
Definition: logmaster.hpp:162
bool loggers_readyQ
Flag to set whether loggers have been initialised not.
Definition: logmaster.hpp:153
std::map< std::set< int >, BaseLogger * > loggers
Map to identify loggers.
Definition: logmaster.hpp:147
int * current_module
Variables that need to be threadsafe.
Definition: logmaster.hpp:174
std::ostringstream * stream
Buffer variables needed for stream logging.
Definition: logmaster.hpp:178
bool separate_file_per_process
Flag to store log messages for different processes in separate files.
Definition: logmaster.hpp:159
int MPIrank
MPI variables.
Definition: logmaster.hpp:165
bool silenced
Flag to silence logger.
Definition: logmaster.hpp:156
std::set< int > * streamtags
Definition: logmaster.hpp:179
int globlMaxThreads
Max number of threads that could potentially be running.
Definition: logmaster.hpp:169

◆ ~LogMaster()

Gambit::Logging::LogMaster::~LogMaster ( )

Destructor If errors happen before the inifile is loaded, we need to dump the log messages (that have been buffered) into a default log file.

These will be log messages coming from initialisation code and so on.

Definition at line 167 of file logmaster.cpp.

References backlog, current_backend, current_module, emit_backlog(), Gambit::EOM, loggers, silenced, stream, streamtags, and Gambit::LogTags::warn.

168  {
169  // See signal_handling.cpp for why we should not bail out in this situation
170  // // LogMaster should not be destructed from within a parallel block. This check helps detect such a bug.
171  // if(omp_get_level()!=0)
172  // {
173  // // Raising an error from within the loggers within a parallel block probably will not end well, just use cout.
174  // #pragma omp critical(logmaster_destructor)
175  // {
176  // std::cout << "rank "<<MPIrank<<": "<< LOCAL_INFO << ": Tried to destruct LogMaster from inside an omp parallel block! This should not be allowed to happen, please file a bug report." << std::endl;
177  // exit(EXIT_FAILURE);
178  // }
179  // }
180 
181  if(not silenced)
182  {
183  // Check if there is anything in the output stream that has not been sent, and send it if there is
184  // (these messages will get backlogged because they are sent (ended) from a parallel block, but we are
185  // about to empty the backlogs anyway so that is no problem).
186  if (stream != NULL and streamtags!= NULL)
187  {
188  #pragma omp parallel
189  {
190  int i = omp_get_thread_num();
191  if (not stream[i].str().empty() or not streamtags[i].empty())
192  {
193  *this <<"#### NO EOM RECEIVED FOR MESSAGE FROM THREAD ("<<i<<"): MESSAGE MAY BE INCOMPLETE ####"<<warn<<EOM;
194  }
195  }
196  }
197 
198  // Output the message backlogs if needed
199  emit_backlog(true);
200 
201  }
202 
203  // Delete logger objects
204  for(std::map<std::set<int>,BaseLogger*>::iterator keyvalue = loggers.begin(); keyvalue != loggers.end(); ++keyvalue)
205  {
206  // Ensure their filestreams have been flushed before we delete them.
207  // (not sure if this is really needed, I think the message is in the operating systems domain by this point)
208  // Edit: I think I have decided that this is unnecessary
209  //(keyvalue->second)->flush();
210  delete (keyvalue->second);
211  }
212 
213  // Delete the thread variables
214  if (stream != NULL) delete [] stream;
215  if (streamtags != NULL) delete [] streamtags;
216  if (backlog != NULL) delete [] backlog;
217  if (current_module !=NULL) delete [] current_module;
218  if (current_backend !=NULL) delete [] current_backend;
219  }
std::deque< Message > * backlog
Messages sent before logger objects are created will be buffered Same for messages sent while inside ...
Definition: logmaster.hpp:183
std::map< std::set< int >, BaseLogger * > loggers
Map to identify loggers.
Definition: logmaster.hpp:147
void emit_backlog(bool verbose)
Print the backlogs to the default log file.
Definition: logmaster.cpp:137
int * current_module
Variables that need to be threadsafe.
Definition: logmaster.hpp:174
const Logging::endofmessage EOM
Explicit const instance of the end of message struct in Gambit namespace.
Definition: logger.hpp:99
std::ostringstream * stream
Buffer variables needed for stream logging.
Definition: logmaster.hpp:178
std::string str
Shorthand for a standard string.
Definition: Analysis.hpp:35
bool silenced
Flag to silence logger.
Definition: logmaster.hpp:156
std::set< int > * streamtags
Definition: logmaster.hpp:179
Here is the call graph for this function:

Member Function Documentation

◆ disable()

void Gambit::Logging::LogMaster::disable ( )

Definition at line 359 of file logmaster.cpp.

References loggers_readyQ, and silenced.

Referenced by bail(), Gambit::gambit_core::bail(), main(), Gambit::gambit_core::process_primary_options(), and Gambit::gambit_core::run_diagnostic().

360  {
361  loggers_readyQ = true;
362  silenced = true;
363  }
bool loggers_readyQ
Flag to set whether loggers have been initialised not.
Definition: logmaster.hpp:153
bool silenced
Flag to silence logger.
Definition: logmaster.hpp:156
Here is the caller graph for this function:

◆ disabled()

bool Gambit::Logging::LogMaster::disabled ( )

Definition at line 372 of file logmaster.cpp.

References silenced.

373  {
374  return silenced;
375  }
bool silenced
Flag to silence logger.
Definition: logmaster.hpp:156

◆ emit_backlog()

void Gambit::Logging::LogMaster::emit_backlog ( bool  verbose)

Print the backlogs to the default log file.

Definition at line 137 of file logmaster.cpp.

References backlog, Gambit::LogTags::def, empty_backlog(), Gambit::EOM, globlMaxThreads, loggers, loggers_readyQ, and Gambit::Utils::runtime_scratch().

Referenced by Gambit::gambit_core::run_diagnostic(), and ~LogMaster().

138  {
139  if (backlog!=NULL)
140  {
141  bool backlog_empty = true;
142  for(int i=0; i<globlMaxThreads; i++)
143  {
144  if(backlog[i].size()!=0) backlog_empty = false;
145  }
146  if (not backlog_empty)
147  {
148  if (verbose) *this<<"Logger backlog buffer not empty during LogMaster destruction; attempting to deliver unsent messages to the logs..."<<EOM;
149  // If LogMaster was never initialised, create a default log file to which the messages can be dumped.
150  if (not loggers_readyQ)
151  {
152  if (verbose) std::cout<<"Logger was never initialised! Creating default log messenger..."<<std::endl;
153  StdLogger* deflogger = new StdLogger(Utils::runtime_scratch() + "default.log");
154  std::set<int> deftag;
155  deftag.insert(def);
156  loggers[deftag] = deflogger;
157  loggers_readyQ = true;
158  if (verbose) std::cout<<"Log messages will be delivered to '" << Utils::runtime_scratch() << "default.log'"<<std::endl;
159  }
160  // Dump buffered messages
161  empty_backlog();
162  }
163  }
164  }
std::deque< Message > * backlog
Messages sent before logger objects are created will be buffered Same for messages sent while inside ...
Definition: logmaster.hpp:183
bool loggers_readyQ
Flag to set whether loggers have been initialised not.
Definition: logmaster.hpp:153
std::map< std::set< int >, BaseLogger * > loggers
Map to identify loggers.
Definition: logmaster.hpp:147
void empty_backlog()
Empty the backlog buffer to the &#39;send&#39; function.
Definition: logmaster.cpp:378
const Logging::endofmessage EOM
Explicit const instance of the end of message struct in Gambit namespace.
Definition: logger.hpp:99
const bool verbose
Definition: logging.cpp:52
EXPORT_SYMBOLS const str & runtime_scratch()
Return the path the the run-specific scratch directory.
int globlMaxThreads
Max number of threads that could potentially be running.
Definition: logmaster.hpp:169
Here is the call graph for this function:
Here is the caller graph for this function:

◆ empty_backlog()

void Gambit::Logging::LogMaster::empty_backlog ( )
private

Empty the backlog buffer to the 'send' function.

Definition at line 378 of file logmaster.cpp.

References backlog, finalsend(), and globlMaxThreads.

Referenced by emit_backlog(), initialise(), send(), and set_log_debug_messages().

379  {
380  // See signal_handling.cpp for why we should not bail out in this situation
381  //if(omp_get_level()!=0)
382  //{
383  // // Raising an error from within the loggers within a parallel block probably will not end well, just use cout.
384  // #pragma omp critical(logmaster_empty_backlog)
385  // {
386  // std::cout << LOCAL_INFO << ": (rank "<<MPIrank<<") Tried to run empty_backlog() (in LogMaster) from inside an omp parallel block! This should not be possible, please file a bug report." << std::endl;
387  // exit(EXIT_FAILURE);
388  // }
389  //}
390 
391  for(int i=0; i<globlMaxThreads; i++)
392  {
393  for(size_t j=0; j<backlog[i].size(); j++)
394  {
395  finalsend(backlog[i].front());
396  backlog[i].pop_front();
397  }
398  }
399  }
std::deque< Message > * backlog
Messages sent before logger objects are created will be buffered Same for messages sent while inside ...
Definition: logmaster.hpp:183
int globlMaxThreads
Max number of threads that could potentially be running.
Definition: logmaster.hpp:169
void finalsend(const Message &)
Version of send function used by buffer dump; skips all the tag modification stuff.
Definition: logmaster.cpp:570
Here is the call graph for this function:
Here is the caller graph for this function:

◆ enable()

void Gambit::Logging::LogMaster::enable ( )

Definition at line 366 of file logmaster.cpp.

References silenced.

Referenced by main().

367  {
368  silenced = false;
369  }
bool silenced
Flag to silence logger.
Definition: logmaster.hpp:156
Here is the caller graph for this function:

◆ entering_backend()

void Gambit::Logging::LogMaster::entering_backend ( int  i)

Definition at line 629 of file logmaster.cpp.

References current_backend, Gambit::LogTags::debug, Gambit::EOM, init_memory(), and Gambit::LogTags::logs.

Referenced by Gambit::backend_functor< TYPE(*)(ARGS...), TYPE, ARGS... >::operator()(), Gambit::backend_functor< void(*)(ARGS...), void, ARGS... >::operator()(), Gambit::backend_functor< typename variadic_ptr< TYPE, ARGS... >::type, TYPE, ARGS... >::operator()(), and Gambit::backend_functor< typename variadic_ptr< void, ARGS... >::type, void, ARGS... >::operator()().

630  {
631  init_memory();
632  current_backend[omp_get_thread_num()] = i;
633  *this<<"Setting current_backend="<<i;
634  *this<<logs<<debug<<EOM;
635  }
void init_memory()
Initialise dynamic memory required for thread safety.
Definition: logmaster.cpp:93
const Logging::endofmessage EOM
Explicit const instance of the end of message struct in Gambit namespace.
Definition: logger.hpp:99
Here is the call graph for this function:
Here is the caller graph for this function:

◆ entering_module()

void Gambit::Logging::LogMaster::entering_module ( int  i)

Set the internal variables tracking which module and/or backend is currently running.

Definition at line 616 of file logmaster.cpp.

References current_module, and init_memory().

Referenced by Gambit::module_functor< ModelParameters >::calculate(), and Gambit::module_functor< void >::calculate().

617  {
618  init_memory();
619  current_module[omp_get_thread_num()] = i;
620  }
void init_memory()
Initialise dynamic memory required for thread safety.
Definition: logmaster.cpp:93
int * current_module
Variables that need to be threadsafe.
Definition: logmaster.hpp:174
Here is the call graph for this function:
Here is the caller graph for this function:

◆ finalsend()

void Gambit::Logging::LogMaster::finalsend ( const Message mail)

Version of send function used by buffer dump; skips all the tag modification stuff.

Definition at line 570 of file logmaster.cpp.

References ignore, cyclic_include_check::includes, Gambit::Utils::is_disjoint(), loggers, Gambit::Logging::Message::message, Gambit::LogTags::repeat_to_cerr, Gambit::LogTags::repeat_to_cout, silenced, and Gambit::Logging::Message::tags.

Referenced by empty_backlog(), and send().

571  {
572  // Check the 'ignore' set; if any of the specified tags are in this set, then do nothing more, i.e. ignore the message.
573  // (need to add extra stuff to ignore modules and backends, since these cannot be normal tags)
574  // Also ignore the message if logs have been 'silenced'.
575  if( silenced or not Utils::is_disjoint(mail.tags, ignore) )
576  {
577  //std::cout<<"Ignoring message..."<<std::endl;
578  return;
579  }
580 
581  // If the "cout" tag is seen, repeat the message to stdout
582  if(mail.tags.find(repeat_to_cout) != mail.tags.end()) std::cout << mail.message << std::endl;
583 
584  // If the "cerr" tag is seen, repeat the message to sterr
585  if(mail.tags.find(repeat_to_cerr) != mail.tags.end()) std::cerr << mail.message << std::endl;
586 
587  // Sort the tags
588  const SortedMessage sortedmsg(mail);
589 
590  // Main loop for message distribution
591 
592  // Loop through the map of loggers and see if any of them match subsets of 'key'.
593  for(std::map<std::set<int>,BaseLogger*>::iterator keyvalue = loggers.begin(); keyvalue != loggers.end(); ++keyvalue)
594  {
595  // if set1 includes set2
596  if( std::includes(mail.tags.begin(), mail.tags.end(),
597  (keyvalue->first).begin(), (keyvalue->first).end()) )
598  {
599  // Matching logger object found! Send it the sorted message object
600  (keyvalue->second)->write(sortedmsg);
601  }
602  } //end loop over loggers
603  } // end LogMaster::finalsend
std::map< std::set< int >, BaseLogger * > loggers
Map to identify loggers.
Definition: logmaster.hpp:147
bool is_disjoint(const Set1 &set1, const Set2 &set2)
Test if two sets are disjoint (works on any sorted std container I think)
std::set< int > ignore
Global ignore set; if these tags/integers are seen, ignore messages containing them.
Definition: logmaster.hpp:150
bool silenced
Flag to silence logger.
Definition: logmaster.hpp:156
Here is the call graph for this function:
Here is the caller graph for this function:

◆ init_memory()

void Gambit::Logging::LogMaster::init_memory ( )

Initialise dynamic memory required for thread safety.

Definition at line 93 of file logmaster.cpp.

References backlog, current_backend, current_module, globlMaxThreads, stream, and streamtags.

Referenced by entering_backend(), entering_module(), input(), leaving_backend(), and leaving_module().

94  {
95  int n = globlMaxThreads;
96  // Reserve enough space to hold as many variables as there are slots (threads) allowed
97  if(stream==NULL)
98  {
99  #pragma omp critical(logmaster_common_init_memory_stream)
100  {
101  if(stream==NULL) stream = new std::ostringstream[n];
102  }
103  }
104  if(streamtags==NULL)
105  {
106  #pragma omp critical(logmaster_common_init_memory_streamtags)
107  {
108  if(streamtags==NULL) streamtags = new std::set<int>[n];
109  }
110  }
111  if(backlog==NULL)
112  {
113  #pragma omp critical(logmaster_common_init_memory_backlog)
114  {
115  if(backlog==NULL) backlog = new std::deque<Message>[n];
116  }
117  }
118  if(current_module==NULL)
119  {
120  #pragma omp critical(logmaster_common_init_memory_current_module)
121  {
122  if(current_module==NULL) current_module = new int[n];
123  std::fill(current_module, current_module+n, -1);
124  }
125  }
126  if(current_backend==NULL)
127  {
128  #pragma omp critical(logmaster_common_init_memory_current_backend)
129  {
130  if(current_backend==NULL) current_backend = new int[n];
131  std::fill(current_backend, current_backend+n, -1);
132  }
133  }
134  }
std::deque< Message > * backlog
Messages sent before logger objects are created will be buffered Same for messages sent while inside ...
Definition: logmaster.hpp:183
int * current_module
Variables that need to be threadsafe.
Definition: logmaster.hpp:174
std::ostringstream * stream
Buffer variables needed for stream logging.
Definition: logmaster.hpp:178
std::set< int > * streamtags
Definition: logmaster.hpp:179
int globlMaxThreads
Max number of threads that could potentially be running.
Definition: logmaster.hpp:169
Here is the caller graph for this function:

◆ initialise() [1/3]

void Gambit::Logging::LogMaster::initialise ( std::vector< std::pair< std::set< std::string >, std::string >> &  loggerinfo)

Function to construct loggers according to blueprint.

Definition at line 223 of file logmaster.cpp.

References Gambit::LogTags::debug, empty_backlog(), Gambit::EOM, ignore, LOCAL_INFO, log_debug_messages, loggers, loggers_readyQ, Gambit::logging_error(), Gambit::LogTags::logs, MPIrank, MPIsize, separate_file_per_process, and Gambit::Logging::str2tag().

Referenced by Gambit::IniParser::Parser::basicParse(), initialise(), Gambit::initialise_standalone_logs(), and main().

224  {
225  // Fix up the MPI variables
226  #ifdef WITH_MPI
227  if(GMPI::Is_initialized())
228  {
229  GMPI::Comm COMM_WORLD;
230  MPIsize = COMM_WORLD.Get_size();
231  MPIrank = COMM_WORLD.Get_rank();
232  }
233  #endif
234 
235  // Check options and inform user what they are
236  if (MPIrank == 0) std::cout << "Initialising logger...";
237  // NOTE! Option to merge log files no longer exists. Concurrent write access is a nightmare. Log messages were
238  // being lost due to different processes overwriting each others data, and using the FileLock system doesn't
239  // help because the issue is the file pointer location. To fix that, files have to be closed and reopened
240  // constantly, which creates a lot of overhead. On top of this, it is very hard to overwrite old log files at the
241  // beginning of the run since we have to coordinate who creates the file at the beginning of the run, would have
242  // to add a bunch of message passing. Overall it just isn't worth it.
243  // #ifdef WITH_MPI
244  // std::cout << std::endl << " separate_file_per_process = ";
245  // if(separate_file_per_process){ std::cout << "true; log messages will be stored in separate files for each MPI process (filename will be appended with underscore + MPI rank)"; }
246  // else{ std::cout << "false; log messages from separate MPI processes will be merged into one file (orchestrated by the OS; some mangling of concurrently written log messages may occur. Set this separate_file_per_process to 'True' if this mangling is a problem for you)";}
247  // #endif
248  std::ostringstream logmsg;
249  logmsg << " log_debug_messages = ";
250  if(log_debug_messages) logmsg << "true; log messages tagged as 'Debug' WILL be logged. " << endl << "WARNING: This may lead to very large log files!";
251  else
252  {
253  // Add "Debug" tag to the global ignore list
254  ignore.insert(LogTag::debug);
255  logmsg << "false; log messages tagged as 'Debug' will NOT be logged";
256  }
257 
258  if (MPIrank == 0) std::cout << logmsg.str() << std::endl;
259  *this << LogTag::logs << LogTag::debug << logmsg.str() << EOM;
260 
261  // Iterate through map and build the logger objects
262  for(std::vector<std::pair< std::set<std::string>, std::string >>::iterator infopair = loggerinfo.begin();
263  infopair != loggerinfo.end(); ++infopair)
264  {
265  std::set<std::string> yamltags = infopair->first;
266  std::string filename = infopair->second;
267  std::set<int> tags;
268 
270  and filename!="stdout" and filename!="stderr")
271  {
272  std::ostringstream unique_filename;
273  unique_filename << filename << "_" << MPIrank;
274  filename = unique_filename.str();
275  }
276 
277  // Log the loggers being created :)
278  // (will be put into a preliminary buffer until loggers are all constructed)
279  *this << LogTag::logs << LogTag::debug << std::endl << "Creating logger for tags [";
280 
281  // Iterate through string tags and convert them to the corresponding index
282  for(std::set<std::string>::iterator stag = yamltags.begin();
283  stag != yamltags.end(); ++stag)
284  {
285  // Finding the tag index from the tag string is kind of a drag, have to do a brute search
286  int newtag = str2tag(*stag);
287  // Check that valid tag was found (returns -1 if no tag found)
288  if(newtag==-1)
289  {
290  // If we didn't find the tag, raise an exception (probably means there was an error in the yaml file)
291  std::ostringstream errormsg;
292  errormsg << "If you have an entry something like this:"<< endl
293  << " Logger:" << endl
294  << " redirection:" << endl
295  << " [" << *stag << "] : \"blah.log\"" << endl
296  << "in your yaml file, then you probably should remove the last line. The LogTag" << endl
297  << "\"" << *stag << "\" is not recognised by the logger system. This commonly happens" << endl
298  << "if you try to redirect log output for a module that either doesn't exist, or was" << endl
299  << "ditched at cmake time." << endl;
300  logging_error().raise(LOCAL_INFO,errormsg.str());
301  }
302  *this << *stag <<", ";
303  tags.insert(newtag);
304  }
305  // Build the logger object
306  StdLogger* newlogger;
307  if(filename=="stdout")
308  {
309  newlogger = new StdLogger(std::cout);
310  }
311  else if(filename=="stderr")
312  {
313  newlogger = new StdLogger(std::cerr);
314  }
315  else
316  {
317  newlogger = new StdLogger(filename);
318  }
319  *this << "]; output is \"" << filename << "\"";
320  loggers[tags] = newlogger;
321  }
322  *this << EOM; // End message about loggers.
323  // Set logger objects ready for use and dump any buffered messages
324  loggers_readyQ = true;
325  empty_backlog();
326  }
bool log_debug_messages
Flag to ignore Debug tagged messages.
Definition: logmaster.hpp:162
bool loggers_readyQ
Flag to set whether loggers have been initialised not.
Definition: logmaster.hpp:153
#define LOCAL_INFO
Definition: local_info.hpp:34
std::map< std::set< int >, BaseLogger * > loggers
Map to identify loggers.
Definition: logmaster.hpp:147
int str2tag(const std::string &)
Definition: logging.cpp:152
void empty_backlog()
Empty the backlog buffer to the &#39;send&#39; function.
Definition: logmaster.cpp:378
const Logging::endofmessage EOM
Explicit const instance of the end of message struct in Gambit namespace.
Definition: logger.hpp:99
std::set< int > ignore
Global ignore set; if these tags/integers are seen, ignore messages containing them.
Definition: logmaster.hpp:150
bool separate_file_per_process
Flag to store log messages for different processes in separate files.
Definition: logmaster.hpp:159
int MPIrank
MPI variables.
Definition: logmaster.hpp:165
error & logging_error()
Logging errors.
Here is the call graph for this function:
Here is the caller graph for this function:

◆ initialise() [2/3]

void Gambit::Logging::LogMaster::initialise ( std::map< std::set< std::string >, std::string > &  loggerinfo)

Definition at line 329 of file logmaster.cpp.

References initialise().

330  {
331  std::vector<std::pair< std::set<std::string>, std::string >> loggerinfo_vec;
332  // Iterate through map and convert it to a vector of pairs
333  for(std::map<std::set<std::string>, std::string>::iterator infopair = loggerinfo.begin();
334  infopair != loggerinfo.end(); ++infopair)
335  {
336  loggerinfo_vec.push_back(std::make_pair(infopair->first,infopair->second));
337  }
338  // Run the 'normal' initialise function
339  initialise(loggerinfo_vec);
340  }
void initialise(std::vector< std::pair< std::set< std::string >, std::string >> &)
Function to construct loggers according to blueprint.
Definition: logmaster.cpp:223
Here is the call graph for this function:

◆ initialise() [3/3]

void Gambit::Logging::LogMaster::initialise ( std::map< std::string, std::string > &  loggerinfo)

Definition at line 343 of file logmaster.cpp.

References Gambit::Utils::delimiterSplit(), and initialise().

344  {
345  std::map<std::set<std::string>, std::string> loggerinfo_set;
346  // Translate the string containing the tags into (map of) a set of tags
347  for(std::map<std::string, std::string>::iterator infopair = loggerinfo.begin();
348  infopair != loggerinfo.end(); ++infopair)
349  {
350  std::vector<std::string> tags_vec(Utils::delimiterSplit(infopair->first, ","));
351  std::set<std::string> tags_set(tags_vec.begin(), tags_vec.end());
352  loggerinfo_set[tags_set] = infopair->second;
353  }
354  // Run the 'normal' initialise function
355  initialise(loggerinfo_set);
356  }
void initialise(std::vector< std::pair< std::set< std::string >, std::string >> &)
Function to construct loggers according to blueprint.
Definition: logmaster.cpp:223
EXPORT_SYMBOLS std::vector< str > delimiterSplit(str s, str delim)
Split a string into a vector of strings, using a delimiter, and removing any whitespace around the de...
Here is the call graph for this function:

◆ input() [1/6]

void Gambit::Logging::LogMaster::input ( const std::string &  in)

Functions for stream input (actual stream operators which use these are defined in logger.cpp)

Handle strings.

Definition at line 667 of file logmaster.cpp.

References init_memory(), and stream.

Referenced by Gambit::Logging::operator<<().

668  {
669  init_memory();
670  stream[omp_get_thread_num()] << in;
671  }
void init_memory()
Initialise dynamic memory required for thread safety.
Definition: logmaster.cpp:93
std::ostringstream * stream
Buffer variables needed for stream logging.
Definition: logmaster.hpp:178
Here is the call graph for this function:
Here is the caller graph for this function:

◆ input() [2/6]

void Gambit::Logging::LogMaster::input ( const LogTag tag)

Handle LogTag input.

Definition at line 648 of file logmaster.cpp.

References init_memory(), and streamtags.

649  {
650  init_memory();
651  streamtags[omp_get_thread_num()].insert(tag);
652  }
void init_memory()
Initialise dynamic memory required for thread safety.
Definition: logmaster.cpp:93
std::set< int > * streamtags
Definition: logmaster.hpp:179
Here is the call graph for this function:

◆ input() [3/6]

void Gambit::Logging::LogMaster::input ( const endofmessage )

Handle end of message character.

Definition at line 655 of file logmaster.cpp.

References init_memory(), send(), stream, and streamtags.

656  {
657  init_memory();
658  size_t i = omp_get_thread_num();
659  // Collect the stream and tags, then send the message
660  send(stream[i].str(), streamtags[i]);
661  // Clear stream and tags for next message;
662  stream[i].str(std::string()); //TODO: check that this works properly on all compilers...
663  streamtags[i].clear();
664  }
void init_memory()
Initialise dynamic memory required for thread safety.
Definition: logmaster.cpp:93
void send(const std::string &)
Main logging function (user-friendly overloaded version)
Definition: logmaster.cpp:403
std::ostringstream * stream
Buffer variables needed for stream logging.
Definition: logmaster.hpp:178
std::string str
Shorthand for a standard string.
Definition: Analysis.hpp:35
std::set< int > * streamtags
Definition: logmaster.hpp:179
Here is the call graph for this function:

◆ input() [4/6]

void Gambit::Logging::LogMaster::input ( const manip1  fp)

Handle various stream manipulators.

Definition at line 674 of file logmaster.cpp.

References init_memory(), and stream.

675  {
676  init_memory();
677  stream[omp_get_thread_num()] << fp;
678  }
void init_memory()
Initialise dynamic memory required for thread safety.
Definition: logmaster.cpp:93
std::ostringstream * stream
Buffer variables needed for stream logging.
Definition: logmaster.hpp:178
Here is the call graph for this function:

◆ input() [5/6]

void Gambit::Logging::LogMaster::input ( const manip2  fp)

Definition at line 680 of file logmaster.cpp.

References init_memory(), and stream.

681  {
682  init_memory();
683  stream[omp_get_thread_num()] << fp;
684  }
void init_memory()
Initialise dynamic memory required for thread safety.
Definition: logmaster.cpp:93
std::ostringstream * stream
Buffer variables needed for stream logging.
Definition: logmaster.hpp:178
Here is the call graph for this function:

◆ input() [6/6]

void Gambit::Logging::LogMaster::input ( const manip3  fp)

Definition at line 686 of file logmaster.cpp.

References init_memory(), and stream.

687  {
688  init_memory();
689  stream[omp_get_thread_num()] << fp;
690  }
void init_memory()
Initialise dynamic memory required for thread safety.
Definition: logmaster.cpp:93
std::ostringstream * stream
Buffer variables needed for stream logging.
Definition: logmaster.hpp:178
Here is the call graph for this function:

◆ leaving_backend()

void Gambit::Logging::LogMaster::leaving_backend ( )

Definition at line 636 of file logmaster.cpp.

References current_backend, Gambit::LogTags::debug, Gambit::EOM, init_memory(), and Gambit::LogTags::logs.

Referenced by leaving_module(), Gambit::backend_functor< TYPE(*)(ARGS...), TYPE, ARGS... >::operator()(), Gambit::backend_functor< void(*)(ARGS...), void, ARGS... >::operator()(), Gambit::backend_functor< typename variadic_ptr< TYPE, ARGS... >::type, TYPE, ARGS... >::operator()(), and Gambit::backend_functor< typename variadic_ptr< void, ARGS... >::type, void, ARGS... >::operator()().

637  {
638  init_memory();
639  int cb_test;
640  cb_test = current_backend[omp_get_thread_num()];
641  if (cb_test == -1) return;
642  current_backend[omp_get_thread_num()] = -1;
643  *this<<"Restoring current_backend="<<-1;
644  *this<<logs<<debug<<EOM;
645  }
void init_memory()
Initialise dynamic memory required for thread safety.
Definition: logmaster.cpp:93
const Logging::endofmessage EOM
Explicit const instance of the end of message struct in Gambit namespace.
Definition: logger.hpp:99
Here is the call graph for this function:
Here is the caller graph for this function:

◆ leaving_module()

void Gambit::Logging::LogMaster::leaving_module ( )

Definition at line 622 of file logmaster.cpp.

References current_module, init_memory(), and leaving_backend().

Referenced by Gambit::module_functor< ModelParameters >::calculate(), Gambit::module_functor< void >::calculate(), and Gambit::Likelihood_Container::main().

623  {
624  init_memory();
625  current_module[omp_get_thread_num()] = -1;
626  leaving_backend();
627  }
void init_memory()
Initialise dynamic memory required for thread safety.
Definition: logmaster.cpp:93
int * current_module
Variables that need to be threadsafe.
Definition: logmaster.hpp:174
Here is the call graph for this function:
Here is the caller graph for this function:

◆ send() [1/16]

void Gambit::Logging::LogMaster::send ( const std::string &  message)

Main logging function (user-friendly overloaded version)

Definition at line 403 of file logmaster.cpp.

Referenced by input(), and send().

404  {
405  std::set<LogTag> tags;
406  send(message,tags);
407  }
void send(const std::string &)
Main logging function (user-friendly overloaded version)
Definition: logmaster.cpp:403
Here is the caller graph for this function:

◆ send() [2/16]

void Gambit::Logging::LogMaster::send ( const std::string &  message,
LogTag  tag1 
)

Definition at line 409 of file logmaster.cpp.

References send().

410  {
411  std::set<LogTag> tags;
412  tags.insert(tag1);
413  send(message,tags);
414  }
void send(const std::string &)
Main logging function (user-friendly overloaded version)
Definition: logmaster.cpp:403
Here is the call graph for this function:

◆ send() [3/16]

void Gambit::Logging::LogMaster::send ( const std::string &  message,
LogTag  tag1,
LogTag  tag2 
)

Definition at line 416 of file logmaster.cpp.

References send().

417  {
418  std::set<LogTag> tags;
419  tags.insert(tag1);
420  tags.insert(tag2);
421  send(message,tags);
422  }
void send(const std::string &)
Main logging function (user-friendly overloaded version)
Definition: logmaster.cpp:403
Here is the call graph for this function:

◆ send() [4/16]

void Gambit::Logging::LogMaster::send ( const std::string &  message,
LogTag  tag1,
LogTag  tag2,
LogTag  tag3 
)

Definition at line 424 of file logmaster.cpp.

References send().

425  {
426  std::set<LogTag> tags;
427  tags.insert(tag1);
428  tags.insert(tag2);
429  tags.insert(tag3);
430  send(message,tags);
431  }
void send(const std::string &)
Main logging function (user-friendly overloaded version)
Definition: logmaster.cpp:403
Here is the call graph for this function:

◆ send() [5/16]

void Gambit::Logging::LogMaster::send ( const std::string &  message,
LogTag  tag1,
LogTag  tag2,
LogTag  tag3,
LogTag  tag4 
)

Definition at line 433 of file logmaster.cpp.

References send().

434  {
435  std::set<LogTag> tags;
436  tags.insert(tag1);
437  tags.insert(tag2);
438  tags.insert(tag3);
439  tags.insert(tag4);
440  send(message,tags);
441  }
void send(const std::string &)
Main logging function (user-friendly overloaded version)
Definition: logmaster.cpp:403
Here is the call graph for this function:

◆ send() [6/16]

void Gambit::Logging::LogMaster::send ( const std::string &  message,
LogTag  tag1,
LogTag  tag2,
LogTag  tag3,
LogTag  tag4,
LogTag  tag5 
)

Definition at line 443 of file logmaster.cpp.

References send().

444  {
445  std::set<LogTag> tags;
446  tags.insert(tag1);
447  tags.insert(tag2);
448  tags.insert(tag3);
449  tags.insert(tag4);
450  tags.insert(tag5);
451  send(message,tags);
452  }
void send(const std::string &)
Main logging function (user-friendly overloaded version)
Definition: logmaster.cpp:403
Here is the call graph for this function:

◆ send() [7/16]

void Gambit::Logging::LogMaster::send ( const std::ostringstream &  message)

stringstream versions....

Definition at line 457 of file logmaster.cpp.

References send().

458  {
459  std::set<LogTag> tags;
460  send(message.str(),tags);
461  }
void send(const std::string &)
Main logging function (user-friendly overloaded version)
Definition: logmaster.cpp:403
Here is the call graph for this function:

◆ send() [8/16]

void Gambit::Logging::LogMaster::send ( const std::ostringstream &  message,
LogTag  tag1 
)

Definition at line 463 of file logmaster.cpp.

References send().

464  {
465  std::set<LogTag> tags;
466  tags.insert(tag1);
467  send(message.str(),tags);
468  }
void send(const std::string &)
Main logging function (user-friendly overloaded version)
Definition: logmaster.cpp:403
Here is the call graph for this function:

◆ send() [9/16]

void Gambit::Logging::LogMaster::send ( const std::ostringstream &  message,
LogTag  tag1,
LogTag  tag2 
)

Definition at line 470 of file logmaster.cpp.

References send().

471  {
472  std::set<LogTag> tags;
473  tags.insert(tag1);
474  tags.insert(tag2);
475  send(message.str(),tags);
476  }
void send(const std::string &)
Main logging function (user-friendly overloaded version)
Definition: logmaster.cpp:403
Here is the call graph for this function:

◆ send() [10/16]

void Gambit::Logging::LogMaster::send ( const std::ostringstream &  message,
LogTag  tag1,
LogTag  tag2,
LogTag  tag3 
)

Definition at line 478 of file logmaster.cpp.

References send().

479  {
480  std::set<LogTag> tags;
481  tags.insert(tag1);
482  tags.insert(tag2);
483  tags.insert(tag3);
484  send(message.str(),tags);
485  }
void send(const std::string &)
Main logging function (user-friendly overloaded version)
Definition: logmaster.cpp:403
Here is the call graph for this function:

◆ send() [11/16]

void Gambit::Logging::LogMaster::send ( const std::ostringstream &  message,
LogTag  tag1,
LogTag  tag2,
LogTag  tag3,
LogTag  tag4 
)

Definition at line 487 of file logmaster.cpp.

References send().

488  {
489  std::set<LogTag> tags;
490  tags.insert(tag1);
491  tags.insert(tag2);
492  tags.insert(tag3);
493  tags.insert(tag4);
494  send(message.str(),tags);
495  }
void send(const std::string &)
Main logging function (user-friendly overloaded version)
Definition: logmaster.cpp:403
Here is the call graph for this function:

◆ send() [12/16]

void Gambit::Logging::LogMaster::send ( const std::ostringstream &  message,
LogTag  tag1,
LogTag  tag2,
LogTag  tag3,
LogTag  tag4,
LogTag  tag5 
)

Definition at line 497 of file logmaster.cpp.

References send().

498  {
499  std::set<LogTag> tags;
500  tags.insert(tag1);
501  tags.insert(tag2);
502  tags.insert(tag3);
503  tags.insert(tag4);
504  tags.insert(tag5);
505  send(message.str(),tags);
506  }
void send(const std::string &)
Main logging function (user-friendly overloaded version)
Definition: logmaster.cpp:403
Here is the call graph for this function:

◆ send() [13/16]

void Gambit::Logging::LogMaster::send ( const std::string &  message,
std::set< LogTag > &  tags 
)

Internal version of main logging function.

Definition at line 512 of file logmaster.cpp.

References send().

513  {
514  //std::set<int>& int_tags = static_cast< std::set<int> >(tags);
515  // I cannot seem to get the static cast to work, so just copying for now:
516  //std::set<int> int_tags(tags);
517  // Gah that seems not to work for the same reason, do one by one:
518  std::set<int> int_tags;
519  for(std::set<LogTag>::iterator tag = tags.begin(); tag != tags.end(); ++tag)
520  {
521  int_tags.insert(*tag); //static_cast<int>(*tag));
522  }
523  send(message, int_tags);
524  }
void send(const std::string &)
Main logging function (user-friendly overloaded version)
Definition: logmaster.cpp:403
Here is the call graph for this function:

◆ send() [14/16]

void Gambit::Logging::LogMaster::send ( const std::string &  message,
std::set< int > &  tags 
)

Serious version of main logging function.

Definition at line 529 of file logmaster.cpp.

References backlog, current_backend, current_module, Gambit::LogTags::def, empty_backlog(), finalsend(), and loggers_readyQ.

530  {
531  // LogMaster keeps an internal map of all the logging objects, where the keys are sets of 'LogTag's, constructed according to the inifile. So to figure out where the message has to go, we just compare the "tags" to these keys; if any of these keys are a subset of our tags, then we send the message to that LogHub.
532  // Well almost. We have to seperate out the components first, because we can "send" a message to multiple components at once, but a direction command will never include two component tags (it is an error if it does).
533 
534  // Testing...
535  //std::cout<<"msg: "<<message<<std::endl;
536 
537  // Preliminary stuff
538 
539  // Get thread number
540  int i = omp_get_thread_num();
541 
542  // Automatically add the "def" (Default) tag so that the message definitely tries to go somewhere
543  tags.insert(def);
544 
545  // Automatically add the tags for the "current" module and backend to the tags list
546  if (current_module[i] != -1)
547  {
548  //std::cout<<"current_module="<<current_module<<"; adding tag "<<tag2str()[current_module]<<std::endl;
549  tags.insert(current_module[i]);
550  }
551  if (current_backend[i] != -1)
552  {
553  //std::cout<<"current_backend="<<current_backend<<"; adding tag "<<tag2str()[current_backend]<<std::endl;
554  tags.insert(current_backend[i]);
555  }
556 
557  // If the loggers have not yet been initialised, buffer the message
558  if(omp_get_level()!=0 or not loggers_readyQ)
559  {
560  backlog[i].emplace_back(message,tags); //time stamp automatically added NOW
561  }
562  else
563  {
564  if(omp_get_level()==0) empty_backlog();
565  finalsend(Message(message,tags)); //time stamp automatically added NOW
566  }
567  } // end LogHub::send
std::deque< Message > * backlog
Messages sent before logger objects are created will be buffered Same for messages sent while inside ...
Definition: logmaster.hpp:183
bool loggers_readyQ
Flag to set whether loggers have been initialised not.
Definition: logmaster.hpp:153
void empty_backlog()
Empty the backlog buffer to the &#39;send&#39; function.
Definition: logmaster.cpp:378
int * current_module
Variables that need to be threadsafe.
Definition: logmaster.hpp:174
void finalsend(const Message &)
Version of send function used by buffer dump; skips all the tag modification stuff.
Definition: logmaster.cpp:570
Here is the call graph for this function:

◆ send() [15/16]

void Gambit::Logging::LogMaster::send ( const std::ostringstream &  message,
std::set< LogTag > &  tags 
)

stringstream overloads...

Definition at line 606 of file logmaster.cpp.

References send().

607  {
608  send(message.str(), tags);
609  }
void send(const std::string &)
Main logging function (user-friendly overloaded version)
Definition: logmaster.cpp:403
Here is the call graph for this function:

◆ send() [16/16]

void Gambit::Logging::LogMaster::send ( const std::ostringstream &  message,
std::set< int > &  tags 
)

Definition at line 611 of file logmaster.cpp.

References send().

612  {
613  send(message.str(), tags);
614  }
void send(const std::string &)
Main logging function (user-friendly overloaded version)
Definition: logmaster.cpp:403
Here is the call graph for this function:

◆ set_log_debug_messages()

void Gambit::Logging::LogMaster::set_log_debug_messages ( bool  flag)
inline

Choose whether "Debug" tagged log messages will be ignored (i.e. not logged)

Setters for behaviour options Must be used before "initialise" in order to have any effect Choose whether a separate log file for each MPI process is used NOW FORBIDDEN! Always must be true to avoid concurrent write access issues void set_separate_file_per_process(bool flag) {separate_file_per_process=flag;}

Definition at line 138 of file logmaster.hpp.

References empty_backlog(), and log_debug_messages.

Referenced by Gambit::IniParser::Parser::basicParse().

138 {log_debug_messages=flag;}
bool log_debug_messages
Flag to ignore Debug tagged messages.
Definition: logmaster.hpp:162
Here is the call graph for this function:
Here is the caller graph for this function:

Member Data Documentation

◆ backlog

std::deque<Message>* Gambit::Logging::LogMaster::backlog
private

Messages sent before logger objects are created will be buffered Same for messages sent while inside omp parallel blocks.

Definition at line 183 of file logmaster.hpp.

Referenced by emit_backlog(), empty_backlog(), init_memory(), send(), and ~LogMaster().

◆ current_backend

int* Gambit::Logging::LogMaster::current_backend
private

Definition at line 175 of file logmaster.hpp.

Referenced by entering_backend(), init_memory(), leaving_backend(), send(), and ~LogMaster().

◆ current_module

int* Gambit::Logging::LogMaster::current_module
private

Variables that need to be threadsafe.

int current_function; Can generalise to this if we discover that we really want to...

Definition at line 174 of file logmaster.hpp.

Referenced by entering_module(), init_memory(), leaving_module(), send(), and ~LogMaster().

◆ globlMaxThreads

int Gambit::Logging::LogMaster::globlMaxThreads
private

Max number of threads that could potentially be running.

Definition at line 169 of file logmaster.hpp.

Referenced by emit_backlog(), empty_backlog(), and init_memory().

◆ ignore

std::set<int> Gambit::Logging::LogMaster::ignore
private

Global ignore set; if these tags/integers are seen, ignore messages containing them.

Definition at line 150 of file logmaster.hpp.

Referenced by finalsend(), and initialise().

◆ log_debug_messages

bool Gambit::Logging::LogMaster::log_debug_messages
private

Flag to ignore Debug tagged messages.

Definition at line 162 of file logmaster.hpp.

Referenced by initialise(), and set_log_debug_messages().

◆ loggers

std::map<std::set<int>,BaseLogger*> Gambit::Logging::LogMaster::loggers
private

Map to identify loggers.

Definition at line 147 of file logmaster.hpp.

Referenced by emit_backlog(), finalsend(), initialise(), and ~LogMaster().

◆ loggers_readyQ

bool Gambit::Logging::LogMaster::loggers_readyQ
private

Flag to set whether loggers have been initialised not.

Definition at line 153 of file logmaster.hpp.

Referenced by disable(), emit_backlog(), initialise(), and send().

◆ MPIrank

int Gambit::Logging::LogMaster::MPIrank
private

MPI variables.

Definition at line 165 of file logmaster.hpp.

Referenced by initialise().

◆ MPIsize

int Gambit::Logging::LogMaster::MPIsize
private

Definition at line 166 of file logmaster.hpp.

Referenced by initialise().

◆ separate_file_per_process

bool Gambit::Logging::LogMaster::separate_file_per_process
private

Flag to store log messages for different processes in separate files.

Definition at line 159 of file logmaster.hpp.

Referenced by initialise().

◆ silenced

bool Gambit::Logging::LogMaster::silenced
private

Flag to silence logger.

Definition at line 156 of file logmaster.hpp.

Referenced by disable(), disabled(), enable(), finalsend(), and ~LogMaster().

◆ stream

std::ostringstream* Gambit::Logging::LogMaster::stream
private

Buffer variables needed for stream logging.

Definition at line 178 of file logmaster.hpp.

Referenced by init_memory(), input(), and ~LogMaster().

◆ streamtags

std::set<int>* Gambit::Logging::LogMaster::streamtags
private

Definition at line 179 of file logmaster.hpp.

Referenced by init_memory(), input(), and ~LogMaster().


The documentation for this class was generated from the following files: