55 |
DIR *dirp; |
DIR *dirp; |
56 |
//std::string pathDir((char*)getenv("YODA_LOGS")); |
//std::string pathDir((char*)getenv("YODA_LOGS")); |
57 |
std::string pathDir((char*)getenv("YODA_DATA")); |
std::string pathDir((char*)getenv("YODA_DATA")); |
58 |
pathDir = pathDir + "/"; |
|
59 |
pathDir = pathDir + nomeFileLog; |
std::string pathLog = pathDir + "/" + nomeFileLog; |
60 |
appender = new log4cpp::FileAppender("default", pathDir.c_str(), false); |
appender = new log4cpp::FileAppender("default", pathLog.c_str(), false); |
61 |
log4cpp::PatternLayout * pl = new log4cpp::PatternLayout(); |
log4cpp::PatternLayout * pl = new log4cpp::PatternLayout(); |
62 |
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"); |
63 |
appender->setLayout(pl); |
appender->setLayout(pl); |
90 |
<< "\n " << log4cpp::CategoryStream::ENDLINE; |
<< "\n " << log4cpp::CategoryStream::ENDLINE; |
91 |
log4cpp::Category::shutdown(); |
log4cpp::Category::shutdown(); |
92 |
std::string command; |
std::string command; |
93 |
command = "mv " + nomeFileLog + " " + Run.GetRun() + "/."; |
command = "mv " + pathLog + " " + pathDir + "/" + Run.GetRun() + "/."; |
94 |
cat.info(command); |
cat.info(command); |
95 |
system(command.c_str()); |
system(command.c_str()); |
96 |
} |
} |