Advertisement
bueddl

Untitled

Dec 3rd, 2015
88
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.59 KB | None | 0 0
  1.  
  2.     // Logfile
  3.     log::add("file", std::fstream("log.txt"))
  4.         .serivity(log::level::LOG_INFO);
  5.  
  6.     // Debug log
  7.     log::add("debug", std::fstream("debug.txt"))
  8.         .serivity(log::level::LOG_DEBUG);
  9.  
  10.     // Output
  11.     log::add("stdout", std::cout)
  12.         .serivity(log::level::LOG_WARN);
  13.  
  14.     // ...
  15.  
  16.     // Log to all targets
  17.     log::info() << "this is a test" << std::endl;
  18.     log::warn() << "Forking process, child pid = " << pid << " (parent = " << ppid << ")" << std::endl;
  19.  
  20.     // Close stdout
  21.     log::close("stdout");
  22.    
  23.     // ...
  24.  
  25.     // Log to remaining targets
  26.     log::info() << "this is a test" << std::endl;
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement