File indexing completed on 2025-01-18 09:39:26
0001
0002
0003
0004
0005
0006
0007
0008
0009
0010
0011
0012
0013
0014
0015 #ifndef BOOST_LOG_SOURCES_SEVERITY_LOGGER_HPP_INCLUDED_
0016 #define BOOST_LOG_SOURCES_SEVERITY_LOGGER_HPP_INCLUDED_
0017
0018 #include <boost/log/detail/config.hpp>
0019 #if !defined(BOOST_LOG_NO_THREADS)
0020 #include <boost/log/detail/light_rw_mutex.hpp>
0021 #endif
0022 #include <boost/log/sources/features.hpp>
0023 #include <boost/log/sources/basic_logger.hpp>
0024 #include <boost/log/sources/threading_models.hpp>
0025 #include <boost/log/sources/severity_feature.hpp>
0026 #include <boost/log/keywords/severity.hpp>
0027 #include <boost/log/detail/header.hpp>
0028
0029 #ifdef BOOST_HAS_PRAGMA_ONCE
0030 #pragma once
0031 #endif
0032
0033 namespace boost {
0034
0035 BOOST_LOG_OPEN_NAMESPACE
0036
0037 namespace sources {
0038
0039 #ifndef BOOST_LOG_DOXYGEN_PASS
0040
0041 #ifdef BOOST_LOG_USE_CHAR
0042
0043
0044 template< typename LevelT = int >
0045 class severity_logger :
0046 public basic_composite_logger<
0047 char,
0048 severity_logger< LevelT >,
0049 single_thread_model,
0050 features< severity< LevelT > >
0051 >
0052 {
0053 typedef typename severity_logger::logger_base base_type;
0054
0055 public:
0056 BOOST_LOG_FORWARD_LOGGER_MEMBERS_TEMPLATE(severity_logger)
0057
0058 explicit severity_logger(LevelT level) : base_type(keywords::severity = level)
0059 {
0060 }
0061 };
0062
0063 #if !defined(BOOST_LOG_NO_THREADS)
0064
0065
0066 template< typename LevelT = int >
0067 class severity_logger_mt :
0068 public basic_composite_logger<
0069 char,
0070 severity_logger_mt< LevelT >,
0071 multi_thread_model< boost::log::aux::light_rw_mutex >,
0072 features< severity< LevelT > >
0073 >
0074 {
0075 typedef typename severity_logger_mt::logger_base base_type;
0076
0077 public:
0078 BOOST_LOG_FORWARD_LOGGER_MEMBERS_TEMPLATE(severity_logger_mt)
0079
0080 explicit severity_logger_mt(LevelT level) : base_type(keywords::severity = level)
0081 {
0082 }
0083 };
0084
0085 #endif
0086
0087 #endif
0088
0089 #ifdef BOOST_LOG_USE_WCHAR_T
0090
0091
0092 template< typename LevelT = int >
0093 class wseverity_logger :
0094 public basic_composite_logger<
0095 wchar_t,
0096 wseverity_logger< LevelT >,
0097 single_thread_model,
0098 features< severity< LevelT > >
0099 >
0100 {
0101 typedef typename wseverity_logger::logger_base base_type;
0102
0103 public:
0104 BOOST_LOG_FORWARD_LOGGER_MEMBERS_TEMPLATE(wseverity_logger)
0105
0106 explicit wseverity_logger(LevelT level) : base_type(keywords::severity = level)
0107 {
0108 }
0109 };
0110
0111 #if !defined(BOOST_LOG_NO_THREADS)
0112
0113
0114 template< typename LevelT = int >
0115 class wseverity_logger_mt :
0116 public basic_composite_logger<
0117 wchar_t,
0118 wseverity_logger_mt< LevelT >,
0119 multi_thread_model< boost::log::aux::light_rw_mutex >,
0120 features< severity< LevelT > >
0121 >
0122 {
0123 typedef typename wseverity_logger_mt::logger_base base_type;
0124
0125 public:
0126 BOOST_LOG_FORWARD_LOGGER_MEMBERS_TEMPLATE(wseverity_logger_mt)
0127
0128 explicit wseverity_logger_mt(LevelT level) : base_type(keywords::severity = level)
0129 {
0130 }
0131 };
0132
0133 #endif
0134
0135 #endif
0136
0137 #else
0138
0139
0140
0141
0142
0143
0144 template< typename LevelT = int >
0145 class severity_logger :
0146 public basic_composite_logger<
0147 char,
0148 severity_logger< LevelT >,
0149 single_thread_model,
0150 features< severity< LevelT > >
0151 >
0152 {
0153 public:
0154
0155
0156
0157 severity_logger();
0158
0159
0160
0161 severity_logger(severity_logger const& that);
0162
0163
0164
0165 template< typename... ArgsT >
0166 explicit severity_logger(ArgsT... const& args);
0167
0168
0169
0170
0171
0172 explicit severity_logger(LevelT level);
0173
0174
0175
0176 severity_logger& operator= (severity_logger const& that)
0177
0178
0179
0180 void swap(severity_logger& that);
0181 };
0182
0183
0184
0185
0186
0187
0188 template< typename LevelT = int >
0189 class severity_logger_mt :
0190 public basic_composite_logger<
0191 char,
0192 severity_logger_mt< LevelT >,
0193 multi_thread_model< implementation_defined >,
0194 features< severity< LevelT > >
0195 >
0196 {
0197 public:
0198
0199
0200
0201 severity_logger_mt();
0202
0203
0204
0205 severity_logger_mt(severity_logger_mt const& that);
0206
0207
0208
0209 template< typename... ArgsT >
0210 explicit severity_logger_mt(ArgsT... const& args);
0211
0212
0213
0214
0215
0216 explicit severity_logger_mt(LevelT level);
0217
0218
0219
0220 severity_logger_mt& operator= (severity_logger_mt const& that)
0221
0222
0223
0224 void swap(severity_logger_mt& that);
0225 };
0226
0227
0228
0229
0230
0231
0232 template< typename LevelT = int >
0233 class wseverity_logger :
0234 public basic_composite_logger<
0235 wchar_t,
0236 wseverity_logger< LevelT >,
0237 single_thread_model,
0238 features< severity< LevelT > >
0239 >
0240 {
0241 public:
0242
0243
0244
0245 wseverity_logger();
0246
0247
0248
0249 wseverity_logger(wseverity_logger const& that);
0250
0251
0252
0253 template< typename... ArgsT >
0254 explicit wseverity_logger(ArgsT... const& args);
0255
0256
0257
0258
0259
0260 explicit wseverity_logger(LevelT level);
0261
0262
0263
0264 wseverity_logger& operator= (wseverity_logger const& that)
0265
0266
0267
0268 void swap(wseverity_logger& that);
0269 };
0270
0271
0272
0273
0274
0275
0276 template< typename LevelT = int >
0277 class wseverity_logger_mt :
0278 public basic_composite_logger<
0279 wchar_t,
0280 wseverity_logger_mt< LevelT >,
0281 multi_thread_model< implementation_defined >,
0282 features< severity< LevelT > >
0283 >
0284 {
0285 public:
0286
0287
0288
0289 wseverity_logger_mt();
0290
0291
0292
0293 wseverity_logger_mt(wseverity_logger_mt const& that);
0294
0295
0296
0297 template< typename... ArgsT >
0298 explicit wseverity_logger_mt(ArgsT... const& args);
0299
0300
0301
0302
0303
0304 explicit wseverity_logger_mt(LevelT level);
0305
0306
0307
0308 wseverity_logger_mt& operator= (wseverity_logger_mt const& that)
0309
0310
0311
0312 void swap(wseverity_logger_mt& that);
0313 };
0314
0315 #endif
0316
0317 }
0318
0319 BOOST_LOG_CLOSE_NAMESPACE
0320
0321 }
0322
0323 #include <boost/log/detail/footer.hpp>
0324
0325 #endif