gambit is hosted by Hepforge, IPPP Durham
GAMBIT  v1.5.0-2191-ga4742ac
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 171 of file logmaster.cpp.

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

172  {
173  // See signal_handling.cpp for why we should not bail out in this situation
174  // // LogMaster should not be destructed from within a parallel block. This check helps detect such a bug.
175  // if(omp_get_level()!=0)
176  // {
177  // // Raising an error from within the loggers within a parallel block probably will not end well, just use cout.
178  // #pragma omp critical(logmaster_destructor)
179  // {
180  // 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;
181  // exit(EXIT_FAILURE);
182  // }
183  // }
184 
185  if(not silenced)
186  {
187  // Check if there is anything in the output stream that has not been sent, and send it if there is
188  // (these messages will get backlogged because they are sent (ended) from a parallel block, but we are
189  // about to empty the backlogs anyway so that is no problem).
190  if (stream != NULL and streamtags!= NULL)
191  {
192  #pragma omp parallel
193  {
194  int i = omp_get_thread_num();
195  if (not stream[i].str().empty() or not streamtags[i].empty())
196  {
197  *this <<"#### NO EOM RECEIVED FOR MESSAGE FROM THREAD ("<<i<<"): MESSAGE MAY BE INCOMPLETE ####"<<warn<<EOM;
198  }
199  }
200  }
201 
202  // Output the message backlogs if needed
203  emit_backlog(true);
204 
205  }
206 
207  // Delete logger objects
208  for(std::map<std::set<int>,BaseLogger*>::iterator keyvalue = loggers.begin(); keyvalue != loggers.end(); ++keyvalue)
209  {
210  // Ensure their filestreams have been flushed before we delete them.
211  // (not sure if this is really needed, I think the message is in the operating systems domain by this point)
212  // Edit: I think I have decided that this is unnecessary
213  //(keyvalue->second)->flush();
214  delete (keyvalue->second);
215  }
216 
217  // Delete the thread variables
218  if (stream != NULL) delete [] stream;
219  if (streamtags != NULL) delete [] streamtags;
220  if (backlog != NULL) delete [] backlog;
221  if (current_module !=NULL) delete [] current_module;
222  if (current_backend !=NULL) delete [] current_backend;
223  }
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:100
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 363 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().

364  {
365  loggers_readyQ = true;
366  silenced = true;
367  }
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 376 of file logmaster.cpp.

References silenced.

377  {
378  return silenced;
379  }
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::Utils::construct_runtime_scratch(), Gambit::LogTags::def, empty_backlog(), Gambit::EOM, globlMaxThreads, loggers, and loggers_readyQ.

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  str log_path = Utils::construct_runtime_scratch(false) + "default.log";
153  #ifdef WITH_MPI
154  if (GMPI::Is_initialized() and not GMPI::Is_finalized())
155  log_path += ("_" + std::to_string(GMPI::Comm().Get_rank()));
156  #endif
157  if (verbose) std::cout<<std::endl<<"GAMBIT logger was never initialised. Outputting default log to "<<log_path<<std::endl;
158  StdLogger* deflogger = new StdLogger(log_path);
159  std::set<int> deftag;
160  deftag.insert(def);
161  loggers[deftag] = deflogger;
162  loggers_readyQ = true;
163  }
164  // Dump buffered messages
165  empty_backlog();
166  }
167  }
168  }
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
EXPORT_SYMBOLS str construct_runtime_scratch(bool fail_on_mpi_uninitialised=true)
Construct the path to the run-specific scratch directory This version is safe to call from a destruct...
void empty_backlog()
Empty the backlog buffer to the &#39;send&#39; function.
Definition: logmaster.cpp:382
const Logging::endofmessage EOM
Explicit const instance of the end of message struct in Gambit namespace.
Definition: logger.hpp:100
const bool verbose
Definition: logging.cpp:52
std::string str
Shorthand for a standard string.
Definition: Analysis.hpp:35
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 382 of file logmaster.cpp.

References backlog, finalsend(), and globlMaxThreads.

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

