FEI Package Browser (Single Doxygen Collection)  Version of the Day
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
Public Member Functions | Static Public Member Functions | Private Member Functions | Private Attributes | List of all members
fei::LogFile Class Reference

#include <fei_LogFile.hpp>

Public Member Functions

virtual ~LogFile ()
 
void openOutputStream (const char *path=NULL, int nprocs=1, int localproc=0)
 
FEI_OSTREAMgetOutputStream ()
 
void closeOutputStream ()
 

Static Public Member Functions

static LogFilegetLogFile ()
 

Private Member Functions

 LogFile ()
 

Private Attributes

FEI_OSTREAMoutput_stream_
 
unsigned counter_
 

Detailed Description

Singleton class to manage (open, close, etc.) the one-and-only fei log file.

Definition at line 19 of file fei_LogFile.hpp.

Constructor & Destructor Documentation

fei::LogFile::~LogFile ( )
virtual

destructor

Definition at line 21 of file fei_LogFile.cpp.

fei::LogFile::LogFile ( )
private

constructor

Definition at line 15 of file fei_LogFile.cpp.

Member Function Documentation

void fei::LogFile::openOutputStream ( const char *  path = NULL,
int  nprocs = 1,
int  localproc = 0 
)

Open a log-file ostream. If one is already open, it is closed before the new one is opened.

The file name is 'fei_log.counter.nprocs.localproc', where counter is the number of times this function has been called, and nprocs and localproc are specified in the arguments.

Parameters
pathPath, not including file-name, to log-file.
nprocsNumber of processors.
localprocRank of local processor.

Definition at line 27 of file fei_LogFile.cpp.

References fei::console_out(), FEI_ENDL, FEI_OFSTREAM, FEI_OSTRINGSTREAM, filename, and IOS_OUT.

Referenced by fei::LogManager::setOutputLevel().

FEI_OSTREAM * fei::LogFile::getOutputStream ( )

Query for the log-file ostream.

Definition at line 57 of file fei_LogFile.cpp.

Referenced by fei::Logger::Logger(), and fei::Logger::setOutputLevel().

void fei::LogFile::closeOutputStream ( )

Destroy the log-file ostream (closes the file).

Definition at line 62 of file fei_LogFile.cpp.

Referenced by fei::Factory::~Factory().

fei::LogFile & fei::LogFile::getLogFile ( )
static

Accessor for the one-and-only instance of LogFile. Constructs a LogFile instance on the first call, returns that same instance on the first and all subsequent calls.

Definition at line 68 of file fei_LogFile.cpp.

Referenced by fei::Logger::Logger(), fei::Logger::setOutputLevel(), fei::LogManager::setOutputLevel(), and fei::Factory::~Factory().

Member Data Documentation

FEI_OSTREAM* fei::LogFile::output_stream_
private

Definition at line 56 of file fei_LogFile.hpp.

unsigned fei::LogFile::counter_
private

Definition at line 57 of file fei_LogFile.hpp.


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