logger.hpp 2.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103
  1. /*
  2. * Copyright Andrey Semashev 2007 - 2015.
  3. * Distributed under the Boost Software License, Version 1.0.
  4. * (See accompanying file LICENSE_1_0.txt or copy at
  5. * http://www.boost.org/LICENSE_1_0.txt)
  6. */
  7. /*!
  8. * \file logger.hpp
  9. * \author Andrey Semashev
  10. * \date 08.03.2007
  11. *
  12. * The header contains implementation of a simplistic logger with no features.
  13. */
  14. #ifndef BOOST_LOG_SOURCES_LOGGER_HPP_INCLUDED_
  15. #define BOOST_LOG_SOURCES_LOGGER_HPP_INCLUDED_
  16. #include <boost/log/detail/config.hpp>
  17. #include <boost/log/sources/basic_logger.hpp>
  18. #include <boost/log/sources/features.hpp>
  19. #include <boost/log/sources/threading_models.hpp>
  20. #if !defined(BOOST_LOG_NO_THREADS)
  21. #include <boost/log/detail/light_rw_mutex.hpp>
  22. #endif // !defined(BOOST_LOG_NO_THREADS)
  23. #include <boost/log/detail/header.hpp>
  24. #ifdef BOOST_HAS_PRAGMA_ONCE
  25. #pragma once
  26. #endif
  27. namespace boost {
  28. BOOST_LOG_OPEN_NAMESPACE
  29. namespace sources {
  30. #ifdef BOOST_LOG_USE_CHAR
  31. /*!
  32. * \brief Narrow-char logger. Functionally equivalent to \c basic_logger.
  33. *
  34. * See \c basic_logger class template for a more detailed description.
  35. */
  36. class logger :
  37. public basic_composite_logger< char, logger, single_thread_model, features< > >
  38. {
  39. BOOST_LOG_FORWARD_LOGGER_MEMBERS(logger)
  40. };
  41. #if !defined(BOOST_LOG_NO_THREADS)
  42. /*!
  43. * \brief Narrow-char thread-safe logger. Functionally equivalent to \c basic_logger.
  44. *
  45. * See \c basic_logger class template for a more detailed description.
  46. */
  47. class logger_mt :
  48. public basic_composite_logger< char, logger_mt, multi_thread_model< boost::log::aux::light_rw_mutex >, features< > >
  49. {
  50. BOOST_LOG_FORWARD_LOGGER_MEMBERS(logger_mt)
  51. };
  52. #endif // !defined(BOOST_LOG_NO_THREADS)
  53. #endif // BOOST_LOG_USE_CHAR
  54. #ifdef BOOST_LOG_USE_WCHAR_T
  55. /*!
  56. * \brief Wide-char logger. Functionally equivalent to \c basic_logger.
  57. *
  58. * See \c basic_logger class template for a more detailed description.
  59. */
  60. class wlogger :
  61. public basic_composite_logger< wchar_t, wlogger, single_thread_model, features< > >
  62. {
  63. BOOST_LOG_FORWARD_LOGGER_MEMBERS(wlogger)
  64. };
  65. #if !defined(BOOST_LOG_NO_THREADS)
  66. /*!
  67. * \brief Wide-char thread-safe logger. Functionally equivalent to \c basic_logger.
  68. *
  69. * See \c basic_logger class template for a more detailed description.
  70. */
  71. class wlogger_mt :
  72. public basic_composite_logger< wchar_t, wlogger_mt, multi_thread_model< boost::log::aux::light_rw_mutex >, features< > >
  73. {
  74. BOOST_LOG_FORWARD_LOGGER_MEMBERS(wlogger_mt)
  75. };
  76. #endif // !defined(BOOST_LOG_NO_THREADS)
  77. #endif // BOOST_LOG_USE_WCHAR_T
  78. } // namespace sources
  79. BOOST_LOG_CLOSE_NAMESPACE // namespace log
  80. } // namespace boost
  81. #include <boost/log/detail/footer.hpp>
  82. #endif // BOOST_LOG_SOURCES_LOGGER_HPP_INCLUDED_