megoldas a loggerre, egyeb javitasok
[gp-arc-client-c.git] / src / submit.cpp
index 981a164..bd25b14 100644 (file)
@@ -8,9 +8,8 @@
  */
 
 #include "submit.h"
-#include "common_utils.h"
 #include "logger.h"
-#include "config.h"
+#include "config.h" //TBD: Kell ez?
 // -*- indent-tabs-mode: nil -*-
 
 #ifdef HAVE_CONFIG_H
 #include <unistd.h>
 
 #include "arc_libs.h"
-#pragma GCC visibility push(default)
-extern "C" {
+
+
 submit_result_t* submit(int argc, char **argv) {
        
        
        
-       setlocale(LC_ALL, "");//TBD: do we need this?
-       logger = new Arc::Logger(Arc::Logger::getRootLogger(), "arcclientc");
-       //TBD:
-       
-       
-       
-       Arc::LogStream logcerr(std::cerr);
-       logcerr.setFormat(Arc::ShortFormat);
-       Arc::Logger::getRootLogger().addDestination(logcerr);
-       Arc::Logger::getRootLogger().setThreshold(Arc::DEBUG);
-       
-       
-       
-       /* Arc::LogStream logcerr = Arc::LogStream(std::cerr);//TBD on the stack?
-       logcerr.setFormat(Arc::ShortFormat);
-       Arc::Logger::getRootLogger().addDestination(logcerr);
-
-       Arc::Logger::getRootLogger().setThreshold(Arc::DEBUG);//TODO: read threshold from env */
-       
-       Arc::ArcLocation::Init("/opt/local");//set ARC_LOCATION !!!!!!
-       
        
        
        
@@ -190,7 +168,7 @@ submit_result_t* submit(int argc, char **argv) {
                result->message = ostringstream2cstring(sstream);
                return result;
        }
-       logger->msg(Arc::INFO, "Broker %s loaded", usercfg.Broker().first);
+       logger.msg(Arc::INFO, "Broker %s loaded", usercfg.Broker().first);
        
                
        ChosenBroker->PreFilterTargets(targen.ModifyFoundTargets(), jobdesc);
@@ -212,18 +190,18 @@ submit_result_t* submit(int argc, char **argv) {
                //submit the job
                Arc::URL jobid = submitter->Submit(jobdesc, *target);
                if (!jobid) {
-                       logger->msg(Arc::INFO, "Submission to %s failed, trying next target", target->url.str());
+                       logger.msg(Arc::INFO, "Submission to %s failed, trying next target", target->url.str());
                        continue;
                }
                
                ChosenBroker->RegisterJobsubmission();
                result->job_id = new_str(jobid.str().c_str());
-               logger->msg(Arc::DEBUG, "Job submitted with jobid: %s", jobid.str());
+               logger.msg(Arc::DEBUG, "Job submitted with jobid: %s", jobid.str());
                
                break;
        } //end loop over all possible targets
        
        return result;
 }
-}
+