logging.cpp 591 B

12345678910111213141516171819202122232425
  1. //Copyright (c) 2006-2009 Emil Dotchevski and Reverge Studios, Inc.
  2. //Distributed under the Boost Software License, Version 1.0. (See accompanying
  3. //file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
  4. //This example shows how to print all data contained in a boost::exception.
  5. #include <boost/exception/all.hpp>
  6. #include <iostream>
  7. void f(); //throws unknown types that derive from boost::exception.
  8. void
  9. g()
  10. {
  11. try
  12. {
  13. f();
  14. }
  15. catch(
  16. boost::exception & e )
  17. {
  18. std::cerr << diagnostic_information(e);
  19. }
  20. }