20 |
} |
} |
21 |
|
|
22 |
|
|
23 |
|
|
24 |
using namespace pamela; |
using namespace pamela; |
25 |
using namespace log4cxx; |
using namespace log4cxx; |
26 |
using namespace std; |
using namespace std; |
37 |
DIR *dirp; |
DIR *dirp; |
38 |
string pathDir((char*)getenv("YODA_DATA")); |
string pathDir((char*)getenv("YODA_DATA")); |
39 |
string pathLog = nomeFileLog; |
string pathLog = nomeFileLog; |
40 |
|
bool ANALIZE = false; |
41 |
//---------------- Log4cxx configuration----------------------------------------------- |
//---------------- Log4cxx configuration----------------------------------------------- |
42 |
//Define the configuration file to be used on log4cxx |
//Define the configuration file to be used on log4cxx |
43 |
PropertyConfigurator::configure(pathDir + "/log4cxx.conf"); |
PropertyConfigurator::configure(pathDir + "/log4cxx.conf"); |
72 |
cout << "Usage: yoda FILE [OPTION] \n"; |
cout << "Usage: yoda FILE [OPTION] \n"; |
73 |
cout << "\t --help print this help and exit \n"; |
cout << "\t --help print this help and exit \n"; |
74 |
cout << "\t -p maximum number of packets to process [default all] \n"; |
cout << "\t -p maximum number of packets to process [default all] \n"; |
75 |
|
cout << "\t -analize generate pre-defined analisys files (gif/text) inside the unpacking directory\n"; |
76 |
exit(1); |
exit(1); |
77 |
} |
} |
78 |
|
|
104 |
cout << "Try '--help' for more information. \n"; |
cout << "Try '--help' for more information. \n"; |
105 |
exit(1); |
exit(1); |
106 |
} |
} |
107 |
|
|
108 |
|
if (!strcmp(argv[i], "-analize")) ANALIZE = true; |
109 |
|
|
110 |
} |
} |
111 |
|
|
112 |
|
|
123 |
time ( &rawtime ); |
time ( &rawtime ); |
124 |
timeinfo = localtime ( &rawtime ); |
timeinfo = localtime ( &rawtime ); |
125 |
|
|
126 |
oss.flush(); |
oss.str(""); |
127 |
oss << "<-------------------------------START UNPACKING------------------------------->\n" |
oss << "<-------------------------------START UNPACKING------------------------------->\n" |
128 |
<< " Starting the program at: " << asctime (timeinfo) << " Opening file: " << argv[1]; |
<< " Starting the program at: " << asctime (timeinfo) << " Opening file: " << argv[1]; |
129 |
logger->info(oss.str().c_str()); |
logger->info(oss.str().c_str()); |
136 |
TechmodelPamelaRun Run(argv[1]); |
TechmodelPamelaRun Run(argv[1]); |
137 |
reader->Init(&Run); |
reader->Init(&Run); |
138 |
|
|
139 |
oss.flush(); |
oss.str(""); |
140 |
oss << "Init successul ok" << asctime (timeinfo); |
oss << "Init successul ok" << asctime (timeinfo); |
141 |
logger->debug(oss.str().c_str()); |
logger->debug(oss.str().c_str()); |
142 |
|
|
146 |
|
|
147 |
logger->info("<-------------------------------END UNPACKING------------------------------->\n"); |
logger->info("<-------------------------------END UNPACKING------------------------------->\n"); |
148 |
|
|
|
std::string command; |
|
|
command = "mv " + pathLog + " " + pathDir + "/" + Run.GetRun() + "/YodaLog.txt"; |
|
149 |
//Momentarly suspended the save |
//Momentarly suspended the save |
150 |
//system(command.c_str()); |
//system(command.c_str()); |
151 |
} |
} |