]> git.proxmox.com Git - ceph.git/blobdiff - ceph/src/boost/boost/log/sinks/text_multifile_backend.hpp
import new upstream nautilus stable release 14.2.8
[ceph.git] / ceph / src / boost / boost / log / sinks / text_multifile_backend.hpp
index 8e707b990c30807db967e02806edb55888acb17a..2db672b366cf45e2804f23f215c002a7d8245c3d 100644 (file)
 #include <boost/filesystem/path.hpp>
 #include <boost/log/detail/config.hpp>
 #include <boost/log/detail/light_function.hpp>
+#include <boost/log/detail/parameter_tools.hpp>
 #include <boost/log/detail/cleanup_scope_guard.hpp>
+#include <boost/log/keywords/auto_newline_mode.hpp>
+#include <boost/log/sinks/auto_newline_mode.hpp>
 #include <boost/log/sinks/basic_sink_backend.hpp>
 #include <boost/log/utility/formatting_ostream.hpp>
 #include <boost/log/detail/header.hpp>
@@ -161,10 +164,24 @@ private:
 public:
     /*!
      * Default constructor. The constructed sink backend has no file name composer and
-     * thus will not write any files.
+     * thus will not write any files. All other parameters are set to their defaults.
      */
     BOOST_LOG_API text_multifile_backend();
 
+    /*!
+     * Constructor. Creates a sink backend with the specified named parameters.
+     * The following named parameters are supported:
+     *
+     * \li \c auto_newline_mode - Specifies automatic trailing newline insertion mode. Must be a value of
+     *                            the \c auto_newline_mode enum. By default, is <tt>auto_newline_mode::insert_if_missing</tt>.
+     */
+#ifndef BOOST_LOG_DOXYGEN_PASS
+    BOOST_LOG_PARAMETRIZED_CONSTRUCTORS_CALL(text_multifile_backend, construct)
+#else
+    template< typename... ArgsT >
+    explicit text_multifile_backend(ArgsT... const& args);
+#endif
+
     /*!
      * Destructor
      */
@@ -181,6 +198,14 @@ public:
         set_file_name_composer_internal(composer);
     }
 
+    /*!
+     * Selects whether a trailing newline should be automatically inserted after every log record. See
+     * \c auto_newline_mode description for the possible modes of operation.
+     *
+     * \param mode The trailing newline insertion mode.
+     */
+    BOOST_LOG_API void set_auto_newline_mode(auto_newline_mode mode);
+
     /*!
      * The method writes the message to the sink
      */
@@ -188,6 +213,15 @@ public:
 
 private:
 #ifndef BOOST_LOG_DOXYGEN_PASS
+    //! Constructor implementation
+    template< typename ArgsT >
+    void construct(ArgsT const& args)
+    {
+        construct(args[keywords::auto_newline_mode | insert_if_missing]);
+    }
+    //! Constructor implementation
+    BOOST_LOG_API void construct(auto_newline_mode auto_newline);
+
     //! The method sets the file name composer
     BOOST_LOG_API void set_file_name_composer_internal(file_name_composer_type const& composer);
 #endif // BOOST_LOG_DOXYGEN_PASS