mirror of
https://github.com/KjellKod/g3log.git
synced 2025-03-04 07:27:25 +01:00
my own code review I
This commit is contained in:
parent
1803498e89
commit
3efcef3505
@ -250,6 +250,7 @@ int main(int argc, char **argv)
|
|||||||
auto worker = g3::LogWorker::createLogWorker();
|
auto worker = g3::LogWorker::createLogWorker();
|
||||||
auto handle= worker->addDefaultLogger(argv[0], path_to_log_file);
|
auto handle= worker->addDefaultLogger(argv[0], path_to_log_file);
|
||||||
g3::initializeLogging(worker.get());
|
g3::initializeLogging(worker.get());
|
||||||
|
g3::setFatalPreLoggingHook(&breakHere);
|
||||||
std::future<std::string> log_file_name = handle->call(&g3::FileSink::fileName);
|
std::future<std::string> log_file_name = handle->call(&g3::FileSink::fileName);
|
||||||
std::cout << "**** G3LOG FATAL EXAMPLE ***\n\n"
|
std::cout << "**** G3LOG FATAL EXAMPLE ***\n\n"
|
||||||
<< "Choose your type of fatal exit, then "
|
<< "Choose your type of fatal exit, then "
|
||||||
|
@ -70,8 +70,6 @@ namespace g3 {
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
A convenience function to add the default g3::FileSink to the log worker
|
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_prefix that you want
|
||||||
@param log_directory where the log is to be stored.
|
@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
|
@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::future<std::string> log_file_name = sinkHandle->call(&FileSink::fileName);
|
||||||
std::cout << "The filename is: " << log_file_name.get() << std::endl;
|
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);
|
std::unique_ptr<FileSinkHandle> addDefaultLogger(const std::string& log_prefix, const std::string& log_directory);
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user