IMP logo

log.h File Reference

Logging and error reporting support. More...

Include dependency graph for log.h:

This graph shows which files directly or indirectly include this file:

Go to the source code of this file.


Data Structures

class  IMP::IncreaseIndent
 Increase the current indent in the log by one level. More...

Namespaces

namespace  IMP
 The IMP kernel provides base classes and key shared functionality.

Detailed Description

Logging and error reporting support.

Copyright 2007-2010 IMP Inventors. All rights reserved.


Define Documentation

#define IMP_ERROR ( expr   ) 

Write a warning to standard error.

Parameters:
[in] expr An expression to be output to std::cerr. It is prefixed by "ERROR"

#define IMP_ERROR_WRITE ( expr   ) 

Write an entry to standard error; for objects with no operator<<.

Parameters:
[in] expr An expression which writes something to IMP_STREAM. It is prefixed by "ERROR"

#define IMP_IF_LOG ( level   )     if (level <= ::IMP::get_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.

   IMP_IF_LOG(VERBOSE) {
     std::vector<double> testp(input.begin(), input.end());
     std::sort(testp.begin(), testp.end());
     IMP_LOG(VERBOSE, "Sorted order is ");
     IMP_LOG_WRITE(VERBOSE, std::copy(testp.begin(), testp.end(),
                   std::ostream_iterator<double>(IMP_STREAM, " ")));
   }

#define IMP_LOG ( level,
expr   ) 

Write an entry to a log.

Parameters:
[in] level The IMP::Log_Level for the message
[in] expr A stream expression to be sent to the output stream
Usage:
    IMP_LOG(VERBOSE, "Hi there, I'm very talkative. My favorite numbers are "
                     << 1 << " " << 2 << " " << 3);

#define IMP_LOG_WRITE ( level,
expr   ) 

Write an entry to a log. This is to be used for objects with no operator<<.

Parameters:
[in] level The IMP::Log_Level for the message
[in] expr An expression which writes something to IMP_STREAM
    IMP_LOG_WRITE(VERBOSE, IMP::atom::write_pdb(h, IMP_STREAM));

#define IMP_WARN ( expr   ) 

Write a warning to a log.

Parameters:
[in] expr An expression to be output to the log. It is prefixed by "WARNING"

#define IMP_WARN_ONCE ( 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.

Warnings are only output when the context object is destroyed.

#define IMP_WARN_WRITE ( expr   ) 

Write an entry to a log. This is to be used for objects with no operator<<.

Parameters:
[in] expr An expression which writes something to IMP_STREAM. It is prefixed by "WARNING"


Generated on Mon Mar 8 23:05:57 2010 for IMP by doxygen 1.5.8