Simpact Cyan
Population based event driven simulation using mNRM
Public Member Functions | Static Public Member Functions | List of all members
LogFile Class Reference

Helper class to write to a log file. More...

#include <logfile.h>

Public Member Functions

bool_t open (const std::string &fileName)
 Opens the specified file for writing. More...
 
std::string getFileName () const
 Returns the filename from the 'open' call. More...
 
void print (const char *format,...)
 Writes the specified parameters (similar to printf) to the logfile, automatically appending a newline character (\n). More...
 
void printNoNewLine (const char *format,...)
 Writes the specified parameters (similar to printf) to the logfile. More...
 
void close ()
 Finalizes and closes the log file. More...
 

Static Public Member Functions

static void writeToAllLogFiles (const std::string &str)
 Method to write something to all currently open log files, useful when program aborts and a message should appear in all logs. More...
 

Detailed Description

Helper class to write to a log file.

Member Function Documentation

void LogFile::close ( )

Finalizes and closes the log file.

std::string LogFile::getFileName ( ) const
inline

Returns the filename from the 'open' call.

bool_t LogFile::open ( const std::string &  fileName)

Opens the specified file for writing.

void LogFile::print ( const char *  format,
  ... 
)

Writes the specified parameters (similar to printf) to the logfile, automatically appending a newline character (\n).

void LogFile::printNoNewLine ( const char *  format,
  ... 
)

Writes the specified parameters (similar to printf) to the logfile.

void LogFile::writeToAllLogFiles ( const std::string &  str)
static

Method to write something to all currently open log files, useful when program aborts and a message should appear in all logs.


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