383  {
384  // See signal_handling.cpp for why we should not bail out in this situation
385  //if(omp_get_level()!=0)
386  //{
387  // // Raising an error from within the loggers within a parallel block probably will not end well, just use cout.
388  // #pragma omp critical(logmaster_empty_backlog)
389  // {
390  // 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;
391  // exit(EXIT_FAILURE);
392  // }
393  //}
394 
395  for(int i=0; i<globlMaxThreads; i++)
396  {
397  for(size_t j=0; j<backlog[i].size(); j++)
398  {
399  finalsend(backlog[i].front());
400  backlog[i].pop_front();
401  }
402  }
403  }
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:574
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 370 of file logmaster.cpp.

References silenced.

Referenced by main().

371  {
372  silenced = false;
373  }
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 633 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()().

634  {
635  init_memory();
636  current_backend[omp_get_thread_num()] = i;
637  *this<<"Setting current_backend="<<i;
638  *this<<logs<<debug<<EOM;
639  }
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:100
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 620 of file logmaster.cpp.

References current_module, and init_memory().

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

621  {
622  init_memory();
623  current_module[omp_get_thread_num()] = i;
624  }
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 574 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().

575  {
576  // Check the 'ignore' set; if any of the specified tags are in this set, then do nothing more, i.e. ignore the message.
577  // (need to add extra stuff to ignore modules and backends, since these cannot be normal tags)
578  // Also ignore the message if logs have been 'silenced'.
579  if( silenced or not Utils::is_disjoint(mail.tags, ignore) )
580  {
581  //std::cout<<"Ignoring message..."<<std::endl;
582  return;
583  }
584 
585  // If the "cout" tag is seen, repeat the message to stdout
586  if(mail.tags.find(repeat_to_cout) != mail.tags.end()) std::cout << mail.message << std::endl;
587 
588  // If the "cerr" tag is seen, repeat the message to sterr
589  if(mail.tags.find(repeat_to_cerr) != mail.tags.end()) std::cerr << mail.message << std::endl;
590 
591  // Sort the tags
592  const SortedMessage sortedmsg(mail);
593 
594  // Main loop for message distribution
595 
596  // Loop through the map of loggers and see if any of them match subsets of 'key'.
597  for(std::map<std::set<int>,BaseLogger*>::iterator keyvalue = loggers.begin(); keyvalue != loggers.end(); ++keyvalue)
598  {
599  // if set1 includes set2
600  if( std::includes(mail.tags.begin(), mail.tags.end(),
601  (keyvalue->first).begin(), (keyvalue->first).end()) )
602  {
603  // Matching logger object found! Send it the sorted message object
604  (keyvalue->second)->write(sortedmsg);
605  }
606  } //end loop over loggers
607  } // 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, generate_raster_scan_settings::n, 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 227 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().

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

References initialise().

334  {
335  std::vector<std::pair< std::set<std::string>, std::string >> loggerinfo_vec;
336  // Iterate through map and convert it to a vector of pairs
337  for(std::map<std::set<std::string>, std::string>::iterator infopair = loggerinfo.begin();
338  infopair != loggerinfo.end(); ++infopair)
339  {
340  loggerinfo_vec.push_back(std::make_pair(infopair->first,infopair->second));
341  }
342  // Run the 'normal' initialise function
343  initialise(loggerinfo_vec);
344  }
void initialise(std::vector< std::pair< std::set< std::string >, std::string >> &)
Function to construct loggers according to blueprint.
Definition: logmaster.cpp:227
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 347 of file logmaster.cpp.

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

348  {
349  std::map<std::set<std::string>, std::string> loggerinfo_set;
350  // Translate the string containing the tags into (map of) a set of tags
351  for(std::map<std::string, std::string>::iterator infopair = loggerinfo.begin();
352  infopair != loggerinfo.end(); ++infopair)
353  {
354  std::vector<std::string> tags_vec(Utils::delimiterSplit(infopair->first, ","));
355  std::set<std::string> tags_set(tags_vec.begin(), tags_vec.end());
356  loggerinfo_set[tags_set] = infopair->second;
357  }
358  // Run the 'normal' initialise function
359  initialise(loggerinfo_set);
360  }
void initialise(std::vector< std::pair< std::set< std::string >, std::string >> &)
Function to construct loggers according to blueprint.
Definition: logmaster.cpp:227
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 671 of file logmaster.cpp.

