OpenCV  4.1.0
Open Source Computer Vision
Namespaces | Macros | Enumerations | Functions
logger.hpp File Reference
#include <iostream>
#include <sstream>
#include <limits.h>
#include "logger.defines.hpp"

Namespaces

namespace  cv
 "black box" representation of the file storage associated with a file on disk.
 
namespace  cv::utils
 
namespace  cv::utils::logging
 
namespace  cv::utils::logging::internal
 

Macros

#define CV_LOG_DEBUG(tag,...)   for(;;) { if (cv::utils::logging::getLogLevel() < cv::utils::logging::LOG_LEVEL_DEBUG) break; std::stringstream ss; ss << __VA_ARGS__; cv::utils::logging::internal::writeLogMessage(cv::utils::logging::LOG_LEVEL_DEBUG, ss.str().c_str()); break; }
 
#define CV_LOG_ERROR(tag,...)   for(;;) { if (cv::utils::logging::getLogLevel() < cv::utils::logging::LOG_LEVEL_ERROR) break; std::stringstream ss; ss << __VA_ARGS__; cv::utils::logging::internal::writeLogMessage(cv::utils::logging::LOG_LEVEL_ERROR, ss.str().c_str()); break; }
 
#define CV_LOG_FATAL(tag,...)   for(;;) { if (cv::utils::logging::getLogLevel() < cv::utils::logging::LOG_LEVEL_FATAL) break; std::stringstream ss; ss << __VA_ARGS__; cv::utils::logging::internal::writeLogMessage(cv::utils::logging::LOG_LEVEL_FATAL, ss.str().c_str()); break; }
 
#define CV_LOG_INFO(tag,...)   for(;;) { if (cv::utils::logging::getLogLevel() < cv::utils::logging::LOG_LEVEL_INFO) break; std::stringstream ss; ss << __VA_ARGS__; cv::utils::logging::internal::writeLogMessage(cv::utils::logging::LOG_LEVEL_INFO, ss.str().c_str()); break; }
 
#define CV_LOG_STRIP_LEVEL   CV_LOG_LEVEL_VERBOSE
 
#define CV_LOG_VERBOSE(tag, v,...)
 
#define CV_LOG_WARNING(tag,...)   for(;;) { if (cv::utils::logging::getLogLevel() < cv::utils::logging::LOG_LEVEL_WARNING) break; std::stringstream ss; ss << __VA_ARGS__; cv::utils::logging::internal::writeLogMessage(cv::utils::logging::LOG_LEVEL_WARNING, ss.str().c_str()); break; }
 

Enumerations

enum  cv::utils::logging::LogLevel {
  cv::utils::logging::LOG_LEVEL_SILENT = 0,
  cv::utils::logging::LOG_LEVEL_FATAL = 1,
  cv::utils::logging::LOG_LEVEL_ERROR = 2,
  cv::utils::logging::LOG_LEVEL_WARNING = 3,
  cv::utils::logging::LOG_LEVEL_INFO = 4,
  cv::utils::logging::LOG_LEVEL_DEBUG = 5,
  cv::utils::logging::LOG_LEVEL_VERBOSE = 6
}
 Supported logging levels and their semantic. More...
 

Functions

LogLevel cv::utils::logging::getLogLevel ()
 
LogLevel cv::utils::logging::setLogLevel (LogLevel logLevel)
 
void cv::utils::logging::internal::writeLogMessage (LogLevel logLevel, const char *message)
 

Macro Definition Documentation

#define CV_LOG_DEBUG (   tag,
  ... 
)    for(;;) { if (cv::utils::logging::getLogLevel() < cv::utils::logging::LOG_LEVEL_DEBUG) break; std::stringstream ss; ss << __VA_ARGS__; cv::utils::logging::internal::writeLogMessage(cv::utils::logging::LOG_LEVEL_DEBUG, ss.str().c_str()); break; }
#define CV_LOG_ERROR (   tag,
  ... 
)    for(;;) { if (cv::utils::logging::getLogLevel() < cv::utils::logging::LOG_LEVEL_ERROR) break; std::stringstream ss; ss << __VA_ARGS__; cv::utils::logging::internal::writeLogMessage(cv::utils::logging::LOG_LEVEL_ERROR, ss.str().c_str()); break; }
#define CV_LOG_FATAL (   tag,
  ... 
)    for(;;) { if (cv::utils::logging::getLogLevel() < cv::utils::logging::LOG_LEVEL_FATAL) break; std::stringstream ss; ss << __VA_ARGS__; cv::utils::logging::internal::writeLogMessage(cv::utils::logging::LOG_LEVEL_FATAL, ss.str().c_str()); break; }
#define CV_LOG_INFO (   tag,
  ... 
)    for(;;) { if (cv::utils::logging::getLogLevel() < cv::utils::logging::LOG_LEVEL_INFO) break; std::stringstream ss; ss << __VA_ARGS__; cv::utils::logging::internal::writeLogMessage(cv::utils::logging::LOG_LEVEL_INFO, ss.str().c_str()); break; }
#define CV_LOG_STRIP_LEVEL   CV_LOG_LEVEL_VERBOSE

Define CV_LOG_STRIP_LEVEL=CV_LOG_LEVEL_[DEBUG|INFO|WARN|ERROR|FATAL|DISABLED] to compile out anything at that and before that logging level

#define CV_LOG_VERBOSE (   tag,
  v,
  ... 
)
#define CV_LOG_WARNING (   tag,
  ... 
)    for(;;) { if (cv::utils::logging::getLogLevel() < cv::utils::logging::LOG_LEVEL_WARNING) break; std::stringstream ss; ss << __VA_ARGS__; cv::utils::logging::internal::writeLogMessage(cv::utils::logging::LOG_LEVEL_WARNING, ss.str().c_str()); break; }