/[PAMELA software]/yoda/techmodel/techmodelreader.cpp
ViewVC logotype

Diff of /yoda/techmodel/techmodelreader.cpp

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 1.1.1.1 by kusanagi, Tue Jul 6 12:20:23 2004 UTC revision 1.3 by kusanagi, Thu Aug 19 15:24:46 2004 UTC
# Line 49  int main(int argc, char* argv[]) { Line 49  int main(int argc, char* argv[]) {
49  // YodaLog.txt  ------------>the LogFile name  // YodaLog.txt  ------------>the LogFile name
50  // 1000              ------------>The max size (in Kb) of the LogFile  // 1000              ------------>The max size (in Kb) of the LogFile
51  // 5                     ------------>How many times the file will be backup  // 5                     ------------>How many times the file will be backup
52     std::string nomeFileLog = "YodaLog.txt";     char nomeFileLog[L_tmpnam];
53       tmpnam(nomeFileLog);
54       //std::string nomeFileLog = "YodaLog.txt";
55     log4cpp::Appender* appender;     log4cpp::Appender* appender;
56     log4cpp::Category& cat = log4cpp::Category::getRoot();     log4cpp::Category& cat = log4cpp::Category::getRoot();
57     DIR *dirp;     DIR *dirp;
    //std::string pathDir((char*)getenv("YODA_LOGS"));  
58     std::string pathDir((char*)getenv("YODA_DATA"));     std::string pathDir((char*)getenv("YODA_DATA"));
59     pathDir = pathDir + "/";        
60     pathDir = pathDir + nomeFileLog;     //std::string pathLog = pathDir + "/" + nomeFileLog;
61     appender = new log4cpp::FileAppender("default", pathDir.c_str(), false);     std::string pathLog = nomeFileLog;
62       appender = new log4cpp::FileAppender("default", pathLog.c_str(), false);
63     log4cpp::PatternLayout * pl = new log4cpp::PatternLayout();     log4cpp::PatternLayout * pl = new log4cpp::PatternLayout();
64     pl->setConversionPattern("%d{%Y/%m/%d %H:%M:%S.%l} %p %c - %m");     pl->setConversionPattern("%d{%Y/%m/%d %H:%M:%S.%l} %p %c - %m");
65     appender->setLayout(pl);     appender->setLayout(pl);
66     cat.setAppender(appender);     cat.setAppender(appender);
67     cat.setPriority(log4cpp::Priority::DEBUG);     //cat.setPriority(log4cpp::Priority::DEBUG);
68        cat.setPriority(log4cpp::Priority::INFO);
69      time_t rawtime;      time_t rawtime;
70      struct tm * timeinfo;      struct tm * timeinfo;
71    
# Line 90  int main(int argc, char* argv[]) { Line 93  int main(int argc, char* argv[]) {
93          << "\n " << log4cpp::CategoryStream::ENDLINE;          << "\n " << log4cpp::CategoryStream::ENDLINE;
94      log4cpp::Category::shutdown();      log4cpp::Category::shutdown();
95    std::string command;    std::string command;
96    command = "mv " + nomeFileLog + "  " + Run.GetRun() + "/.";    //command = "mv " + pathLog + "  " + pathDir + "/" + Run.GetRun() + "/YodaLog.txt";
97      command = "mv " + pathLog + "  " + pathDir + "/" + Run.GetRun() + "/YodaLog.txt";
98    cat.info(command);    cat.info(command);
99    system(command.c_str());    system(command.c_str());
100  }  }

Legend:
Removed from v.1.1.1.1  
changed lines
  Added in v.1.3

  ViewVC Help
Powered by ViewVC 1.1.23