Definition at line 61 of file filelog.h.
OSB_APP::FileLogBase::FileLogBase | ( | int | logLevel | ) | [explicit] |
Constructor with log level.
virtual OSB_APP::FileLogBase::~FileLogBase | ( | ) | [pure virtual] |
Destructor: flushes the temp. buffer and closes the file output stream.
The destructor frist flushes the temporary output buffer and closes the file output stream.
If the temp. buffer is not empty afterwards, its content is written to std::cerr.
OSB_APP::FileLogBase::FileLogBase | ( | const FileLogBase & | ) | [private] |
Prevent copying: not implemented.
bool OSB_APP::FileLogBase::append | ( | const std::string & | name, | |
const std::string & | dir, | |||
bool | flush = true | |||
) |
void OSB_APP::FileLogBase::clearTemp | ( | ) |
Discard the content of the temporary buffer.
void OSB_APP::FileLogBase::clearTempUl | ( | ) | [private] |
Discard the content of the temporary buffer.
bool OSB_APP::FileLogBase::close | ( | ) |
Close the file output stream.
Locks, calls closeUl() and unlocks.
bool OSB_APP::FileLogBase::closeUl | ( | ) | [private] |
Close the file output stream.
First flushes the temp. buffer and then closes the os_ if open.
bool OSB_APP::FileLogBase::create | ( | const std::string & | app, | |
const std::string & | dir, | |||
bool | flush = true | |||
) |
Create the output file, overwrite an existing file.
app | Name of the application. | |
dir | Directory of the log file. | |
flush | Flag to call flush the temporary buffer. |
bool OSB_APP::FileLogBase::createUl | ( | const std::string & | app, | |
const std::string & | dir, | |||
bool | flush | |||
) | [private] |
void OSB_APP::FileLogBase::elog | ( | ) | [virtual] |
End a log message with a new-line.
Writes std::endl to it-self and unlocks.
Implements OSB_LIB::LogBase.
void OSB_APP::FileLogBase::endlog | ( | ) | [virtual] |
bool OSB_APP::FileLogBase::flushTemp | ( | ) |
Write the content ts_ to file output stream.
bool OSB_APP::FileLogBase::flushTempUl | ( | ) | [private] |
Write the content ts_ to file output stream.
See flushTemp() for the description of return value.
If os_ is not open, the function returns immediately false without an effect.
LogBase& OSB_APP::FileLogBase::head | ( | char | ) | [virtual] |
LogBase& OSB_APP::FileLogBase::init | ( | const char * | what | ) | [private] |
Initialize a log message.
what | Header of the message. |
virtual void OSB_APP::FileLogBase::lock | ( | ) | const [private, virtual] |
Lock the logging interface.
Derived classes that support multi-threaded applications must provide their own implementation of the function.
This default implementation does nothing.
Reimplemented in OSB_APP::FileLockLog.
int OSB_APP::FileLogBase::logLevel | ( | ) | const [virtual] |
LogBase& OSB_APP::FileLogBase::nl | ( | ) | [virtual] |
bool OSB_APP::FileLogBase::open | ( | const std::string & | name, | |
const std::string & | dir, | |||
std::ios::openmode | mode, | |||
bool | flush = true | |||
) |
bool OSB_APP::FileLogBase::openUl | ( | const std::string & | name, | |
const std::string & | dir, | |||
std::ios::openmode | mode, | |||
bool | flush | |||
) | [private] |
Open the output file.
See open() for the description of arguments and return value.
If the main output stream is already open, the function returns immediately without effect.
FileLogBase& OSB_APP::FileLogBase::operator== | ( | const FileLogBase & | ) | [private] |
Prevent assignment: not implemented.
std::string OSB_APP::FileLogBase::path | ( | ) | const |
Get path and name of log file.
std::ostream& OSB_APP::FileLogBase::plog | ( | ) | [private, virtual] |
void OSB_APP::FileLogBase::setLevel | ( | int | logLevel | ) | [virtual] |
Set the log level.
logLevel | New log level to be used. |
Reimplemented from OSB_LIB::LogBase.
void OSB_APP::FileLogBase::setVerbose | ( | bool | on | ) | [virtual] |
std::ostream* OSB_APP::FileLogBase::slog | ( | ) | [private, virtual] |
Secondary log stream.
Implements OSB_LIB::LogBase.
LogBase& OSB_APP::FileLogBase::start | ( | int | level, | |
bool | noHead | |||
) | [private, virtual] |
Start logging a message.
level | Log level of the message. | |
noHead | Flag to suppress message header and indentation. |
Implements OSB_LIB::LogBase.
std::string OSB_APP::FileLogBase::tempBuf | ( | ) | const |
Get content of temporary buffer.
std::string OSB_APP::FileLogBase::tempBufUl | ( | ) | const [private] |
Get content of temporary buffer.
virtual void OSB_APP::FileLogBase::unlock | ( | ) | const [private, virtual] |
Unlock the logging interface.
Derived classes that support multi-threaded applications must provide their own implementation of the function.
This default implementation does nothing.
Reimplemented in OSB_APP::FileLockLog.
bool OSB_APP::FileLogBase::verbose | ( | ) | const [virtual] |
std::ofstream OSB_APP::FileLogBase::os_ [private] |
std::string OSB_APP::FileLogBase::path_ [private] |
std::ostringstream OSB_APP::FileLogBase::ts_ [private] |
bool OSB_APP::FileLogBase::useCerr_ [private] |