|
libzypp
9.1.2
|
Simple wrapper for progress log. More...
#include <HistoryLog.h>
Public Member Functions | |
| HistoryLog (const Pathname &rootdir=Pathname()) | |
| Constructor with an optional root directory. | |
| ~HistoryLog () | |
| void | comment (const std::string &comment, bool timestamp=false) |
| Log a comment (even multiline). | |
| void | install (const PoolItem &pi) |
| Log installation (or update) of a package. | |
| void | remove (const PoolItem &pi) |
| Log removal of a package. | |
| void | addRepository (const RepoInfo &repo) |
| Log a newly added repository. | |
| void | removeRepository (const RepoInfo &repo) |
| Log recently removed repository. | |
| void | modifyRepository (const RepoInfo &oldrepo, const RepoInfo &newrepo) |
| Log certain modifications to a repository. | |
Static Public Member Functions | |
| static void | setRoot (const Pathname &root) |
| Set new root directory to the default history log file path. | |
| static const Pathname & | fname () |
| Get the current log file path. | |
Private Member Functions | |
| HistoryLog (const HistoryLog &) | |
| HistoryLog & | operator= (const HistoryLog &) |
Simple wrapper for progress log.
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 method () { PoolItem pi; ... HistoryLog().install(pi); ... HistoryLog().comment(someMessage); }
Definition at line 59 of file HistoryLog.h.
| zypp::HistoryLog::HistoryLog | ( | const HistoryLog & | ) | [private] |
| zypp::HistoryLog::HistoryLog | ( | const Pathname & | rootdir = Pathname() | ) |
Constructor with an optional root directory.
| rootdir | actual target root directory |
Definition at line 116 of file HistoryLog.cc.
References setRoot().
Definition at line 122 of file HistoryLog.cc.
| HistoryLog& zypp::HistoryLog::operator= | ( | const HistoryLog & | ) | [private] |
| void zypp::HistoryLog::setRoot | ( | const Pathname & | root | ) | [static] |
Set new root directory to the default history log file path.
This path will be prepended to the default log file path. This should be done where there is a potential that the target root has changed.
| root | new root directory. |
Definition at line 127 of file HistoryLog.cc.
References zypp::filesystem::assert_dir(), zypp::ZConfig::historyLogFile(), zypp::ZConfig::instance(), and MIL.
Referenced by HistoryLog(), and zypp::target::TargetImpl::TargetImpl().
| const Pathname & zypp::HistoryLog::fname | ( | ) | [static] |
Get the current log file path.
Definition at line 143 of file HistoryLog.cc.
References zypp::ZConfig::historyLogFile(), and zypp::ZConfig::instance().
Referenced by zypp::target::TargetImpl::commit().
| void zypp::HistoryLog::comment | ( | const std::string & | comment, |
| bool | timestamp = false |
||
| ) |
Log a comment (even multiline).
| comment | the comment |
| timestamp | whether to include a timestamp at the start of the comment |
Definition at line 152 of file HistoryLog.cc.
Referenced by zypp::target::rpm::RpmDb::doInstallPackage(), and zypp::target::rpm::RpmDb::doRemovePackage().
| void zypp::HistoryLog::install | ( | const PoolItem & | pi | ) |
Log installation (or update) of a package.
Definition at line 184 of file HistoryLog.cc.
References zypp::HistoryActionID::asString(), zypp::HistoryActionID::INSTALL, zypp::ResStatus::isByApplHigh(), zypp::ResStatus::isByApplLow(), zypp::ResStatus::isByUser(), zypp::PoolItem::resolvable(), and zypp::PoolItem::status().
Referenced by zypp::target::TargetImpl::commit().
| void zypp::HistoryLog::remove | ( | const PoolItem & | pi | ) |
Log removal of a package.
Definition at line 215 of file HistoryLog.cc.
References zypp::HistoryActionID::asString(), zypp::ResStatus::isByApplHigh(), zypp::ResStatus::isByApplLow(), zypp::ResStatus::isByUser(), zypp::HistoryActionID::REMOVE, zypp::PoolItem::resolvable(), and zypp::PoolItem::status().
Referenced by zypp::target::TargetImpl::commit().
| void zypp::HistoryLog::addRepository | ( | const RepoInfo & | repo | ) |
Log a newly added repository.
| repo | info about the added repository |
Definition at line 246 of file HistoryLog.cc.
References zypp::repo::RepoInfoBase::alias(), zypp::HistoryActionID::asString(), zypp::RepoInfo::baseUrlsBegin(), zypp::str::escape(), and zypp::HistoryActionID::REPO_ADD.
Referenced by zypp::RepoManager::addRepositories(), and zypp::RepoManager::addRepository().
| void zypp::HistoryLog::removeRepository | ( | const RepoInfo & | repo | ) |
Log recently removed repository.
| repo | info about the removed repository |
Definition at line 258 of file HistoryLog.cc.
References zypp::repo::RepoInfoBase::alias(), zypp::HistoryActionID::asString(), zypp::str::escape(), and zypp::HistoryActionID::REPO_REMOVE.
Referenced by zypp::RepoManager::removeRepository().
| void zypp::HistoryLog::modifyRepository | ( | const RepoInfo & | oldrepo, |
| const RepoInfo & | newrepo | ||
| ) |
Log certain modifications to a repository.
| oldrepo | info about the old repository |
| newrepo | info about the new repository |
Definition at line 268 of file HistoryLog.cc.
References zypp::repo::RepoInfoBase::alias(), zypp::HistoryActionID::asString(), zypp::RepoInfo::baseUrlsBegin(), zypp::str::escape(), zypp::HistoryActionID::REPO_CHANGE_ALIAS, and zypp::HistoryActionID::REPO_CHANGE_URL.
Referenced by zypp::RepoManager::modifyRepository().
1.7.6.1