References init_memory(), and stream.

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

672  {
673  init_memory();
674  stream[omp_get_thread_num()] << in;
675  }
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 652 of file logmaster.cpp.

References init_memory(), and streamtags.

653  {
654  init_memory();
655  streamtags[omp_get_thread_num()].insert(tag);
656  }
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 659 of file logmaster.cpp.

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

660  {
661  init_memory();
662  size_t i = omp_get_thread_num();
663  // Collect the stream and tags, then send the message
664  send(stream[i].str(), streamtags[i]);
665  // Clear stream and tags for next message;
666  stream[i].str(std::string()); //TODO: check that this works properly on all compilers...
667  streamtags[i].clear();
668  }
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:407
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 678 of file logmaster.cpp.

References init_memory(), and stream.

679  {
680  init_memory();
681  stream[omp_get_thread_num()] << fp;
682  }
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 684 of file logmaster.cpp.

References init_memory(), and stream.

685  {
686  init_memory();
687  stream[omp_get_thread_num()] << fp;
688  }
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 690 of file logmaster.cpp.

References init_memory(), and stream.

691  {
692  init_memory();
693  stream[omp_get_thread_num()] << fp;
694  }
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 640 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()().

641  {
642  init_memory();
643  int cb_test;
644  cb_test = current_backend[omp_get_thread_num()];
645  if (cb_test == -1) return;
646  current_backend[omp_get_thread_num()] = -1;
647  *this<<"Restoring current_backend="<<-1;
648  *this<<logs<<debug<<EOM;
649  }
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:100
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 626 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().

627  {
628  init_memory();
629  current_module[omp_get_thread_num()] = -1;
630  leaving_backend();
631  }
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 407 of file logmaster.cpp.

Referenced by input(), and send().

408  {
409  std::set<LogTag> tags;
410  send(message,tags);
411  }
void send(const std::string &)
Main logging function (user-friendly overloaded version)
Definition: logmaster.cpp:407
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 413 of file logmaster.cpp.

References send().

414  {
415  std::set<LogTag> tags;
416  tags.insert(tag1);
417  send(message,tags);
418  }
void send(const std::string &)
Main logging function (user-friendly overloaded version)
Definition: logmaster.cpp:407
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 420 of file logmaster.cpp.

References send().

421  {
422  std::set<LogTag> tags;
423  tags.insert(tag1);
424  tags.insert(tag2);
425  send(message,tags);
426  }
void send(const std::string &)
Main logging function (user-friendly overloaded version)
Definition: logmaster.cpp:407
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 428 of file logmaster.cpp.

References send().

429  {
430  std::set<LogTag> tags;
431  tags.insert(tag1);
432  tags.insert(tag2);
433  tags.insert(tag3);
434  send(message,tags);
435  }
void send(const std::string &)
Main logging function (user-friendly overloaded version)
Definition: logmaster.cpp:407
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 437 of file logmaster.cpp.

References send().

438  {
439  std::set<LogTag> tags;
440  tags.insert(tag1);
441  tags.insert(tag2);
442  tags.insert(tag3);
443  tags.insert(tag4);
444  send(message,tags);
445  }
void send(const std::string &)
Main logging function (user-friendly overloaded version)
Definition: logmaster.cpp:407
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 447 of file logmaster.cpp.

References send().

448  {
449  std::set<LogTag> tags;
450  tags.insert(tag1);
451  tags.insert(tag2);
452  tags.insert(tag3);
453  tags.insert(tag4);
454  tags.insert(tag5);
455  send(message,tags);
456  }
void send(const std::string &)
Main logging function (user-friendly overloaded version)
Definition: logmaster.cpp:407
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 461 of file logmaster.cpp.

References send().

462  {
463  std::set<LogTag> tags;
464  send(message.str(),tags);
465  }
void send(const std::string &)
Main logging function (user-friendly overloaded version)
Definition: logmaster.cpp:407
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 467 of file logmaster.cpp.

References send().

