how to create log files per function or per module using g3log

Viewed 45

i need to do log files per function or per module using g3log

but I don't know how to do it..... i read the package and try to do, but I'm very new programmer....

// main.cpp
#include<g2log.hpp>
#include<g2logworker.hpp>
#include <std2_make_unique.hpp>
 
#include "CustomSink.h"
 
int main(int argc, char**argv) {
   using namespace g2;
   auto defaultHandler = LogWorker::createWithDefaultLogger(argv[0], 
                                                 path_to_log_file);
 
   // logger is initialized
   g2::initializeLogging(defaultHandler.worker.get());
 
   ...
}

can anyone write a sample about it ??

thank you!

0 Answers
Related