Example #1
0
void GlobalInit(int* pargc, char*** pargv) {
  // Google flags.
  ::gflags::ParseCommandLineFlags(pargc, pargv, true);
  // Provide a backtrace on segfault.
  //::google::InstallFailureSignalHandler();
  // Google logging.
  initGlog();
  ::google::InitGoogleLogging(*(pargv)[0]);
}
Example #2
0
void GlobalInit(int* pargc, char*** pargv) {
  // Google flags.
  ::gflags::ParseCommandLineFlags(pargc, pargv, true);
  // Google logging.

  initGlog();// add by azhangfeng

  ::google::InitGoogleLogging(*(pargv)[0]);
  // Provide a backtrace on segfault.

  // Windows port of glogs doesn't have this function built
#if !defined(_MSC_VER)
  ::google::InstallFailureSignalHandler();
#endif
}
Example #3
0
//construct
indexEngine::indexEngine(const std::string& dir,const std::string& dict_pth)
    :dir_(dir),dict_pth_(dict_pth),isNeedflush(false)
{
    std::string cProgram = "RECOMMENDATION";
    std::string logDir = "../log";
    initGlog(cProgram.c_str(),logDir.c_str());

    if(!boost::filesystem::exists(dir_))
    {
        LOG(FATAL) << "Tokenize dictionary path not exits!";
        //std::cerr << "Tokenize dictionary path not exits!" << std::endl;
    }

    //tokenizer
    tok_ = new ilplib::knlp::HorseTokenize(dir_);
}