FACT++  1.0
int main ( int  argc,
const char *  argv[] 
)

Definition at line 168 of file showlog.cc.

References Configuration::DoParse(), Configuration::Get(), Configuration::Has(), Time::iso, Time::none, PrintHelp(), PrintUsage(), Configuration::SetPrintUsage(), SetupConfiguration(), showlog(), and Configuration::Vec().

169 {
170  Configuration conf(argv[0]);
171  conf.SetPrintUsage(PrintUsage);
172  SetupConfiguration(conf);
173 
174  if (!conf.DoParse(argc, argv, PrintHelp))
175  return 127;
176 
177  const vector<string> files = conf.Vec<string>("file");
178 
179  Time tbeg(Time::none);
180  Time tend(Time::none);
181 
182  if (conf.Has("begin"))
183  {
184  std::stringstream stream;
185  stream << "1970-01-01 " << conf.Get<string>("begin");
186  stream >> Time::iso >> tbeg;
187  }
188 
189  if (conf.Has("end"))
190  {
191  std::stringstream stream;
192  stream << "1970-01-01 " << conf.Get<string>("end");
193  stream >> Time::iso >> tend;
194  }
195 
196  if (files.size()==0)
197  showlog("", tbeg, tend, conf.Get<int16_t>("verbose"), conf.Get<bool>("color"), conf.Get<bool>("strip"));
198 
199  for (auto it=files.begin(); it!=files.end(); it++)
200  showlog(*it, tbeg, tend, conf.Get<int16_t>("verbose"), conf.Get<bool>("color"), conf.Get<bool>("strip"));
201 
202  return 0;
203 }
Adds some functionality to boost::posix_time::ptime for our needs.
Definition: Time.h:30
static const _time_format iso
set to format to the sql format (without the fraction of seconds)
Definition: Time.h:44
void showlog(string fname, const Time &tbeg, const Time &tend, int16_t severity, bool color, bool strip)
Definition: showlog.cc:68
void SetupConfiguration(Configuration &conf)
Definition: showlog.cc:13
void PrintUsage()
Definition: showlog.cc:32
Commandline parsing, resource file parsing and database access.
Definition: Configuration.h:9
Do not initialize the time.
Definition: Time.h:51
void PrintHelp()
Definition: showlog.cc:54

+ Here is the call graph for this function: