#include <CommitLog.h>
Public Member Functions | |
| CommitLog () | |
| ~CommitLog () | |
| std::ostream & | operator() (bool timestamp=false) |
Static Public Member Functions | |
| static void | setFname (const Pathname &fname_r) |
Private Member Functions | |
| CommitLog (const CommitLog &) | |
| CommitLog & | operator= (const CommitLog &) |
Static Private Member Functions | |
| static void | openLog () |
| static void | closeLog () |
| static void | refUp () |
| static void | refDown () |
Static Private Attributes | |
| static std::ofstream | _log |
| static unsigned | _refcnt = 0 |
| static Pathname | _fname |
Refcnt, filename and corresponding ofstream are static members. Logfile constructor raises, destructor lowers refcounter. On refcounter changing from 0->1, file is opened. Changing from 1->0 the file is closed. Thus Logfile objects should be local to those functions, writing the log, and must not be stored permanently;
Usage: some methothd () { CommitLog progresslog; ... progresslog() << "some message" << endl; ... }
Definition at line 42 of file CommitLog.h.
| zypp::target::CommitLog::CommitLog | ( | const CommitLog & | ) | [private] |
| zypp::target::CommitLog::CommitLog | ( | ) | [inline] |
| zypp::target::CommitLog::~CommitLog | ( | ) | [inline] |
| void zypp::target::CommitLog::openLog | ( | ) | [static, private] |
Definition at line 33 of file CommitLog.cc.
References _fname, _log, and ERR.
Referenced by refUp(), and setFname().
| void zypp::target::CommitLog::closeLog | ( | ) | [static, private] |
Definition at line 41 of file CommitLog.cc.
References _log.
Referenced by refDown(), and setFname().
| void zypp::target::CommitLog::refUp | ( | ) | [static, private] |
Definition at line 45 of file CommitLog.cc.
References _refcnt, and openLog().
Referenced by CommitLog().
| void zypp::target::CommitLog::refDown | ( | ) | [static, private] |
Definition at line 50 of file CommitLog.cc.
References _refcnt, and closeLog().
Referenced by ~CommitLog().
| std::ostream & zypp::target::CommitLog::operator() | ( | bool | timestamp = false |
) |
| void zypp::target::CommitLog::setFname | ( | const Pathname & | fname_r | ) | [static] |
Definition at line 63 of file CommitLog.cc.
References _fname, _refcnt, closeLog(), MIL, and openLog().
Referenced by zypp::target::TargetImpl::setInstallationLogfile().
std::ofstream zypp::target::CommitLog::_log [static, private] |
unsigned zypp::target::CommitLog::_refcnt = 0 [static, private] |
Pathname zypp::target::CommitLog::_fname [static, private] |
1.5.3