KASKADE 7 development version
logging.hh
Go to the documentation of this file.
1/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
2/* */
3/* This file is part of the library KASKADE 7 */
4/* https://www.zib.de/research/projects/kaskade7-finite-element-toolbox */
5/* */
6/* Copyright (C) 2024-2024 Zuse Institute Berlin */
7/* */
8/* KASKADE 7 is distributed under the terms of the ZIB Academic License. */
9/* see $KASKADE/academic.txt */
10/* */
11/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
12
13#ifndef LOGGING_HH
14#define LOGGING_HH
15
16
17#include <fstream>
18#include <iostream>
19
20
21namespace Kaskade
22{
27 class Logger
28 {
29 public:
36 Logger(int level, std::ostream& out=std::cout);
37
39
43 bool operator()(int level, std::string const& message);
44
48 std::ostream& operator()(int level);
49
50 private:
51 int level;
52 std::ostream* out;
53 std::ofstream discard;
54 };
55}
56
57#endif
Simple logging facility.
Definition: logging.hh:28
Logger(int level, std::ostream &out=std::cout)
Constructor.
std::ostream & operator()(int level)
Provides access to the log output stream used for messages of the given level.
bool operator()(int level, std::string const &message)
log a message with given level