Main Page | Compound List | File List | Compound Members | File Members

main.C

Go to the documentation of this file.
00001 
00027 #include "SpamException.h"
00028 #include "SpamParameters.h"
00029 #include "Logger.h"
00030 #include "MailFilter.h"
00031 
00034 main()
00035 {
00036   Logger log = pLogger->getLogger("main");
00037   // This message will only appear if in the log file if
00038   // debug is turned on in the Logger constructor.  Otherwise it
00039   // is turned on by a parameter file flag.
00040   log.log(Logger::DEBUG, "main", "start mail_filter");
00041   try {
00042     const char *PARAMFILE_NAME = "SpamFilterParams";
00043     // read the parameter file
00044     SpamParameters spamParam(PARAMFILE_NAME);
00045 
00046     if (spamParam.hasFlag("debug")) {
00047       // turn debugging on in the logger
00048       log.setDebug();
00049     }
00050     // filter the email from stdin
00051     MailFilter filter( spamParam );
00052   }
00053   catch (SpamException e) {
00054     log.log( Logger::ERROR, "main", e.what() );
00055   }
00056   log.log(Logger::DEBUG, "main", "end mail_filter");
00057   return 0;
00058 }

Generated on Sat Mar 27 13:07:38 2004 for Mail Filter by doxygen 1.3.3