my own code review I

This commit is contained in:
Kjell Hedstrom 2015-08-19 10:19:55 -06:00
parent 1803498e89
commit 3efcef3505
2 changed files with 2 additions and 3 deletions

View File

@ -250,6 +250,7 @@ int main(int argc, char **argv)
auto worker = g3::LogWorker::createLogWorker();
auto handle= worker->addDefaultLogger(argv[0], path_to_log_file);
g3::initializeLogging(worker.get());
g3::setFatalPreLoggingHook(&breakHere);
std::future<std::string> log_file_name = handle->call(&g3::FileSink::fileName);
std::cout << "**** G3LOG FATAL EXAMPLE ***\n\n"
<< "Choose your type of fatal exit, then "

View File

@ -70,8 +70,6 @@ namespace g3 {
/**
A convenience function to add the default g3::FileSink to the log worker
@param the worker (no, don't put in nullptr here!)
@param log_prefix that you want
@param log_directory where the log is to be stored.
@return a handle for API access to the sink. See the README for example usage
@ -85,7 +83,7 @@ namespace g3 {
std::future<std::string> log_file_name = sinkHandle->call(&FileSink::fileName);
std::cout << "The filename is: " << log_file_name.get() << std::endl;
// something like: /tmp/
// something like: /tmp/my_test_log.g3log.20150819-100300.log
*/
std::unique_ptr<FileSinkHandle> addDefaultLogger(const std::string& log_prefix, const std::string& log_directory);