SOPT
Sparse OPTimisation
Classes | Namespaces | Macros | Functions
logging.h File Reference
#include "sopt/config.h"
#include "sopt/exception.h"
#include <map>
#include <memory>
#include <cstring>
+ Include dependency graph for logging.h:

Go to the source code of this file.

Classes

class  sopt::logging::Log
 Logging system for controlled & formatted writing to stdout. More...
 

Namespaces

 sopt
 
 sopt::logging
 

Macros

#define SOPT_MSG_LVL(lvl, ...)
 Neat CPU-conserving logging macros. Use by preference! More...
 
#define SOPT_LOG_(TYPE, ...)    SOPT_MSG_LVL(sopt::logging::Log::TYPE, __VA_ARGS__)
 \macro For internal use only More...
 
#define SOPT_NOTICE(...)   SOPT_LOG_(critical, __VA_ARGS__)
 \macro Normal but significant condition or critical error More...
 
#define SOPT_ERROR(...)   SOPT_LOG_(error, __VA_ARGS__)
 \macro Something is definitely wrong, algorithm exits More...
 
#define SOPT_WARN(...)   SOPT_LOG_(warn, __VA_ARGS__)
 \macro Something might be going wrong More...
 
#define SOPT_INFO(...)   SOPT_LOG_(info, __VA_ARGS__)
 \macro Verbose informational message about normal condition More...
 
#define SOPT_DEBUG(...)   SOPT_LOG_(debug, __VA_ARGS__)
 \macro Output some debugging More...
 
#define SOPT_TRACE(...)   SOPT_LOG_(trace, __VA_ARGS__)
 
#define SOPT_HIGH_LOG(...)   SOPT_LOG_(critical, __VA_ARGS__)
 High priority message. More...
 
#define SOPT_MEDIUM_LOG(...)   SOPT_LOG_(info, __VA_ARGS__)
 Medium priority message. More...
 
#define SOPT_LOW_LOG(...)   SOPT_LOG_(debug, __VA_ARGS__)
 Low priority message. More...
 

Functions

ostream & sopt::logging::operator<< (Log &log, int level)
 Streaming output to a logger must have a Log::Level/int as its first argument. More...
 
Log & sopt::logging::getLog ()
 Access method to default Log object. More...
 
void sopt::logging::set_level (const std::string &level)
 Method to set the logging level of the default Log object. More...
 
template<typename Arg >
void sopt::logging::applyFormat (std::stringstream &ss, char *&pos, Arg &&arg)
 
template<typename... Args>
std::string sopt::logging::mkFormattedString (const char *txt, Args &&... args)
 Helper method to construct formatted string. More...
 
const std::string & sopt::logging::mkFormattedString (const std::string &txt)
 

Macro Definition Documentation

◆ SOPT_DEBUG

#define SOPT_DEBUG (   ...)    SOPT_LOG_(debug, __VA_ARGS__)

\macro Output some debugging

Definition at line 217 of file logging.h.

◆ SOPT_ERROR

#define SOPT_ERROR (   ...)    SOPT_LOG_(error, __VA_ARGS__)

\macro Something is definitely wrong, algorithm exits

Definition at line 211 of file logging.h.

◆ SOPT_HIGH_LOG

#define SOPT_HIGH_LOG (   ...)    SOPT_LOG_(critical, __VA_ARGS__)

High priority message.

Definition at line 223 of file logging.h.

◆ SOPT_INFO

#define SOPT_INFO (   ...)    SOPT_LOG_(info, __VA_ARGS__)

\macro Verbose informational message about normal condition

Definition at line 215 of file logging.h.

◆ SOPT_LOW_LOG

#define SOPT_LOW_LOG (   ...)    SOPT_LOG_(debug, __VA_ARGS__)

Low priority message.

Definition at line 227 of file logging.h.

◆ SOPT_MEDIUM_LOG

#define SOPT_MEDIUM_LOG (   ...)    SOPT_LOG_(info, __VA_ARGS__)

Medium priority message.

Definition at line 225 of file logging.h.

◆ SOPT_NOTICE

#define SOPT_NOTICE (   ...)    SOPT_LOG_(critical, __VA_ARGS__)

\macro Normal but significant condition or critical error

Definition at line 209 of file logging.h.

◆ SOPT_TRACE

#define SOPT_TRACE (   ...)    SOPT_LOG_(trace, __VA_ARGS__)

\macro Output internal values of no interest to anyone

Except maybe when debugging.

Definition at line 220 of file logging.h.

◆ SOPT_WARN

#define SOPT_WARN (   ...)    SOPT_LOG_(warn, __VA_ARGS__)

\macro Something might be going wrong

Definition at line 213 of file logging.h.