Changeset 236 in pacpusframework for trunk/include
- Timestamp:
- Nov 28, 2013, 5:07:16 PM (11 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/include/Pacpus/kernel/Log.h
r196 r236 17 17 #include <Pacpus/kernel/PacpusLibConfig.h> 18 18 19 namespace pacpus { 19 namespace pacpus 20 { 20 21 21 22 /// Static log facility initializer … … 34 35 35 36 #if defined(PACPUS_USE_LOG) 37 # include <boost/log/common.hpp> 36 38 # include <boost/log/attributes/named_scope.hpp> 37 # include <boost/log/trivial.hpp> 39 # include <boost/log/core.hpp> 40 # include <boost/log/sources/record_ostream.hpp> 41 # include <boost/log/sources/severity_logger.hpp> 38 42 # include <iosfwd> 43 44 namespace pacpus 45 { 46 /// Trivial severity levels 47 /*PACPUSLIB_API*/ enum SeverityLevel 48 { 49 trace, 50 debug, 51 info, 52 warning, 53 error, 54 fatal 55 }; 56 57 BOOST_LOG_INLINE_GLOBAL_LOGGER_DEFAULT(gLogger, ::boost::log::sources::severity_logger_mt< ::pacpus::SeverityLevel>) 58 59 } // namespace pacpus 39 60 40 61 class QString; … … 45 66 # define PACPUS_LOG_FUNCTION() BOOST_LOG_FUNCTION() 46 67 # define PACPUS_LOG_NAMED_SCOPE(name) BOOST_LOG_NAMED_SCOPE(name) 47 # define PACPUS_LOG(level, message) BOOST_LOG_ TRIVIAL(level) << message68 # define PACPUS_LOG(level, message) BOOST_LOG_SEV( ::pacpus::gLogger::get(), level) << message 48 69 #else 49 70 /// @param name Name of the logger, displayed when logging a message. … … 55 76 56 77 /// Logs a message at TRACE level using default logger 57 #define LOG_TRACE(message) PACPUS_LOG( trace, message)78 #define LOG_TRACE(message) PACPUS_LOG( ::pacpus::trace, message) 58 79 /// Logs a message at DEBUG level using default logger 59 #define LOG_DEBUG(message) PACPUS_LOG( debug, message)80 #define LOG_DEBUG(message) PACPUS_LOG( ::pacpus::debug, message) 60 81 /// Logs a message at INFO level using default logger 61 #define LOG_INFO(message) PACPUS_LOG( info, message)82 #define LOG_INFO(message) PACPUS_LOG( ::pacpus::info, message) 62 83 /// Logs a message at WARN level using default logger 63 #define LOG_WARN(message) PACPUS_LOG( warning, message)84 #define LOG_WARN(message) PACPUS_LOG( ::pacpus::warning, message) 64 85 /// Logs a message at ERROR level using default logger 65 #define LOG_ERROR(message) PACPUS_LOG( error, message)86 #define LOG_ERROR(message) PACPUS_LOG( ::pacpus::error, message) 66 87 /// Logs a message at FATAL level using default logger 67 #define LOG_FATAL(message) PACPUS_LOG( fatal, message)88 #define LOG_FATAL(message) PACPUS_LOG( ::pacpus::fatal, message) 68 89 69 90 #endif // DEF_PACPUS_LOG_H
Note:
See TracChangeset
for help on using the changeset viewer.