Skip to content

Instantly share code, notes, and snippets.

@akira-okumura
Created December 14, 2014 23:52
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save akira-okumura/45f92c0e06dfafeb370a to your computer and use it in GitHub Desktop.
Save akira-okumura/45f92c0e06dfafeb370a to your computer and use it in GitHub Desktop.
$ g++ -c Logger.cc -o Logger.o -Wall -Wextra -O2 -DBOOST_LOG_DYN_LINK
$ g++ -c main.cc -o main.o -Wall -Wextra -O2 -DBOOST_LOG_DYN_LINK
$ g++ Logger.o main.o -o logger -L/opt/local/lib -lboost_log-mt -lboost_thread-mt -lboost_system-mt
$ ./logger
3 2014/12/14 23:51:46.462308 (UTC) [WARNING] This is a WARNING output
4 2014/12/14 23:51:46.462322 (UTC) [ERROR] This is an ERROR output
5 2014/12/14 23:51:46.462336 (UTC) [FATAL] This is a FATAL output
$ cat debug.log
1 2014/12/14 23:51:46.462186 (UTC) [DEBUG] This is a DEBUG output
2 2014/12/14 23:51:46.462300 (UTC) [INFO] This is a INFO output
3 2014/12/14 23:51:46.462308 (UTC) [WARNING] This is a WARNING output
4 2014/12/14 23:51:46.462322 (UTC) [ERROR] This is an ERROR output
5 2014/12/14 23:51:46.462336 (UTC) [FATAL] This is a FATAL output
6 2014/12/14 23:51:46.462344 (UTC) [WARNING] This is the 2nd WARNING output
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment