Maestro
0.3.11
Unified interface for quantum circuit simulation
Loading...
Searching...
No Matches
LogFile.h
Go to the documentation of this file.
1
9
10
#pragma once
11
12
#ifndef __LOG_FILE_H__
13
#define __LOG_FILE_H__
14
15
#include <fstream>
16
#include <iostream>
17
#include <string>
18
19
namespace
Utils
20
{
21
22
class
LogFile
23
{
24
public
:
25
LogFile
(
const
std::string &filename)
26
{
27
logFile.open(filename, std::ios::out | std::ios::app);
28
if
(!logFile.is_open())
29
{
30
std::cerr <<
"Failed to open log file: "
<< filename << std::endl;
31
}
32
}
33
34
void
Log
(
const
std::string &message)
35
{
36
if
(logFile.is_open())
37
{
38
logFile << message << std::endl;
39
}
40
else
41
{
42
std::cerr <<
"Log file is not open. Message: "
<< message << std::endl;
43
}
44
}
45
46
private
:
47
std::ofstream logFile;
48
};
49
50
}
// namespace Utils
51
52
#endif
// __LOG_FILE_H__
Utils::LogFile::Log
void Log(const std::string &message)
Definition
LogFile.h:34
Utils::LogFile::LogFile
LogFile(const std::string &filename)
Definition
LogFile.h:25
Utils
Portable dense contraction kernels.
Definition
BivariateHermiteInterpolation.h:19
Utils
LogFile.h
Generated on
for Maestro by
1.16.1