27 #include <tpie/config.h>
67 void log(
log_level level,
const char * message,
size_t size);
135 inline bool get_orig() {
return m_orig;}
146 #define TP_LOG_FLUSH_LOG tpie::get_log().flush()
150 #define TP_LOG_FATAL(msg) tpie::log_fatal() << msg
151 #define TP_LOG_WARNING(msg) tpie::log_warning() << msg
153 #define TP_LOG_APP_DEBUG(msg) tpie::log_app_debug() << msg
155 #define TP_LOG_DEBUG(msg) tpie::log_debug() << msg
157 #define TP_LOG_MEM_DEBUG(msg) tpie::log_mem_debug() << msg
160 #define TP_LOG_ID_MSG __FILE__ << " line " << __LINE__ << ": "
163 #define TP_LOG_FATAL_ID(msg) TP_LOG_FATAL(TP_LOG_ID_MSG << msg << std::endl)
166 #define TP_LOG_WARNING_ID(msg) TP_LOG_WARNING(TP_LOG_ID_MSG << msg << std::endl)
169 #define TP_LOG_APP_DEBUG_ID(msg) TP_LOG_APP_DEBUG(TP_LOG_ID_MSG << msg << std::endl)
172 #define TP_LOG_DEBUG_ID(msg) TP_LOG_DEBUG(TP_LOG_ID_MSG << msg << std::endl)
175 #define TP_LOG_MEM_DEBUG_ID(msg) TP_LOG_MEM_DEBUG(TP_LOG_ID_MSG << msg << std::endl)
177 #else // !TPL_LOGGING
180 #define TP_LOG_FATAL(msg)
181 #define TP_LOG_WARNING(msg)
182 #define TP_LOG_APP_DEBUG(msg)
183 #define TP_LOG_DEBUG(msg)
184 #define TP_LOG_MEM_DEBUG(msg)
186 #define TP_LOG_FATAL_ID(msg)
187 #define TP_LOG_WARNING_ID(msg)
188 #define TP_LOG_APP_DEBUG_ID(msg)
189 #define TP_LOG_DEBUG_ID(msg)
190 #define TP_LOG_MEM_DEBUG_ID(msg)
192 #define TP_LOG_FLUSH_LOG {}
194 #endif // TPL_LOGGING
198 #endif // _TPIE_LOG_H
Logging level for warnings concerning memory allocation and deallocation.
A log is like a regular output stream, but it also supports messages at different priorities...
LOG_FATAL is the highest error level and is used for all kinds of errors that would normally impair s...
LOG_ERROR is used for none fatal errors.
LOG_WARNING is used for warnings.
A simple logger that writes messages to a tpie temporary file.
logstream & log_info()
Return logstream for writing info log messages.
logstream & get_log()
Returns the only logstream object.
A simple logger that writes messages to stderr.
logstream class used by definitions in tpie_log.h.
file_log_target(log_level threshold)
Construct a new file logger.
const std::string & log_name()
Returns the file name of the log stream.
void log(log_level level, const char *message, size_t size)
Implement log_target virtual method to record message.
LOG_INFORMATIONAL is used for informational messagse.
stderr_log_target(log_level threshold)
Construct a new stderr logger.
log_level
TPIE logging levels, from higest priority to lowest.
logstream & log_debug()
Return logstream for writing debug log messages.
logstream & log_fatal()
Return logstream for writing fatal log messages.
logstream & log_app_debug()
Return logstream for writing app_debug log messages.
void init_default_log()
Used by tpie_init to initialize the log subsystem.
LOG_DEBUG is the lowest level and is used by the TPIE library for logging debugging information...
void finish_default_log()
Used by tpie_finish to deinitialize the log subsystem.
logstream & log_error()
Return logstream for writing error log messages.
logstream & log_warning()
Return logstream for writing warning log messages.
logstream & log_mem_debug()
Return logstream for writing mem_debug log messages.
void log(log_level level, const char *message, size_t)
Implement log_target virtual method to record message.
LOG_APP_DEBUG can be used by applications built on top of TPIE, for logging debugging information...