ez most fut, de a logger meg bena
[gp-arc-client-c.git] / src / submit.cpp
index d7337bb..981a164 100644 (file)
 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 !!!!!!
+       
+       
+       
+       
+       
+       
        submit_result_t* result = (submit_result_t*)malloc(sizeof(submit_result_t));
        if (!result) {
                return NULL;//TBD: throw sth?
        }
        result->message = NULL;
        result->job_id = NULL;
+       
+       
 
        //TODO: what necessary here?
        Arc::OptionParser options(istring("[filename ...]"),
@@ -99,15 +129,13 @@ submit_result_t* submit(int argc, char **argv) {
        
        std::list<std::string> params = options.Parse(argc, argv);
        
-       std::cout << "conffile:";
-       std::cout << conffile.size();//TODO: clean
+       
        Arc::UserConfig usercfg(conffile);
        if (!usercfg) {
                result->message = new_str("Failed configuration initialization");
-               return result;
+               return result;  
        }
        
-       
        if (timeout > 0)
                usercfg.Timeout(timeout);