Flow123d  JS_before_hm-1713-g943b6bc16
Classes | 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...
 

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 >
Loggeroperator<< (Logger &log, const T &x)
 

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 264 of file logger.hh.

◆ DebugOut

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

Macro defining 'debug' record of log.

Definition at line 276 of file logger.hh.

◆ LogOut

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

Macro defining 'log' record of log.

Definition at line 273 of file logger.hh.

◆ MessageOut

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

Macro defining 'message' record of log.

Definition at line 267 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 284 of file logger.hh.

◆ WarningOut

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

Macro defining 'warning' record of log.

Definition at line 270 of file logger.hh.

Function Documentation

◆ operator<<() [1/4]

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

Definition at line 242 of file logger.hh.

◆ operator<<() [2/4]

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

Definition at line 251 of file logger.hh.

◆ operator<<() [3/4]

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

Definition at line 291 of file logger.cc.

◆ operator<<() [4/4]

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

implementation of operators

Definition at line 281 of file logger.cc.