Flow123d  DF_patch_fe_data_tables-3ffbd47
Classes | Namespaces | Macros | Functions
logger.hh File Reference
#include <iostream>
#include <algorithm>
#include <string>
#include <sstream>
#include <vector>
#include "system/fmt/format.h"
#include "system/exc_common.hh"
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Classes

class  StreamMask
 Helper class, store mask specifying streams. More...
 
class  Logger
 Class for storing logger messages. More...
 
struct  manipulators::Array< Cont, Delim >
 

Namespaces

 manipulators
 

Macros

#define _LOG(type)    Logger( type ).set_context( __FILE__, __func__, __LINE__)
 Internal macro defining universal record of log. More...
 
#define MessageOut()    _LOG( Logger::MsgType::message )
 Macro defining 'message' record of log. More...
 
#define WarningOut()    _LOG( Logger::MsgType::warning )
 Macro defining 'warning' record of log. More...
 
#define LogOut()    _LOG( Logger::MsgType::log )
 Macro defining 'log' record of log. More...
 
#define DebugOut()    _LOG( Logger::MsgType::debug )
 Macro defining 'debug' record of log. More...
 
#define print_var(var)    std::string(#var) << "=" << (var) << ", "
 

Functions

Loggeroperator<< (Logger &log, StreamMask mask)
 
Loggeroperator<< (Logger &log, std::ostream &(*pf)(std::ostream &))
 
template<class T >
Loggeroperator<< (Logger &log, const std::vector< T > &vec)
 
template<class T , long unsigned int N>
Loggeroperator<< (Logger &log, const std::array< T, N > &vec)
 
template<class T >
Loggeroperator<< (Logger &log, const T &x)
 
template<typename T , typename Delim = const char*>
manipulators::Array< T, Delim > format (T const &deduce, Delim delim=", ")
 

Detailed Description

 * Copyright (C) 2015 Technical University of Liberec. All rights reserved.

This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License version 3 as published by the Free Software Foundation. (http://www.gnu.org/licenses/gpl-3.0.en.html)

This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.

Definition in file logger.hh.

Macro Definition Documentation

◆ _LOG

#define _LOG (   type)     Logger( type ).set_context( __FILE__, __func__, __LINE__)

Internal macro defining universal record of log.

Definition at line 272 of file logger.hh.

◆ DebugOut

#define DebugOut ( )     _LOG( Logger::MsgType::debug )

Macro defining 'debug' record of log.

Definition at line 284 of file logger.hh.

◆ LogOut

#define LogOut ( )     _LOG( Logger::MsgType::log )

Macro defining 'log' record of log.

Definition at line 281 of file logger.hh.

◆ MessageOut

#define MessageOut ( )     _LOG( Logger::MsgType::message )

Macro defining 'message' record of log.

Definition at line 275 of file logger.hh.

◆ print_var

#define print_var (   var)     std::string(#var) << "=" << (var) << ", "

Print variable name and value. Usage: DebugOut() << print_var(x) << print_var(y)

Definition at line 292 of file logger.hh.

◆ WarningOut

#define WarningOut ( )     _LOG( Logger::MsgType::warning )

Macro defining 'warning' record of log.

Definition at line 278 of file logger.hh.

Function Documentation

◆ format()

template<typename T , typename Delim = const char*>
manipulators::Array<T, Delim> format ( T const &  deduce,
Delim  delim = ", " 
)

Definition at line 325 of file logger.hh.

Here is the caller graph for this function:

◆ operator<<() [1/5]

template<class T , long unsigned int N>
Logger& operator<< ( Logger log,
const std::array< T, N > &  vec 
)

Definition at line 250 of file logger.hh.

◆ operator<<() [2/5]

template<class T >
Logger& operator<< ( Logger log,
const std::vector< T > &  vec 
)

Definition at line 242 of file logger.hh.

◆ operator<<() [3/5]

template<class T >
Logger& operator<< ( Logger log,
const T &  x 
)

Definition at line 259 of file logger.hh.

◆ operator<<() [4/5]

Logger& operator<< ( Logger log,
std::ostream &(*)(std::ostream &)  pf 
)

Definition at line 229 of file logger.cc.

◆ operator<<() [5/5]

Logger& operator<< ( Logger log,
StreamMask  mask 
)

implementation of operators

Definition at line 231 of file logger.cc.