PSCF v1.1
Log.h
1#ifndef UTIL_LOG_H
2#define UTIL_LOG_H
3
4/*
5* Util Package - C++ Utilities for Scientific Computation
6*
7* Copyright 2010 - 2017, The Regents of the University of Minnesota
8* Distributed under the terms of the GNU General Public License.
9*/
10
11#include <iostream>
12#include <fstream>
13
14namespace Util
15{
16
30 class Log
31 {
32
33 public:
34
38 static void initStatic();
39
45 static void setFile(std::ofstream& file);
46
50 static void close();
51
55 static std::ostream& file();
56
57 private:
58
60 static std::ostream* streamPtr_;
61
63 static std::ofstream* filePtr_;
64
66 Log();
67
68 };
69
70}
71#endif
A static class that holds a log output stream.
Definition: Log.h:31
static void setFile(std::ofstream &file)
Set the log ostream to a file.
Definition: Log.cpp:36
static void close()
Close log file, if any.
Definition: Log.cpp:45
static std::ostream & file()
Get log ostream by reference.
Definition: Log.cpp:57
static void initStatic()
Initialize static members.
Definition: Log.cpp:23
Utility classes for scientific computation.
Definition: accumulators.mod:1