mmCEsim 0.3.0
mmWave Channel Estimation Simulation
Log Class Reference

Log support during compilation. More...

#include <log.h>

Public Member Functions

 Log ()
 Construct a new Log object. More...
 
 ~Log ()
 Destroy the Log object. More...
 
std::ofstream & write ()
 Write contents to the log file. More...
 
std::ofstream & info ()
 Write infomation to the log file. More...
 
std::ofstream & war ()
 Write warning message to the log file. More...
 
std::ofstream & err ()
 Write error message to the log file. More...
 
std::ofstream & msg ()
 Write a message to the log file. More...
 
void flush ()
 Flush the buff into the log file. More...
 
void writeArg (int argc, char *argv[])
 Write CLI arguments information to log. More...
 

Private Attributes

std::ofstream _f
 output file stream More...
 
bool _open = false
 whether the file successfully opened More...
 

Detailed Description

Log support during compilation.

Constructor & Destructor Documentation

◆ Log()

Log::Log ( )

Construct a new Log object.

The file initialization is processed here.

Note
If the log file cannot be opened, a warning will be displayed.
Here is the call graph for this function:

◆ ~Log()

Log::~Log ( )

Destroy the Log object.

Close the ostream file.

Member Function Documentation

◆ err()

std::ofstream & Log::err ( )
inline

Write error message to the log file.

The line is started with [ERROR]

Returns
(std::ofstream&) The output (log) file stream.
Here is the caller graph for this function:

◆ flush()

void Log::flush ( )
inline

Flush the buff into the log file.

This is equivalent to Log::write() << std::endl.

Here is the caller graph for this function:

◆ info()

std::ofstream & Log::info ( )
inline

Write infomation to the log file.

The line is started with [INFO]

Returns
(std::ofstream&) The output (log) file stream.
Here is the caller graph for this function:

◆ msg()

std::ofstream & Log::msg ( )
inline

Write a message to the log file.

The line is started with [MESSAGE]

Returns
(std::ofstream&) The output (log) file stream.

◆ war()

std::ofstream & Log::war ( )
inline

Write warning message to the log file.

The line is started with [WARNING]

Returns
(std::ofstream&) The output (log) file stream.
Here is the caller graph for this function:

◆ write()

std::ofstream & Log::write ( )
inline

Write contents to the log file.

Returns
(std::ofstream&) The output (log) file stream.
Here is the caller graph for this function:

◆ writeArg()

void Log::writeArg ( int  argc,
char *  argv[] 
)

Write CLI arguments information to log.

Parameters
argcThe number of CLI arguments.
argvThe CLI arguments.
Here is the caller graph for this function:

Member Data Documentation

◆ _f

std::ofstream Log::_f
private

output file stream

◆ _open

bool Log::_open = false
private

whether the file successfully opened


The documentation for this class was generated from the following files: