OpenVDB  12.0.0
Classes | Namespaces | Macros | Enumerations | Functions
logging.h File Reference
#include <openvdb/version.h>
#include <log4cplus/appender.h>
#include <log4cplus/configurator.h>
#include <log4cplus/consoleappender.h>
#include <log4cplus/layout.h>
#include <log4cplus/logger.h>
#include <log4cplus/spi/loggingevent.h>
#include <algorithm>
#include <cstring>
#include <memory>
#include <sstream>
#include <string>
#include <vector>

Go to the source code of this file.

Classes

struct  LevelScope
 A LevelScope object sets the logging level to a given level and restores it to the current level when the object goes out of scope. More...
 

Namespaces

 openvdb
 
 openvdb::v12_0
 
 openvdb::v12_0::logging
 

Macros

#define OPENVDB_LOG(level, message)
 
#define OPENVDB_LOG_INFO(message)    OPENVDB_LOG(INFO, message)
 Log an info message of the form 'someVar << "some text" << ...'. More...
 
#define OPENVDB_LOG_WARN(message)    OPENVDB_LOG(WARN, message)
 Log a warning message of the form 'someVar << "some text" << ...'. More...
 
#define OPENVDB_LOG_ERROR(message)    OPENVDB_LOG(ERROR, message)
 Log an error message of the form 'someVar << "some text" << ...'. More...
 
#define OPENVDB_LOG_FATAL(message)    OPENVDB_LOG(FATAL, message)
 Log a fatal error message of the form 'someVar << "some text" << ...'. More...
 
#define OPENVDB_LOG_DEBUG(message)
 In debug builds only, log a debugging message of the form 'someVar << "text" << ...'. More...
 
#define OPENVDB_LOG_DEBUG_RUNTIME(message)   OPENVDB_LOG(DEBUG, message)
 Log a debugging message in both debug and optimized builds. More...
 

Enumerations

enum  Level {
  Debug = log4cplus::DEBUG_LOG_LEVEL, Info = log4cplus::INFO_LOG_LEVEL, Warn = log4cplus::WARN_LOG_LEVEL, Error = log4cplus::ERROR_LOG_LEVEL,
  Fatal = log4cplus::FATAL_LOG_LEVEL
}
 Message severity level. More...
 

Functions

Level getLevel ()
 Return the current logging level. More...
 
void setLevel (Level lvl)
 Set the logging level. (Lower-level messages will be suppressed.) More...
 
void setLevel (int &argc, char *argv[])
 If "-debug", "-info", "-warn", "-error" or "-fatal" is found in the given array of command-line arguments, set the logging level appropriately and remove the relevant argument(s) from the array. More...
 
void setProgramName (const std::string &progName, bool useColor=true)
 Specify a program name to be displayed in log messages. More...
 
void initialize (bool useColor=true)
 Initialize the logging system if it is not already initialized. More...
 
void initialize (int &argc, char *argv[], bool useColor=true)
 Initialize the logging system from command-line arguments. More...
 

Macro Definition Documentation

#define OPENVDB_LOG (   level,
  message 
)
Value:
do { \
auto _log = openvdb::logging::internal::getLogger(); \
if (_log.isEnabledFor(log4cplus::level##_LOG_LEVEL)) { \
std::ostringstream _buf; \
_buf << message; \
_log.forcedLog(log4cplus::level##_LOG_LEVEL, _buf.str(), __FILE__, __LINE__); \
} \
} while (0);
#define OPENVDB_LOG_DEBUG (   message)

In debug builds only, log a debugging message of the form 'someVar << "text" << ...'.

#define OPENVDB_LOG_DEBUG_RUNTIME (   message)    OPENVDB_LOG(DEBUG, message)

Log a debugging message in both debug and optimized builds.

Warning
Don't use this in performance-critical code.
#define OPENVDB_LOG_ERROR (   message)    OPENVDB_LOG(ERROR, message)

Log an error message of the form 'someVar << "some text" << ...'.

#define OPENVDB_LOG_FATAL (   message)    OPENVDB_LOG(FATAL, message)

Log a fatal error message of the form 'someVar << "some text" << ...'.

#define OPENVDB_LOG_INFO (   message)    OPENVDB_LOG(INFO, message)

Log an info message of the form 'someVar << "some text" << ...'.

#define OPENVDB_LOG_WARN (   message)    OPENVDB_LOG(WARN, message)

Log a warning message of the form 'someVar << "some text" << ...'.