IMP
2.3.1
The Integrative Modeling Platform
|
Logging and error reporting support. More...
#include <IMP/base/base_config.h>
#include "enums.h"
#include "log.h"
#include "CreateLogContext.h"
#include "compiler_macros.h"
#include "SetCheckState.h"
#include "internal/log.h"
#include <sstream>
Go to the source code of this file.
Macros | |
#define | IMP_ERROR(expr) |
Write a warning to standard error. More... | |
#define | IMP_ERROR_WRITE(expr) |
#define | IMP_FUNCTION_LOG IMP::base::CreateLogContext log_context__(IMP_CURRENT_FUNCTION) |
Beginning logging for a non-member function. More... | |
#define | IMP_IF_LOG(level) |
Execute the code block if a certain level of logging is on. More... | |
#define | IMP_LOG_CONTEXT(name) IMP::base::CreateLogContext imp_log_context(name, nullptr) |
Create a new log context from a streamed name. More... | |
#define | IMP_LOG_PROGRESS(expr) |
#define | IMP_LOG_TERSE(expr) |
#define | IMP_LOG_VARIABLE(variable) |
#define | IMP_LOG_VERBOSE(expr) |
#define | IMP_LOG_WRITE(level, expr) |
#define | IMP_OBJECT_LOG |
Set the log level to the object's log level. More... | |
#define | IMP_PROGRESS_DISPLAY(name, steps) |
#define | IMP_WARN(expr) |
Write a warning to a log. More... | |
#define | IMP_WARN_ONCE(key, expr, context) |
Write a warning once per context object. More... | |
#define | IMP_WARN_WRITE(expr) |
Logging and error reporting support.
Copyright 2007-2014 IMP Inventors. All rights reserved.
Definition in file log_macros.h.
#define IMP_ERROR | ( | expr | ) |
Write a warning to standard error.
[in] | expr | An expression to be output to std::cerr. It is prefixed by "ERROR" |
Definition at line 72 of file log_macros.h.
#define IMP_FUNCTION_LOG IMP::base::CreateLogContext log_context__(IMP_CURRENT_FUNCTION) |
Beginning logging for a non-member function.
Definition at line 306 of file log_macros.h.
#define IMP_IF_LOG | ( | level | ) |
Execute the code block if a certain level of logging is on.
The next code block (delimited by { }) is executed if get_log_level() >= level.
Definition at line 60 of file log_macros.h.
#define IMP_LOG_CONTEXT | ( | name | ) | IMP::base::CreateLogContext imp_log_context(name, nullptr) |
Create a new log context from a streamed name.
Definition at line 310 of file log_macros.h.
#define IMP_LOG_PROGRESS | ( | expr | ) |
[in] | expr | A stream expression to be sent to the output stream if the log level is at least PROGRESS. |
Usage:
Definition at line 105 of file log_macros.h.
#define IMP_LOG_TERSE | ( | expr | ) |
[in] | expr | A stream expression to be sent to the output stream if the log level is at least TERSE. |
Usage:
Definition at line 83 of file log_macros.h.
#define IMP_LOG_VARIABLE | ( | variable | ) |
Mark a variable as one that is only used in logging. This disables unused variable warnings on it in fast mode.
Definition at line 110 of file log_macros.h.
#define IMP_LOG_VERBOSE | ( | expr | ) |
[in] | expr | A stream expression to be sent to the output stream if the log level is at least TERSE. |
Usage:
Definition at line 94 of file log_macros.h.
#define IMP_OBJECT_LOG |
Set the log level to the object's log level.
All non-trivial Object methods should start with this. It creates a RAII-style object which sets the log level to the local one, if appropriate, until it goes out of scope.
Definition at line 297 of file log_macros.h.
#define IMP_PROGRESS_DISPLAY | ( | name, | |
steps | |||
) |
Like IMP::base::set_progress_display() but you can use stream operations for the name.
Definition at line 329 of file log_macros.h.
#define IMP_WARN | ( | expr | ) |
Write a warning to a log.
[in] | expr | An expression to be output to the log. It is prefixed by "WARNING" |
Definition at line 66 of file log_macros.h.
#define IMP_WARN_ONCE | ( | key, | |
expr, | |||
context | |||
) |
Write a warning once per context object.
Use this macro to, for example, warn on unprocessable fields in a PDB, since they tend to come together. The key is what is tested for uniqueness, the expr is what is output.
Warnings are only output when the context object is destroyed.
Definition at line 320 of file log_macros.h.