fix log file fandling in testcase
authorMichael Andres <ma@suse.de>
Thu, 14 Aug 2008 10:54:02 +0000 (10:54 +0000)
committerMichael Andres <ma@suse.de>
Thu, 14 Aug 2008 10:54:02 +0000 (10:54 +0000)
zypp/base/LogControl.h
zypp/solver/detail/Testcase.cc

index 01350a2..6f2eb12 100644 (file)
@@ -70,7 +70,7 @@ namespace zypp
                                     const std::string & /*message_r*/ );
         virtual ~LineFormater() {}
       };
-            
+
     public:
       /** Assign a LineFormater.
        * If you want to format loglines by yourself. NULL installs the
@@ -78,6 +78,7 @@ namespace zypp
       */
       void setLineFormater( const shared_ptr<LineFormater> & formater_r );
 
+    public:
       /** Set path for the logfile.
        * Permission for logfiles is set to 0640 unless an explicit mode_t
        * value is given. An empty pathname turns off logging. <tt>"-"</tt>
index 9606442..b4090ad 100644 (file)
@@ -288,13 +288,12 @@ bool Testcase::createTestcase(Resolver & resolver, bool dumpPool, bool runSolver
     }
 
     if (runSolver) {
+        zypp::base::LogControl::TmpLineWriter tempRedirect;
        zypp::base::LogControl::instance().logfile( dumpPath +"/y2log" );
        zypp::base::LogControl::TmpExcessive excessive;
 
        resolver.reset(true); // true = resetting all valid solverresults
        resolver.resolvePool();
-
-       zypp::base::LogControl::instance().logfile( "/var/log/YaST2/y2log" );
     }
 
     ResPool pool       = resolver.pool();