Loading...
Searching...
No Matches
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

namespace | openvdb
namespace | openvdb::v11_0
namespace | openvdb::v11_0::logging

## Macros

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

## Enumerations

enum class | 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.
void | setLevel (Level lvl)
| Set the logging level. (Lower-level messages will be suppressed.)
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.
void | setProgramName (const std::string &progName, bool useColor=true)
| Specify a program name to be displayed in log messages.
void | initialize (bool useColor=true)
| Initialize the logging system if it is not already initialized.
void | initialize (int &argc, char *argv[], bool useColor=true)
| Initialize the logging system from command-line arguments.

## Macro Definition Documentation

## OPENVDB_LOG

#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);

## OPENVDB_LOG_DEBUG

#define OPENVDB_LOG_DEBUG | ( |  | message | ) |

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

## OPENVDB_LOG_DEBUG_RUNTIME

#define OPENVDB_LOG_DEBUG_RUNTIME | ( |  | message | ) |

Value:
OPENVDB_LOG(DEBUG, message)
OPENVDB_LOG
#define OPENVDB_LOG(level, message)
Definition logging.h:243

Log a debugging message in both debug and optimized builds.

Warning
  Don't use this in performance-critical code.

## OPENVDB_LOG_ERROR

#define OPENVDB_LOG_ERROR | ( |  | message | ) |

Value:
OPENVDB_LOG(ERROR, message)

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

## OPENVDB_LOG_FATAL

#define OPENVDB_LOG_FATAL | ( |  | message | ) |

Value:
OPENVDB_LOG(FATAL, message)

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

## OPENVDB_LOG_INFO

#define OPENVDB_LOG_INFO | ( |  | message | ) |

Value:
OPENVDB_LOG(INFO, message)

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

## OPENVDB_LOG_WARN

#define OPENVDB_LOG_WARN | ( |  | message | ) |

Value:
OPENVDB_LOG(WARN, message)

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