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

Namespaces

 cv
 
 cv::utils
 
 cv::utils::logging
 
 cv::utils::logging::internal
 

Macros

#define CV_LOG_DEBUG(tag, ...)   CV_LOG_WITH_TAG(tag, cv::utils::logging::LOG_LEVEL_DEBUG, , , , __VA_ARGS__)
 
#define CV_LOG_ERROR(tag, ...)   CV_LOG_WITH_TAG(tag, cv::utils::logging::LOG_LEVEL_ERROR, , , , __VA_ARGS__)
 
#define CV_LOG_FATAL(tag, ...)   CV_LOG_WITH_TAG(tag, cv::utils::logging::LOG_LEVEL_FATAL, , , , __VA_ARGS__)
 
#define CV_LOG_IF_DEBUG(tag, logging_cond, ...)   CV_LOG_WITH_TAG(tag, cv::utils::logging::LOG_LEVEL_DEBUG, , CV__LOG_IF_CHECK(logging_cond), , __VA_ARGS__)
 
#define CV_LOG_IF_ERROR(tag, logging_cond, ...)   CV_LOG_WITH_TAG(tag, cv::utils::logging::LOG_LEVEL_ERROR, , CV__LOG_IF_CHECK(logging_cond), , __VA_ARGS__)
 
#define CV_LOG_IF_FATAL(tag, logging_cond, ...)   CV_LOG_WITH_TAG(tag, cv::utils::logging::LOG_LEVEL_FATAL, , CV__LOG_IF_CHECK(logging_cond), , __VA_ARGS__)
 
#define CV_LOG_IF_INFO(tag, logging_cond, ...)   CV_LOG_WITH_TAG(tag, cv::utils::logging::LOG_LEVEL_INFO, , CV__LOG_IF_CHECK(logging_cond), , __VA_ARGS__)
 
#define CV_LOG_IF_VERBOSE(tag, v, logging_cond, ...)   CV_LOG_WITH_TAG(tag, cv::utils::logging::LOG_LEVEL_VERBOSE, , CV__LOG_IF_CHECK(logging_cond), << "[VERB" << v << ":" << cv::utils::getThreadID() << "] ", __VA_ARGS__)
 
#define CV_LOG_IF_VERBOSE(tag, v, logging_cond, ...)
 
#define CV_LOG_IF_WARNING(tag, logging_cond, ...)   CV_LOG_WITH_TAG(tag, cv::utils::logging::LOG_LEVEL_WARNING, , CV__LOG_IF_CHECK(logging_cond), , __VA_ARGS__)
 
#define CV_LOG_INFO(tag, ...)   CV_LOG_WITH_TAG(tag, cv::utils::logging::LOG_LEVEL_INFO, , , , __VA_ARGS__)
 
#define CV_LOG_ONCE_DEBUG(tag, ...)   CV_LOG_WITH_TAG(tag, cv::utils::logging::LOG_LEVEL_DEBUG, CV__LOG_ONCE_CHECK_PRE, CV__LOG_ONCE_CHECK_POST, , __VA_ARGS__)
 
#define CV_LOG_ONCE_ERROR(tag, ...)   CV_LOG_WITH_TAG(tag, cv::utils::logging::LOG_LEVEL_ERROR, CV__LOG_ONCE_CHECK_PRE, CV__LOG_ONCE_CHECK_POST, , __VA_ARGS__)
 
#define CV_LOG_ONCE_INFO(tag, ...)   CV_LOG_WITH_TAG(tag, cv::utils::logging::LOG_LEVEL_INFO, CV__LOG_ONCE_CHECK_PRE, CV__LOG_ONCE_CHECK_POST, , __VA_ARGS__)
 
#define CV_LOG_ONCE_VERBOSE(tag, v, ...)   CV_LOG_WITH_TAG(tag, cv::utils::logging::LOG_LEVEL_VERBOSE, CV__LOG_ONCE_CHECK_PRE, CV__LOG_ONCE_CHECK_POST, << "[VERB" << v << ":" << cv::utils::getThreadID() << "] ", __VA_ARGS__)
 
#define CV_LOG_ONCE_VERBOSE(tag, v, ...)
 
#define CV_LOG_ONCE_WARNING(tag, ...)   CV_LOG_WITH_TAG(tag, cv::utils::logging::LOG_LEVEL_WARNING, CV__LOG_ONCE_CHECK_PRE, CV__LOG_ONCE_CHECK_POST, , __VA_ARGS__)
 
#define CV_LOG_STRIP_LEVEL   CV_LOG_LEVEL_VERBOSE
 
#define CV_LOG_VERBOSE(tag, v, ...)   CV_LOG_WITH_TAG(tag, cv::utils::logging::LOG_LEVEL_VERBOSE, , , << "[VERB" << v << ":" << cv::utils::getThreadID() << "] ", __VA_ARGS__)
 
#define CV_LOG_VERBOSE(tag, v, ...)
 
#define CV_LOG_WARNING(tag, ...)   CV_LOG_WITH_TAG(tag, cv::utils::logging::LOG_LEVEL_WARNING, , , , __VA_ARGS__)
 
#define CV_LOG_WITH_TAG(tag, msgLevel, extra_check0, extra_check1, msg_prefix, ...)
 

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)