Skip to content
Snippets Groups Projects
Commit d890efe9 authored by g0dil's avatar g0dil
Browse files

Utils/Logger: Target examples\nPackets: Relax annotation type restrictions

parent 6f98e372
No related branches found
No related tags found
No related merge requests found
...@@ -31,7 +31,8 @@ ...@@ -31,7 +31,8 @@
#include <vector> #include <vector>
#include <boost/utility.hpp> #include <boost/utility.hpp>
#include <boost/type_traits/is_base_of.hpp> #include <boost/type_traits/is_base_of.hpp>
#include <boost/type_traits/is_pod.hpp> #include <boost/type_traits/has_trivial_constructor.hpp>
#include <boost/type_traits/has_trivial_destructor.hpp>
#include <boost/static_assert.hpp> #include <boost/static_assert.hpp>
#include "../Utils/pool_alloc_mixin.hh" #include "../Utils/pool_alloc_mixin.hh"
#include "PacketTypes.hh" #include "PacketTypes.hh"
...@@ -98,7 +99,9 @@ namespace detail { ...@@ -98,7 +99,9 @@ namespace detail {
# ifdef BOOST_HAS_TYPE_TRAITS_INTRINSICS # ifdef BOOST_HAS_TYPE_TRAITS_INTRINSICS
BOOST_STATIC_ASSERT(( boost::is_pod<Annotation>::value || Complex )); BOOST_STATIC_ASSERT(( (boost::has_trivial_constructor<Annotation>::value
&& boost::has_trivial_destructor<Annotation>::value)
|| Complex ));
# endif # endif
}; };
......
...@@ -42,6 +42,13 @@ namespace log { ...@@ -42,6 +42,13 @@ namespace log {
The FileTarget will save all %log messages in the given file. Messages will be appended at The FileTarget will save all %log messages in the given file. Messages will be appended at
the end of the file. the end of the file.
\code
senf::log::FileTarget target ("file.name");
// Route all messages to this file.
target.route();
\endcode
After %log files have been rotated, the reopen() member should be called to create a new %log After %log files have been rotated, the reopen() member should be called to create a new %log
file. file.
......
...@@ -40,6 +40,13 @@ namespace log { ...@@ -40,6 +40,13 @@ namespace log {
The SyslogTarget will send all log messages to the syslog at the given facility. The SyslogTarget will send all log messages to the syslog at the given facility.
\code
senf::log::SyslogTarget syslog;
// Route all messages to the syslog
syslog.route();
\endcode
Valid facility values (taken from <tt>man 3 syslog</tt>): Valid facility values (taken from <tt>man 3 syslog</tt>):
\par "" \par ""
<tt>LOG_AUTHPRIV</tt>, <tt>LOG_CRON</tt>, <tt>LOG_DAEMON</tt>, <tt>LOG_FTP</tt>, <tt>LOG_AUTHPRIV</tt>, <tt>LOG_CRON</tt>, <tt>LOG_DAEMON</tt>, <tt>LOG_FTP</tt>,
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment