Flow123d  release_2.2.0-914-gf1a3a4f
Classes | Macros | Functions
logger.hh File Reference
#include <iostream>
#include <algorithm>
#include <string>
#include <sstream>
#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 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

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

Internal macro defining universal record of log.

Definition at line 240 of file logger.hh.

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

Macro defining 'debug' record of log.

Definition at line 252 of file logger.hh.

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

Macro defining 'log' record of log.

Definition at line 249 of file logger.hh.

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

Macro defining 'message' record of log.

Definition at line 243 of file logger.hh.

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

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

Definition at line 260 of file logger.hh.

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

Macro defining 'warning' record of log.

Definition at line 246 of file logger.hh.

Function Documentation

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

implementation of operators

Definition at line 279 of file logger.cc.

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

Definition at line 289 of file logger.cc.

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

Definition at line 226 of file logger.hh.