logging.cpp
Go to the documentation of this file.
54 // If you add to the following message tags, make sure to update the enum in log_tags.hpp that tracks the number of them! 76 static const std::set<LogTag> echoes_set(echoes_a, echoes_a+sizeof(echoes_a)/sizeof(echoes_a[0])); 80 // Function to retrieve the 'components' set of tags (needed by module and backend macros so they can add to it) 83 // We add the core components here, but the module and backend numbers are added later, so the set cannot be const. 84 static LogTag core_a[] = {def, core, logs, models, dependency_resolver, scanner, inifile, printers, utils, backends}; 144 // Uh oh, seems like we ran out of integers. If this happens you are screwed, and we have to rewrite the code to use long ints instead, or you have to unhook some modules. 147 ss << "Error in logger.cpp! It seems that you have so many logging tags that you have exceeded the maximum allowed integer. There is no way you can fix this except to have fewer modules hooked up to gambit all at once. Otherwise we have to rewrite the logger to work with long ints or some such" << std::endl; 244 // If tag was not in of those categories, it shouldn't have been a valid LogTag, and so there should have been a compiler error before now. Since there wasn't, there is something wrong with the LogTag definitions, the tag categories, or this function. 246 // I think we are converging on the idea that this type of error should just throw an ordinary exception. 248 ss << "Error in SortedMessage constructor! One of the tags received could not be found in any of the const LogTag sets. This is supposed to be impossible. Please check that all tags in the LogTags enum (in logger.hpp) are also listed in one (and only one) of the (const) category sets (also in logger.hpp). If this seems fine the problem may be in the code which generates the integer codes for the modules and backends (not yet written...). Tag was number: "<< *tag<<"; name: "<< tag2str()[*tag]; 307 ss << "IO error while constructing StdLogger! Tried to open ofstream to file \""<<filename<<"\", but encountered error bit in the created ostream."; 336 // (I picked a weird end of message boundary so that it would be easily distinguished from formatting that may appear in the message body)
Definition: log_tags.hpp:55 structure for storing log messages and metadata after tags are sorted Definition: logging.hpp:89 Definition: log_tags.hpp:54 Header for logging classes. Helper functions for dealing with POSIX signals. STL namespace. Logging access header for GAMBIT. virtual ~BaseLogger() Virtual destructor so we can delete the loggers by pointer to base. Definition: logging.cpp:257 Definition: log_tags.hpp:38 Definition: log_tags.hpp:41 General small utility functions. EXPORT_SYMBOLS str return_time_and_date(const time_point &in) Get date and time. Definition: util_functions.cpp:334 Definition: log_tags.hpp:51 Definition: log_tags.hpp:35 void checktags() Function to inspect tags and their associated strings. For testing purposes only. ... Definition: logging.cpp:163 Definition: log_tags.hpp:44 const Utils::time_point & received_at Definition: logging.hpp:92 Definition: log_tags.hpp:48 Definition: log_tags.hpp:36 Definition: log_tags.hpp:37 std::set< int > component_tags Definition: logging.hpp:96 Definition: log_tags.hpp:40 void writetags(const std::set< LogTag > &) Look up names corresponding to tags and write them out to the stream. Definition: logging.cpp:339 Header for logging classes. Definition: log_tags.hpp:53 Definition: log_tags.hpp:52 A simple C++ wrapper for the MPI C bindings. Definition: log_tags.hpp:47 Exception objects required for standalone compilation. Definition: log_tags.hpp:49 Definition: log_tags.hpp:46 Definition: log_tags.hpp:43 |