468  {
469  std::set<LogTag> tags;
470  tags.insert(tag1);
471  send(message.str(),tags);
472  }
void send(const std::string &)
Main logging function (user-friendly overloaded version)
Definition: logmaster.cpp:407
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 474 of file logmaster.cpp.

References send().

475  {
476  std::set<LogTag> tags;
477  tags.insert(tag1);
478  tags.insert(tag2);
479  send(message.str(),tags);
480  }
void send(const std::string &)
Main logging function (user-friendly overloaded version)
Definition: logmaster.cpp:407
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 482 of file logmaster.cpp.

References send().

483  {
484  std::set<LogTag> tags;
485  tags.insert(tag1);
486  tags.insert(tag2);
487  tags.insert(tag3);
488  send(message.str(),tags);
489  }
void send(const std::string &)
Main logging function (user-friendly overloaded version)
Definition: logmaster.cpp:407
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 491 of file logmaster.cpp.

References send().

492  {
493  std::set<LogTag> tags;
494  tags.insert(tag1);
495  tags.insert(tag2);
496  tags.insert(tag3);
497  tags.insert(tag4);
498  send(message.str(),tags);
499  }
void send(const std::string &)
Main logging function (user-friendly overloaded version)
Definition: logmaster.cpp:407
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 501 of file logmaster.cpp.

References send().

502  {
503  std::set<LogTag> tags;
504  tags.insert(tag1);
505  tags.insert(tag2);
506  tags.insert(tag3);
507  tags.insert(tag4);
508  tags.insert(tag5);
509  send(message.str(),tags);
510  }
void send(const std::string &)
Main logging function (user-friendly overloaded version)
Definition: logmaster.cpp:407
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 516 of file logmaster.cpp.

References send().

517  {
518  //std::set<int>& int_tags = static_cast< std::set<int> >(tags);
519  // I cannot seem to get the static cast to work, so just copying for now:
520  //std::set<int> int_tags(tags);
521  // Gah that seems not to work for the same reason, do one by one:
522  std::set<int> int_tags;
523  for(std::set<LogTag>::iterator tag = tags.begin(); tag != tags.end(); ++tag)
524  {
525  int_tags.insert(*tag); //static_cast<int>(*tag));
526  }
527  send(message, int_tags);
528  }
void send(const std::string &)
Main logging function (user-friendly overloaded version)
Definition: logmaster.cpp:407
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 533 of file logmaster.cpp.

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

534  {
535  // 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.
536  // 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).
537 
538  // Testing...
539  //std::cout<<"msg: "<<message<<std::endl;
540 
541  // Preliminary stuff
542 
543  // Get thread number
544  int i = omp_get_thread_num();
545 
546  // Automatically add the "def" (Default) tag so that the message definitely tries to go somewhere
547  tags.insert(def);
548 
549  // Automatically add the tags for the "current" module and backend to the tags list
550  if (current_module[i] != -1)
551  {
552  //std::cout<<"current_module="<<current_module<<"; adding tag "<<tag2str()[current_module]<<std::endl;
553  tags.insert(current_module[i]);
554  }
555  if (current_backend[i] != -1)
556  {
557  //std::cout<<"current_backend="<<current_backend<<"; adding tag "<<tag2str()[current_backend]<<std::endl;
558  tags.insert(current_backend[i]);
559  }
560 
561  // If the loggers have not yet been initialised, buffer the message
562  if(omp_get_level()!=0 or not loggers_readyQ)
563  {
564  backlog[i].emplace_back(message,tags); //time stamp automatically added NOW
565  }
566  else
567  {
568  if(omp_get_level()==0) empty_backlog();
569  finalsend(Message(message,tags)); //time stamp automatically added NOW
570  }
571  } // 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:382
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:574
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 610 of file logmaster.cpp.

References send().

611  {
612  send(message.str(), tags);
613  }
void send(const std::string &)
Main logging function (user-friendly overloaded version)
Definition: logmaster.cpp:407
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 615 of file logmaster.cpp.

References send().

616  {
617  send(message.str(), tags);
618  }
void send(const std::string &)
Main logging function (user-friendly overloaded version)
Definition: logmaster.cpp:407
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(), and main().

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: