Skip to content

Instantly share code, notes, and snippets.

@orian
Created December 20, 2013 23:55
Show Gist options
  • Save orian/8063546 to your computer and use it in GitHub Desktop.
Save orian/8063546 to your computer and use it in GitHub Desktop.
Boost.Log simplest code + command line to compile it. Boost v1.54 Ubuntu 13.10,
#include <boost/log/trivial.hpp>
int main(int, char*[])
{
BOOST_LOG_TRIVIAL(trace) << "A trace severity message";
BOOST_LOG_TRIVIAL(debug) << "A debug severity message";
BOOST_LOG_TRIVIAL(info) << "An informational severity message";
BOOST_LOG_TRIVIAL(warning) << "A warning severity message";
BOOST_LOG_TRIVIAL(error) << "An error severity message";
BOOST_LOG_TRIVIAL(fatal) << "A fatal severity message";
return 0;
}
#!/bin/bash
#
# On Ubuntu install lib Boost by:
# sudo apt-get install libboost1.54-dev-all
g++ \
-DBOOST_LOG_DYN_LINK \
-std=c++11 \
-Wall \
boost_log_test.cc \
-lboost_log_setup \
-lboost_log \
-pthread \
-o boost_log_test
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment