BSolver: Add SetDebugLevel()

In LibsolvSolver set the debug level of the pool.
This commit is contained in:
Ingo Weinhold
2014-10-26 00:19:35 +02:00
parent 5f52e82c00
commit 74b582a4e5
3 changed files with 19 additions and 1 deletions
+2
View File
@@ -46,6 +46,8 @@ public:
virtual status_t Init() = 0;
virtual void SetDebugLevel(int32 level) = 0;
virtual status_t AddRepository(
BSolverRepository* repository) = 0;
+14 -1
View File
@@ -182,7 +182,8 @@ LibsolvSolver::LibsolvSolver()
fInstalledRepository(NULL),
fSolvablePackages(),
fPackageSolvables(),
fProblems(10, true)
fProblems(10, true),
fDebugLevel(0)
{
}
@@ -203,6 +204,16 @@ LibsolvSolver::Init()
}
void
LibsolvSolver::SetDebugLevel(int32 level)
{
fDebugLevel = level;
if (fPool != NULL)
pool_setdebuglevel(fPool, fDebugLevel);
}
status_t
LibsolvSolver::AddRepository(BSolverRepository* repository)
{
@@ -585,6 +596,8 @@ LibsolvSolver::_InitPool()
fPool = pool_create();
pool_setdebuglevel(fPool, fDebugLevel);
// Set the system architecture. We use what uname() returns unless we're on
// x86 gcc2.
{
+3
View File
@@ -32,6 +32,8 @@ public:
virtual status_t Init();
virtual void SetDebugLevel(int32 level);
virtual status_t AddRepository(BSolverRepository* repository);
virtual status_t FindPackages(const char* searchString,
@@ -133,6 +135,7 @@ private:
SolvableMap fSolvablePackages;
PackageMap fPackageSolvables;
ProblemList fProblems;
int32 fDebugLevel;
};