Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- // Logfile
- log::add("file", std::fstream("log.txt"))
- .serivity(log::level::LOG_INFO);
- // Debug log
- log::add("debug", std::fstream("debug.txt"))
- .serivity(log::level::LOG_DEBUG);
- // Output
- log::add("stdout", std::cout)
- .serivity(log::level::LOG_WARN);
- // ...
- // Log to all targets
- log::info() << "this is a test" << std::endl;
- log::warn() << "Forking process, child pid = " << pid << " (parent = " << ppid << ")" << std::endl;
- // Close stdout
- log::close("stdout");
- // ...
- // Log to remaining targets
- log::info() << "this is a test" << std::endl;
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement