#include <cassert>
#include <string>
#include <vector>
#include <iostream>
#include <fstream>
Go to the source code of this file.
Classes | |
class | Where |
A class to allow the WHERE macro to work. More... | |
class | Slog |
simple logging class with a ostream like (<<) interface More... | |
class | LogState |
Put this sucker on the stack to save your state. More... | |
Defines | |
#define | UNUSED |
GNU CC attribute to denote unused paramters in function calls. The attribute remove compiler warning for unused arguments and variable. Only works for GNU compilers such as gcc and g++. | |
#define | EXIT_DEBUG(why) |
Simple macro to terminate execution early while debugging. | |
#define | WHERE Where(__FILE__,__LINE__,__FUNCTION__) |
Manipulator like item that writes out the location of the log entry. | |
Enumerations | |
enum | LogLevelsEnum { ALWAYS = INT_MIN, TERSE = 1, TRACE, VERBOSE, BOMBASTIC, NEVER = INT_MAX } |
Logging levels. More... | |
Functions | |
Slog & | operator<< (Slog &s, Slog &(*manip)(Slog &)) |
Allow the use of iomanipulators. | |
Slog & | endl (Slog &s) |
endl terminates a log... similar to std::endl | |
Slog & | decl (Slog &s) |
make the message MORE likely to show up | |
Slog & | incl (Slog &s) |
make the message LESS likely to show up | |
Slog & | operator<< (Slog &s, const int &r) |
Allow logging of ints. | |
Slog & | operator<< (Slog &s, const size_t &r) |
32/64 bit safe unsigned numbers | |
Slog & | operator<< (Slog &s, const char *str) |
Allow logging of C strings. | |
Slog & | operator<< (Slog &s, const std::string &str) |
Log a string. | |
Slog & | operator<< (Slog &s, const char &c) |
Log insertion of a single character. | |
Slog & | operator<< (Slog &s, const short &sh) |
Insert a short integer. | |
Slog & | operator<< (Slog &s, const long &l) |
Insert a long integer. | |
Slog & | operator<< (Slog &s, const float &f) |
Insert a 4 byte float. | |
Slog & | operator<< (Slog &s, const double &d) |
Insert a 8 byte float. | |
Slog & | operator<< (Slog &s, const Where &w) |
Insert where object. |
Copyright (c) 2006 Kurt Schwehr Data Visualization Research Lab, Center for Coastal and Ocean Mapping University of New Hampshire. http://ccom.unh.edu
FIX: put macros that do __FILE__ and __LINE__ additions
|
Value: std::cerr << "EXIT_DEBUG called at " \ << __FILE__ << ":" << __LINE__<<": in function '" <<__FUNCTION__ << "'\n" \ << " STATED REASON: " << why << std::endl; \ exit(EXIT_FAILURE);
|
|
GNU CC attribute to denote unused paramters in function calls. The attribute remove compiler warning for unused arguments and variable. Only works for GNU compilers such as gcc and g++. http://gcc.gnu.org/onlinedocs/gcc-3.4.2/gcc/Variable-Attributes.html |
|
Manipulator like item that writes out the location of the log entry.
|
|
Logging levels. Think of them from the perspective of the runtime requested verbosity. If the user sets their logging level to TERSE, then they will receive messages with message levels for ALWAYS and TERSE. When writing log messages in the program, choose the log level or higher that the message will appear at. For things that will generate massive spewage, select the bombastic level. Log messages that use the NEVER tag will not show up (no matter what). ALWAYS log messages can not be turned off (if logging is enabled. |