sinks_reference.xml 138 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996997998999100010011002100310041005100610071008100910101011101210131014101510161017101810191020102110221023102410251026102710281029103010311032103310341035103610371038103910401041104210431044104510461047104810491050105110521053105410551056105710581059106010611062106310641065106610671068106910701071107210731074107510761077107810791080108110821083108410851086108710881089109010911092109310941095109610971098109911001101110211031104110511061107110811091110111111121113111411151116
  1. <?xml version="1.0" standalone="yes"?>
  2. <library-reference id="sinks"><title>Sinks</title><header name="boost/log/sinks/async_frontend.hpp">
  3. <para><para>Andrey Semashev </para>
  4. <para>14.07.2009</para>
  5. The header contains implementation of asynchronous sink frontend. </para><namespace name="boost">
  6. <namespace name="log">
  7. <namespace name="sinks">
  8. <class name="asynchronous_sink"><template>
  9. <template-type-parameter name="SinkBackendT"/>
  10. <template-type-parameter name="QueueingStrategyT"><default><classname alt="boost::log::sinks::unbounded_fifo_queue">unbounded_fifo_queue</classname></default></template-type-parameter>
  11. </template><inherit access="public">basic_sink_frontend</inherit><inherit access="public">QueueingStrategyT</inherit><purpose>Asynchronous logging sink frontend. </purpose><description><para>The frontend starts a separate thread on construction. All logging records are passed to the backend in this dedicated thread only. </para></description><class name="scoped_flag"><purpose>A scope guard that resets a flag on destructor. </purpose><method-group name="public member functions">
  12. </method-group>
  13. <constructor specifiers="explicit"><parameter name="mut"><paramtype>frontend_mutex_type &amp;</paramtype></parameter><parameter name="cond"><paramtype>condition_variable_any &amp;</paramtype></parameter><parameter name="f"><paramtype>boost::atomic&lt; bool &gt; &amp;</paramtype></parameter></constructor>
  14. <destructor/>
  15. <constructor cv="= delete"><parameter name=""><paramtype>scoped_flag const &amp;</paramtype></parameter></constructor>
  16. <copy-assignment cv="= delete"><type>scoped_flag &amp;</type><parameter name=""><paramtype>scoped_flag const &amp;</paramtype></parameter></copy-assignment>
  17. </class><class name="scoped_thread_id"><purpose>A scope guard that implements thread ID management. </purpose><method-group name="public member functions">
  18. </method-group>
  19. <constructor><parameter name="mut"><paramtype>frontend_mutex_type &amp;</paramtype></parameter><parameter name="cond"><paramtype>condition_variable_any &amp;</paramtype></parameter><parameter name="tid"><paramtype>thread::id &amp;</paramtype></parameter><parameter name="sr"><paramtype>boost::atomic&lt; bool &gt; &amp;</paramtype></parameter><purpose>Initializing constructor. </purpose></constructor>
  20. <constructor><parameter name="l"><paramtype>unique_lock&lt; frontend_mutex_type &gt; &amp;</paramtype></parameter><parameter name="cond"><paramtype>condition_variable_any &amp;</paramtype></parameter><parameter name="tid"><paramtype>thread::id &amp;</paramtype></parameter><parameter name="sr"><paramtype>boost::atomic&lt; bool &gt; &amp;</paramtype></parameter><purpose>Initializing constructor. </purpose></constructor>
  21. <destructor><purpose>Destructor. </purpose></destructor>
  22. <constructor cv="= delete"><parameter name=""><paramtype>scoped_thread_id const &amp;</paramtype></parameter></constructor>
  23. <copy-assignment cv="= delete"><type>scoped_thread_id &amp;</type><parameter name=""><paramtype>scoped_thread_id const &amp;</paramtype></parameter></copy-assignment>
  24. </class><typedef name="sink_backend_type"><purpose>Sink implementation type. </purpose><type>SinkBackendT</type></typedef>
  25. <typedef name="locked_backend_ptr"><purpose>A pointer type that locks the backend until it's destroyed. </purpose><type>implementation_defined</type></typedef>
  26. <method-group name="public member functions">
  27. <method name="locked_backend"><type>locked_backend_ptr</type><description><para>Locking accessor to the attached backend </para></description></method>
  28. <method name="consume" specifiers="virtual"><type>void</type><parameter name="rec"><paramtype>record_view const &amp;</paramtype></parameter><description><para>Enqueues the log record to the backend </para></description></method>
  29. <method name="try_consume" specifiers="virtual"><type>bool</type><parameter name="rec"><paramtype>record_view const &amp;</paramtype></parameter><description><para>The method attempts to pass logging record to the backend </para></description></method>
  30. <method name="run"><type>void</type><description><para>The method starts record feeding loop and effectively blocks until either of this happens:</para><para><itemizedlist>
  31. <listitem><para>the thread is interrupted due to either standard thread interruption or a call to <computeroutput>stop</computeroutput> </para>
  32. </listitem>
  33. <listitem><para>an exception is thrown while processing a log record in the backend, and the exception is not terminated by the exception handler, if one is installed</para>
  34. </listitem>
  35. </itemizedlist>
  36. </para></description><requires><para>The sink frontend must be constructed without spawning a dedicated thread </para>
  37. </requires></method>
  38. <method name="stop"><type>void</type><description><para>The method softly interrupts record feeding loop. This method must be called when the <computeroutput>run</computeroutput> method execution has to be interrupted. Unlike regular thread interruption, calling <computeroutput>stop</computeroutput> will not interrupt the record processing in the middle. Instead, the sink frontend will attempt to finish its business with the record in progress and return afterwards. This method can be called either if the sink was created with a dedicated thread, or if the feeding loop was initiated by user.</para><para><note><para>Returning from this method does not guarantee that there are no records left buffered in the sink frontend. It is possible that log records keep coming during and after this method is called. At some point of execution of this method log records stop being processed, and all records that come after this point are put into the queue. These records will be processed upon further calls to <computeroutput>run</computeroutput> or <computeroutput>feed_records</computeroutput>. </para>
  39. </note>
  40. </para></description></method>
  41. <method name="feed_records"><type>void</type><description><para>The method feeds log records that may have been buffered to the backend and returns</para><para>
  42. </para></description><requires><para>The sink frontend must be constructed without spawning a dedicated thread </para>
  43. </requires></method>
  44. <method name="flush" specifiers="virtual"><type>void</type><description><para>The method feeds all log records that may have been buffered to the backend and returns. Unlike <computeroutput>feed_records</computeroutput>, in case of ordering queueing the method also feeds records that were enqueued during the ordering window, attempting to empty the queue completely. </para></description></method>
  45. </method-group>
  46. <constructor><parameter name="start_thread"><paramtype>bool</paramtype><default>true</default><description><para>If <computeroutput>true</computeroutput>, the frontend creates a thread to feed log records to the backend. Otherwise no thread is started and it is assumed that the user will call either <computeroutput>run</computeroutput> or <computeroutput>feed_records</computeroutput> himself. </para></description></parameter><description><para>Default constructor. Constructs the sink backend instance. Requires the backend to be default-constructible.</para><para>
  47. </para></description></constructor>
  48. <constructor specifiers="explicit"><parameter name="backend"><paramtype>shared_ptr&lt; sink_backend_type &gt; const &amp;</paramtype><description><para>Pointer to the backend instance. </para></description></parameter><parameter name="start_thread"><paramtype>bool</paramtype><default>true</default><description><para>If <computeroutput>true</computeroutput>, the frontend creates a thread to feed log records to the backend. Otherwise no thread is started and it is assumed that the user will call either <computeroutput>run</computeroutput> or <computeroutput>feed_records</computeroutput> himself.</para></description></parameter><description><para>Constructor attaches user-constructed backend instance</para><para>
  49. </para></description><requires><para><emphasis>backend</emphasis> is not <computeroutput>NULL</computeroutput>. </para>
  50. </requires></constructor>
  51. <constructor specifiers="explicit"><template>
  52. <template-nontype-parameter name="Args"><type>typename...</type></template-nontype-parameter>
  53. </template><parameter name="args"><paramtype>Args &amp;&amp;...</paramtype></parameter><description><para>Constructor that passes arbitrary named parameters to the interprocess sink backend constructor. Refer to the backend documentation for the list of supported parameters.</para><para>The frontend uses the following named parameters:</para><para><itemizedlist>
  54. <listitem><para>start_thread - If <computeroutput>true</computeroutput>, the frontend creates a thread to feed log records to the backend. Otherwise no thread is started and it is assumed that the user will call either <computeroutput>run</computeroutput> or <computeroutput>feed_records</computeroutput> himself. </para>
  55. </listitem>
  56. </itemizedlist>
  57. </para></description></constructor>
  58. <destructor><description><para>Destructor. Implicitly stops the dedicated feeding thread, if one is running. </para></description></destructor>
  59. </class></namespace>
  60. </namespace>
  61. </namespace>
  62. </header>
  63. <header name="boost/log/sinks/attribute_mapping.hpp">
  64. <para><para>Andrey Semashev </para>
  65. <para>07.11.2008</para>
  66. The header contains facilities that are used in different sinks to map attribute values used throughout the application to values used with the specific native logging API. These tools are mostly needed to map application severity levels on native levels, required by OS-specific sink backends. </para><namespace name="boost">
  67. <namespace name="log">
  68. <namespace name="sinks">
  69. <class name="basic_custom_mapping"><template>
  70. <template-type-parameter name="MappedT"/>
  71. <template-type-parameter name="AttributeValueT"><default>int</default></template-type-parameter>
  72. </template><inherit access="public">boost::log::sinks::basic_mapping&lt; MappedT &gt;</inherit><purpose>Customizable mapping. </purpose><description><para>The class allows to setup a custom mapping between an attribute and native values. The mapping should be initialized similarly to the standard <computeroutput>map</computeroutput> container, by using indexing operator and assignment.</para><para><note><para>Unlike many other components of the library, exact type of the attribute value must be specified in the template parameter <computeroutput>AttributeValueT</computeroutput>. Type sequences are not supported. </para>
  73. </note>
  74. </para></description><typedef name="attribute_value_type"><purpose>Attribute contained value type. </purpose><type>AttributeValueT</type></typedef>
  75. <typedef name="mapped_type"><purpose>Mapped value type. </purpose><type>base_type::mapped_type</type></typedef>
  76. <method-group name="public member functions">
  77. <method name="operator()" cv="const"><type>mapped_type</type><parameter name="rec"><paramtype>record_view const &amp;</paramtype><description><para>A log record to extract value from </para></description></parameter><description><para>Extraction operator. Extracts the attribute value and attempts to map it onto the native value.</para><para>
  78. </para></description><returns><para>A mapped value, if mapping was successful, or the default value if mapping did not succeed. </para>
  79. </returns></method>
  80. <method name="operator[]"><type>implementation_defined</type><parameter name="key"><paramtype>attribute_value_type const &amp;</paramtype><description><para>Attribute value to be mapped </para></description></parameter><description><para>Insertion operator</para><para>
  81. </para></description><returns><para>An object of unspecified type that allows to insert a new mapping through assignment. The <emphasis>key</emphasis> argument becomes the key attribute value, and the assigned value becomes the mapped native value. </para>
  82. </returns></method>
  83. </method-group>
  84. <constructor specifiers="explicit"><parameter name="name"><paramtype>attribute_name const &amp;</paramtype><description><para>Attribute name </para></description></parameter><parameter name="default_value"><paramtype>mapped_type const &amp;</paramtype><description><para>The default native value that is returned if the conversion cannot be performed </para></description></parameter><description><para>Constructor</para><para>
  85. </para></description></constructor>
  86. </class><class name="basic_direct_mapping"><template>
  87. <template-type-parameter name="MappedT"/>
  88. <template-type-parameter name="AttributeValueT"><default>int</default></template-type-parameter>
  89. </template><inherit access="public">boost::log::sinks::basic_mapping&lt; MappedT &gt;</inherit><purpose>Straightforward mapping. </purpose><description><para>This type of mapping assumes that attribute with a particular name always provides values that map directly onto the native values. The mapping simply returns the extracted attribute value converted to the native value. </para></description><typedef name="attribute_value_type"><purpose>Attribute contained value type. </purpose><type>AttributeValueT</type></typedef>
  90. <typedef name="mapped_type"><purpose>Mapped value type. </purpose><type>base_type::mapped_type</type></typedef>
  91. <method-group name="public member functions">
  92. <method name="operator()" cv="const"><type>mapped_type</type><parameter name="rec"><paramtype>record_view const &amp;</paramtype><description><para>A log record to extract value from </para></description></parameter><description><para>Extraction operator</para><para>
  93. </para></description><returns><para>An extracted attribute value </para>
  94. </returns></method>
  95. </method-group>
  96. <constructor specifiers="explicit"><parameter name="name"><paramtype>attribute_name const &amp;</paramtype><description><para>Attribute name </para></description></parameter><parameter name="default_value"><paramtype>mapped_type const &amp;</paramtype><description><para>The default native value that is returned if the attribute value is not found </para></description></parameter><description><para>Constructor</para><para>
  97. </para></description></constructor>
  98. </class><struct name="basic_mapping"><template>
  99. <template-type-parameter name="MappedT"/>
  100. </template><purpose>Base class for attribute mapping function objects. </purpose><typedef name="mapped_type"><purpose>Mapped value type. </purpose><type>MappedT</type></typedef>
  101. <typedef name="result_type"><purpose>Result type. </purpose><type>mapped_type</type></typedef>
  102. </struct></namespace>
  103. </namespace>
  104. </namespace>
  105. </header>
  106. <header name="boost/log/sinks/auto_newline_mode.hpp">
  107. <para><para>Andrey Semashev </para>
  108. <para>23.06.2019</para>
  109. The header contains definition of auto-newline modes. </para><namespace name="boost">
  110. <namespace name="log">
  111. <namespace name="sinks">
  112. <enum name="auto_newline_mode"><enumvalue name="disabled_auto_newline"><purpose>Do not insert automatic trailing newline characters. </purpose></enumvalue><enumvalue name="always_insert"><purpose>Always insert automatic trailing newline characters. </purpose></enumvalue><enumvalue name="insert_if_missing"><purpose>Insert automatic trailing newline characters, if not present already. </purpose></enumvalue><purpose>The enum lists automatic trailing newline modes. </purpose></enum>
  113. </namespace>
  114. </namespace>
  115. </namespace>
  116. </header>
  117. <header name="boost/log/sinks/basic_sink_backend.hpp">
  118. <para><para>Andrey Semashev </para>
  119. <para>04.11.2007</para>
  120. The header contains implementation of base classes for sink backends. </para><namespace name="boost">
  121. <namespace name="log">
  122. <namespace name="sinks">
  123. <struct name="basic_formatted_sink_backend"><template>
  124. <template-type-parameter name="CharT"/>
  125. <template-type-parameter name="FrontendRequirementsT"><default><classname alt="boost::log::sinks::synchronized_feeding">synchronized_feeding</classname></default></template-type-parameter>
  126. </template><inherit access="public">basic_sink_backend&lt; combine_requirements&lt; FrontendRequirementsT, formatted_records &gt;::type &gt;</inherit><purpose>A base class for a logging sink backend with message formatting support. </purpose><description><para>The <computeroutput><classname alt="boost::log::sinks::basic_formatted_sink_backend">basic_formatted_sink_backend</classname></computeroutput> class template indicates to the frontend that the backend requires logging record formatting.</para><para>The class allows to request encoding conversion in case if the sink backend requires the formatted string in some particular encoding (e.g. if underlying API supports only narrow or wide characters). In order to perform conversion one should specify the desired final character type in the <computeroutput>TargetCharT</computeroutput> template parameter. </para></description><typedef name="char_type"><purpose>Character type. </purpose><type>CharT</type></typedef>
  127. <typedef name="string_type"><purpose>Formatted string type. </purpose><type>std::basic_string&lt; char_type &gt;</type></typedef>
  128. <typedef name="frontend_requirements"><purpose>Frontend requirements. </purpose><type>base_type::frontend_requirements</type></typedef>
  129. </struct><struct name="basic_sink_backend"><template>
  130. <template-type-parameter name="FrontendRequirementsT"/>
  131. </template><purpose>Base class for a logging sink backend. </purpose><description><para>The <computeroutput><classname alt="boost::log::sinks::basic_sink_backend">basic_sink_backend</classname></computeroutput> class template defines a number of types that all sink backends are required to define. All sink backends have to derive from the class. </para></description><typedef name="frontend_requirements"><purpose>Frontend requirements tag. </purpose><type>FrontendRequirementsT</type></typedef>
  132. <method-group name="public member functions">
  133. </method-group>
  134. <constructor cv="= delete"><parameter name=""><paramtype><classname>basic_sink_backend</classname> const &amp;</paramtype></parameter></constructor>
  135. <copy-assignment cv="= delete"><type><classname>basic_sink_backend</classname> &amp;</type><parameter name=""><paramtype><classname>basic_sink_backend</classname> const &amp;</paramtype></parameter></copy-assignment>
  136. </struct></namespace>
  137. </namespace>
  138. </namespace>
  139. </header>
  140. <header name="boost/log/sinks/basic_sink_frontend.hpp">
  141. <para><para>Andrey Semashev </para>
  142. <para>14.07.2009</para>
  143. The header contains implementation of a base class for sink frontends. </para><namespace name="boost">
  144. <namespace name="log">
  145. <namespace name="sinks">
  146. <class name="basic_formatting_sink_frontend"><template>
  147. <template-type-parameter name="CharT"/>
  148. </template><inherit access="public">basic_sink_frontend</inherit><purpose>A base class for a logging sink frontend with formatting support. </purpose><struct name="formatting_context"><class name="cleanup_guard"><method-group name="public member functions">
  149. </method-group>
  150. <constructor specifiers="explicit" cv="noexcept"><parameter name="ctx"><paramtype>formatting_context &amp;</paramtype></parameter></constructor>
  151. <destructor/>
  152. <constructor cv="= delete"><parameter name=""><paramtype>cleanup_guard const &amp;</paramtype></parameter></constructor>
  153. <copy-assignment cv="= delete"><type>cleanup_guard &amp;</type><parameter name=""><paramtype>cleanup_guard const &amp;</paramtype></parameter></copy-assignment>
  154. </class><data-member name="m_Version"><type>const unsigned int</type><purpose>Object version. </purpose></data-member>
  155. <data-member name="m_FormattedRecord"><type>string_type</type><purpose>Formatted log record storage. </purpose></data-member>
  156. <data-member name="m_FormattingStream"><type>stream_type</type><purpose>Formatting stream. </purpose></data-member>
  157. <data-member name="m_Formatter"><type>formatter_type</type><purpose>Formatter functor. </purpose></data-member>
  158. <method-group name="public member functions">
  159. </method-group>
  160. <constructor/>
  161. <constructor><parameter name="version"><paramtype>unsigned int</paramtype></parameter><parameter name="loc"><paramtype>std::locale const &amp;</paramtype></parameter><parameter name="formatter"><paramtype>formatter_type const &amp;</paramtype></parameter></constructor>
  162. </struct><typedef name="char_type"><purpose>Character type. </purpose><type>CharT</type></typedef>
  163. <typedef name="string_type"><purpose>Formatted string type. </purpose><type>std::basic_string&lt; char_type &gt;</type></typedef>
  164. <typedef name="formatter_type"><purpose>Formatter function object type. </purpose><type>basic_formatter&lt; char_type &gt;</type></typedef>
  165. <typedef name="stream_type"><purpose>Output stream type. </purpose><type>formatter_type::stream_type</type></typedef>
  166. <method-group name="public member functions">
  167. <method name="set_formatter"><type>void</type><template>
  168. <template-type-parameter name="FunT"/>
  169. </template><parameter name="formatter"><paramtype>FunT const &amp;</paramtype></parameter><description><para>The method sets sink-specific formatter function object </para></description></method>
  170. <method name="reset_formatter"><type>void</type><description><para>The method resets the formatter </para></description></method>
  171. <method name="getloc" cv="const"><type>std::locale</type><description><para>The method returns the current locale used for formatting </para></description></method>
  172. <method name="imbue"><type>void</type><parameter name="loc"><paramtype>std::locale const &amp;</paramtype></parameter><description><para>The method sets the locale used for formatting </para></description></method>
  173. </method-group>
  174. <constructor specifiers="explicit"><parameter name="cross_thread"><paramtype>bool</paramtype><description><para>The flag indicates whether the sink passes log records between different threads </para></description></parameter><purpose>Initializing constructor. </purpose><description><para>
  175. </para></description></constructor>
  176. <method-group name="protected member functions">
  177. <method name="formatter"><type>formatter_type &amp;</type><purpose>Returns reference to the formatter. </purpose></method>
  178. <method name="feed_record"><type>void</type><template>
  179. <template-type-parameter name="BackendMutexT"/>
  180. <template-type-parameter name="BackendT"/>
  181. </template><parameter name="rec"><paramtype>record_view const &amp;</paramtype></parameter><parameter name="backend_mutex"><paramtype>BackendMutexT &amp;</paramtype></parameter><parameter name="backend"><paramtype>BackendT &amp;</paramtype></parameter><purpose>Feeds log record to the backend. </purpose></method>
  182. <method name="try_feed_record"><type>bool</type><template>
  183. <template-type-parameter name="BackendMutexT"/>
  184. <template-type-parameter name="BackendT"/>
  185. </template><parameter name="rec"><paramtype>record_view const &amp;</paramtype></parameter><parameter name="backend_mutex"><paramtype>BackendMutexT &amp;</paramtype></parameter><parameter name="backend"><paramtype>BackendT &amp;</paramtype></parameter><purpose>Attempts to feeds log record to the backend, does not block if <emphasis>backend_mutex</emphasis> is locked. </purpose></method>
  186. </method-group>
  187. </class><class name="basic_sink_frontend"><inherit access="public">sink</inherit><purpose>A base class for a logging sink frontend. </purpose><typedef name="exception_handler_type"><purpose>An exception handler type. </purpose><type>base_type::exception_handler_type</type></typedef>
  188. <method-group name="public member functions">
  189. <method name="set_filter"><type>void</type><template>
  190. <template-type-parameter name="FunT"/>
  191. </template><parameter name="filter"><paramtype>FunT const &amp;</paramtype></parameter><description><para>The method sets sink-specific filter functional object </para></description></method>
  192. <method name="reset_filter"><type>void</type><description><para>The method resets the filter </para></description></method>
  193. <method name="set_exception_handler"><type>void</type><template>
  194. <template-type-parameter name="FunT"/>
  195. </template><parameter name="handler"><paramtype>FunT const &amp;</paramtype></parameter><description><para>The method sets an exception handler function </para></description></method>
  196. <method name="reset_exception_handler"><type>void</type><description><para>The method resets the exception handler function </para></description></method>
  197. <method name="will_consume" specifiers="virtual"><type>bool</type><parameter name="attrs"><paramtype>attribute_value_set const &amp;</paramtype><description><para>A set of attribute values of a logging record </para></description></parameter><description><para>The method returns <computeroutput>true</computeroutput> if no filter is set or the attribute values pass the filter</para><para>
  198. </para></description></method>
  199. </method-group>
  200. <constructor specifiers="explicit"><parameter name="cross_thread"><paramtype>bool</paramtype><description><para>The flag indicates whether the sink passes log records between different threads </para></description></parameter><purpose>Initializing constructor. </purpose><description><para>
  201. </para></description></constructor>
  202. <method-group name="protected member functions">
  203. <method name="frontend_mutex" cv="const"><type>mutex_type &amp;</type><purpose>Returns reference to the frontend mutex. </purpose></method>
  204. <method name="exception_handler"><type>exception_handler_type &amp;</type><purpose>Returns reference to the exception handler. </purpose></method>
  205. <method name="exception_handler" cv="const"><type>exception_handler_type const &amp;</type><purpose>Returns reference to the exception handler. </purpose></method>
  206. <method name="feed_record"><type>void</type><template>
  207. <template-type-parameter name="BackendMutexT"/>
  208. <template-type-parameter name="BackendT"/>
  209. </template><parameter name="rec"><paramtype>record_view const &amp;</paramtype></parameter><parameter name="backend_mutex"><paramtype>BackendMutexT &amp;</paramtype></parameter><parameter name="backend"><paramtype>BackendT &amp;</paramtype></parameter><purpose>Feeds log record to the backend. </purpose></method>
  210. <method name="try_feed_record"><type>bool</type><template>
  211. <template-type-parameter name="BackendMutexT"/>
  212. <template-type-parameter name="BackendT"/>
  213. </template><parameter name="rec"><paramtype>record_view const &amp;</paramtype></parameter><parameter name="backend_mutex"><paramtype>BackendMutexT &amp;</paramtype></parameter><parameter name="backend"><paramtype>BackendT &amp;</paramtype></parameter><purpose>Attempts to feeds log record to the backend, does not block if <emphasis>backend_mutex</emphasis> is locked. </purpose></method>
  214. <method name="flush_backend"><type>void</type><template>
  215. <template-type-parameter name="BackendMutexT"/>
  216. <template-type-parameter name="BackendT"/>
  217. </template><parameter name="backend_mutex"><paramtype>BackendMutexT &amp;</paramtype></parameter><parameter name="backend"><paramtype>BackendT &amp;</paramtype></parameter><purpose>Flushes record buffers in the backend, if one supports it. </purpose></method>
  218. </method-group>
  219. <method-group name="private member functions">
  220. <method name="flush_backend_impl"><type>void</type><template>
  221. <template-type-parameter name="BackendMutexT"/>
  222. <template-type-parameter name="BackendT"/>
  223. </template><parameter name="backend_mutex"><paramtype>BackendMutexT &amp;</paramtype></parameter><parameter name="backend"><paramtype>BackendT &amp;</paramtype></parameter><parameter name=""><paramtype>mpl::true_</paramtype></parameter><purpose>Flushes record buffers in the backend (the actual implementation) </purpose></method>
  224. <method name="flush_backend_impl"><type>void</type><template>
  225. <template-type-parameter name="BackendMutexT"/>
  226. <template-type-parameter name="BackendT"/>
  227. </template><parameter name=""><paramtype>BackendMutexT &amp;</paramtype></parameter><parameter name=""><paramtype>BackendT &amp;</paramtype></parameter><parameter name=""><paramtype>mpl::false_</paramtype></parameter><purpose>Flushes record buffers in the backend (stub for backends that don't support flushing) </purpose></method>
  228. </method-group>
  229. </class></namespace>
  230. </namespace>
  231. </namespace>
  232. </header>
  233. <header name="boost/log/sinks/block_on_overflow.hpp">
  234. <para><para>Andrey Semashev </para>
  235. <para>04.01.2012</para>
  236. The header contains implementation of <computeroutput>block_on_overflow</computeroutput> strategy for handling queue overflows in bounded queues for the asynchronous sink frontend. </para><namespace name="boost">
  237. <namespace name="log">
  238. <namespace name="sinks">
  239. <class name="block_on_overflow"><purpose>Blocking strategy for handling log record queue overflows. </purpose><description><para>This strategy will cause enqueueing threads to block when the log record queue overflows. The blocked threads will be woken as soon as there appears free space in the queue, in the same order they attempted to enqueue records. </para></description></class></namespace>
  240. </namespace>
  241. </namespace>
  242. </header>
  243. <header name="boost/log/sinks/bounded_fifo_queue.hpp">
  244. <para><para>Andrey Semashev </para>
  245. <para>04.01.2012</para>
  246. The header contains implementation of bounded FIFO queueing strategy for the asynchronous sink frontend. </para><namespace name="boost">
  247. <namespace name="log">
  248. <namespace name="sinks">
  249. <class name="bounded_fifo_queue"><template>
  250. <template-nontype-parameter name="MaxQueueSizeV"><type>std::size_t</type></template-nontype-parameter>
  251. <template-type-parameter name="OverflowStrategyT"/>
  252. </template><inherit access="private">OverflowStrategyT</inherit><purpose>Bounded FIFO log record queueing strategy. </purpose><description><para>The <computeroutput><classname alt="boost::log::sinks::bounded_fifo_queue">bounded_fifo_queue</classname></computeroutput> class is intended to be used with the <computeroutput><classname alt="boost::log::sinks::asynchronous_sink">asynchronous_sink</classname></computeroutput> frontend as a log record queueing strategy.</para><para>This strategy describes log record queueing logic. The queue has a limited capacity, upon reaching which the enqueue operation will invoke the overflow handling strategy specified in the <computeroutput>OverflowStrategyT</computeroutput> template parameter to handle the situation. The library provides overflow handling strategies for most common cases: <computeroutput><classname alt="boost::log::sinks::drop_on_overflow">drop_on_overflow</classname></computeroutput> will silently discard the log record, and <computeroutput><classname alt="boost::log::sinks::block_on_overflow">block_on_overflow</classname></computeroutput> will put the enqueueing thread to wait until there is space in the queue.</para><para>The log record queue imposes no ordering over the queued elements aside from the order in which they are enqueued. </para></description><method-group name="protected member functions">
  253. <method name="enqueue"><type>void</type><parameter name="rec"><paramtype>record_view const &amp;</paramtype></parameter><purpose>Enqueues log record to the queue. </purpose></method>
  254. <method name="try_enqueue"><type>bool</type><parameter name="rec"><paramtype>record_view const &amp;</paramtype></parameter><purpose>Attempts to enqueue log record to the queue. </purpose></method>
  255. <method name="try_dequeue_ready"><type>bool</type><parameter name="rec"><paramtype>record_view &amp;</paramtype></parameter><purpose>Attempts to dequeue a log record ready for processing from the queue, does not block if the queue is empty. </purpose></method>
  256. <method name="try_dequeue"><type>bool</type><parameter name="rec"><paramtype>record_view &amp;</paramtype></parameter><purpose>Attempts to dequeue log record from the queue, does not block if the queue is empty. </purpose></method>
  257. <method name="dequeue_ready"><type>bool</type><parameter name="rec"><paramtype>record_view &amp;</paramtype></parameter><purpose>Dequeues log record from the queue, blocks if the queue is empty. </purpose></method>
  258. <method name="interrupt_dequeue"><type>void</type><purpose>Wakes a thread possibly blocked in the <computeroutput>dequeue</computeroutput> method. </purpose></method>
  259. </method-group>
  260. <constructor><purpose>Default constructor. </purpose></constructor>
  261. <constructor specifiers="explicit"><template>
  262. <template-type-parameter name="ArgsT"/>
  263. </template><parameter name=""><paramtype>ArgsT const &amp;</paramtype></parameter><purpose>Initializing constructor. </purpose></constructor>
  264. </class></namespace>
  265. </namespace>
  266. </namespace>
  267. </header>
  268. <header name="boost/log/sinks/bounded_ordering_queue.hpp">
  269. <para><para>Andrey Semashev </para>
  270. <para>06.01.2012</para>
  271. The header contains implementation of bounded ordering queueing strategy for the asynchronous sink frontend. </para><namespace name="boost">
  272. <namespace name="log">
  273. <namespace name="sinks">
  274. <class name="bounded_ordering_queue"><template>
  275. <template-type-parameter name="OrderT"/>
  276. <template-nontype-parameter name="MaxQueueSizeV"><type>std::size_t</type></template-nontype-parameter>
  277. <template-type-parameter name="OverflowStrategyT"/>
  278. </template><inherit access="private">OverflowStrategyT</inherit><purpose>Bounded ordering log record queueing strategy. </purpose><description><para>The <computeroutput><classname alt="boost::log::sinks::bounded_ordering_queue">bounded_ordering_queue</classname></computeroutput> class is intended to be used with the <computeroutput><classname alt="boost::log::sinks::asynchronous_sink">asynchronous_sink</classname></computeroutput> frontend as a log record queueing strategy.</para><para>This strategy provides the following properties to the record queueing mechanism:</para><para><itemizedlist>
  279. <listitem><para>The queue has limited capacity specified by the <computeroutput>MaxQueueSizeV</computeroutput> template parameter. </para>
  280. </listitem>
  281. <listitem><para>Upon reaching the size limit, the queue invokes the overflow handling strategy specified in the <computeroutput>OverflowStrategyT</computeroutput> template parameter to handle the situation. The library provides overflow handling strategies for most common cases: <computeroutput><classname alt="boost::log::sinks::drop_on_overflow">drop_on_overflow</classname></computeroutput> will silently discard the log record, and <computeroutput><classname alt="boost::log::sinks::block_on_overflow">block_on_overflow</classname></computeroutput> will put the enqueueing thread to wait until there is space in the queue. </para>
  282. </listitem>
  283. <listitem><para>The queue has a fixed latency window. This means that each log record put into the queue will normally not be dequeued for a certain period of time. </para>
  284. </listitem>
  285. <listitem><para>The queue performs stable record ordering within the latency window. The ordering predicate can be specified in the <computeroutput>OrderT</computeroutput> template parameter. </para>
  286. </listitem>
  287. </itemizedlist>
  288. </para></description><method-group name="public member functions">
  289. <method name="get_ordering_window" cv="const"><type>posix_time::time_duration</type><description><para>Returns ordering window size specified during initialization </para></description></method>
  290. </method-group>
  291. <method-group name="public static functions">
  292. <method name="get_default_ordering_window" specifiers="static"><type>posix_time::time_duration</type><description><para>Returns default ordering window size. The default window size is specific to the operating system thread scheduling mechanism. </para></description></method>
  293. </method-group>
  294. <method-group name="protected member functions">
  295. <method name="enqueue"><type>void</type><parameter name="rec"><paramtype>record_view const &amp;</paramtype></parameter><purpose>Enqueues log record to the queue. </purpose></method>
  296. <method name="try_enqueue"><type>bool</type><parameter name="rec"><paramtype>record_view const &amp;</paramtype></parameter><purpose>Attempts to enqueue log record to the queue. </purpose></method>
  297. <method name="try_dequeue_ready"><type>bool</type><parameter name="rec"><paramtype>record_view &amp;</paramtype></parameter><purpose>Attempts to dequeue a log record ready for processing from the queue, does not block if the queue is empty. </purpose></method>
  298. <method name="try_dequeue"><type>bool</type><parameter name="rec"><paramtype>record_view &amp;</paramtype></parameter><purpose>Attempts to dequeue log record from the queue, does not block if the queue is empty. </purpose></method>
  299. <method name="dequeue_ready"><type>bool</type><parameter name="rec"><paramtype>record_view &amp;</paramtype></parameter><purpose>Dequeues log record from the queue, blocks if the queue is empty. </purpose></method>
  300. <method name="interrupt_dequeue"><type>void</type><purpose>Wakes a thread possibly blocked in the <computeroutput>dequeue</computeroutput> method. </purpose></method>
  301. </method-group>
  302. <constructor specifiers="explicit"><template>
  303. <template-type-parameter name="ArgsT"/>
  304. </template><parameter name="args"><paramtype>ArgsT const &amp;</paramtype></parameter><purpose>Initializing constructor. </purpose></constructor>
  305. </class></namespace>
  306. </namespace>
  307. </namespace>
  308. </header>
  309. <header name="boost/log/sinks/debug_output_backend.hpp">
  310. <para><para>Andrey Semashev </para>
  311. <para>07.11.2008</para>
  312. The header contains a logging sink backend that outputs log records to the debugger. </para><namespace name="boost">
  313. <namespace name="log">
  314. <namespace name="sinks">
  315. <class name="basic_debug_output_backend"><template>
  316. <template-type-parameter name="CharT"/>
  317. </template><inherit access="public">basic_formatted_sink_backend&lt; CharT, concurrent_feeding &gt;</inherit><purpose>An implementation of a logging sink backend that outputs to the debugger. </purpose><description><para>The sink uses Windows API in order to write log records as debug messages, if the application process is run under debugger. The sink backend also provides a specific filter that allows to check whether the debugger is available and thus elide unnecessary formatting. </para></description><typedef name="char_type"><purpose>Character type. </purpose><type>base_type::char_type</type></typedef>
  318. <typedef name="string_type"><purpose>String type to be used as a message text holder. </purpose><type>base_type::string_type</type></typedef>
  319. <method-group name="public member functions">
  320. <method name="consume"><type>void</type><parameter name="rec"><paramtype>record_view const &amp;</paramtype></parameter><parameter name="formatted_message"><paramtype>string_type const &amp;</paramtype></parameter><description><para>The method passes the formatted message to debugger </para></description></method>
  321. </method-group>
  322. <constructor><description><para>Constructor. Initializes the sink backend. </para></description></constructor>
  323. <destructor><description><para>Destructor </para></description></destructor>
  324. </class><typedef name="debug_output_backend"><purpose>Convenience typedef for narrow-character logging. </purpose><type><classname>basic_debug_output_backend</classname>&lt; char &gt;</type></typedef>
  325. <typedef name="wdebug_output_backend"><purpose>Convenience typedef for wide-character logging. </purpose><type><classname>basic_debug_output_backend</classname>&lt; wchar_t &gt;</type></typedef>
  326. </namespace>
  327. </namespace>
  328. </namespace>
  329. </header>
  330. <header name="boost/log/sinks/drop_on_overflow.hpp">
  331. <para><para>Andrey Semashev </para>
  332. <para>04.01.2012</para>
  333. The header contains implementation of <computeroutput>drop_on_overflow</computeroutput> strategy for handling queue overflows in bounded queues for the asynchronous sink frontend. </para><namespace name="boost">
  334. <namespace name="log">
  335. <namespace name="sinks">
  336. <class name="drop_on_overflow"><purpose>Log record dropping strategy. </purpose><description><para>This strategy will cause log records to be discarded in case of queue overflow in bounded asynchronous sinks. It should not be used if losing log records is not acceptable. </para></description></class></namespace>
  337. </namespace>
  338. </namespace>
  339. </header>
  340. <header name="boost/log/sinks/event_log_backend.hpp">
  341. <para><para>Andrey Semashev </para>
  342. <para>07.11.2008</para>
  343. The header contains a logging sink backend that uses Windows NT event log API for signaling application events. </para><namespace name="boost">
  344. <namespace name="log">
  345. <namespace name="sinks">
  346. <class name="basic_event_log_backend"><template>
  347. <template-type-parameter name="CharT"/>
  348. </template><inherit access="public">basic_sink_backend&lt; synchronized_feeding &gt;</inherit><purpose>An implementation of a logging sink backend that emits events into Windows NT event log. </purpose><description><para>The sink uses Windows NT 5 (Windows 2000) and later event log API to emit events to an event log. The sink acts as an event source. Unlike <computeroutput><classname alt="boost::log::sinks::basic_simple_event_log_backend">basic_simple_event_log_backend</classname></computeroutput>, this sink backend allows users to specify the custom event message file and supports mapping attribute values onto several insertion strings. Although it requires considerably more scaffolding than the simple backend, this allows to support localizable event descriptions.</para><para>Besides the file name of the module with event resources, the backend provides the following customizations: <itemizedlist>
  349. <listitem><para>Remote server UNC address, log name and source name. These parameters have similar meaning to <computeroutput><classname alt="boost::log::sinks::basic_simple_event_log_backend">basic_simple_event_log_backend</classname></computeroutput>. </para>
  350. </listitem>
  351. <listitem><para>Event type and category mappings. These are function object that allow to map attribute values to the according event parameters. One can use mappings in the <computeroutput>event_log</computeroutput> namespace. </para>
  352. </listitem>
  353. <listitem><para>Event composer. This function object extracts event identifier and formats string insertions, that will be used by the API to compose the final event message text. </para>
  354. </listitem>
  355. </itemizedlist>
  356. </para></description><typedef name="char_type"><purpose>Character type. </purpose><type>CharT</type></typedef>
  357. <typedef name="string_type"><purpose>String type. </purpose><type>std::basic_string&lt; char_type &gt;</type></typedef>
  358. <typedef name="insertion_list"><purpose>Type of the composed insertions list. </purpose><type>std::vector&lt; string_type &gt;</type></typedef>
  359. <typedef name="event_type_mapper_type"><purpose>Mapper type for the event type. </purpose><type><emphasis>unspecified</emphasis></type></typedef>
  360. <typedef name="event_category_mapper_type"><purpose>Mapper type for the event category. </purpose><type><emphasis>unspecified</emphasis></type></typedef>
  361. <typedef name="event_composer_type"><purpose>Event composer type. </purpose><type><emphasis>unspecified</emphasis></type></typedef>
  362. <method-group name="public member functions">
  363. <method name="consume"><type>void</type><parameter name="rec"><paramtype>record_view const &amp;</paramtype><description><para>Log record to consume </para></description></parameter><description><para>The method creates an event in the event log</para><para>
  364. </para></description></method>
  365. <method name="set_event_type_mapper"><type>void</type><parameter name="mapper"><paramtype>event_type_mapper_type const &amp;</paramtype></parameter><description><para>The method installs the function object that maps application severity levels to WinAPI event types </para></description></method>
  366. <method name="set_event_category_mapper"><type>void</type><parameter name="mapper"><paramtype>event_category_mapper_type const &amp;</paramtype></parameter><description><para>The method installs the function object that extracts event category from attribute values </para></description></method>
  367. <method name="set_event_composer"><type>void</type><parameter name="composer"><paramtype>event_composer_type const &amp;</paramtype></parameter><description><para>The method installs the function object that extracts event identifier from the attributes and creates insertion strings that will replace placeholders in the event message. </para></description></method>
  368. </method-group>
  369. <constructor specifiers="explicit"><template>
  370. <template-type-parameter name="T"/>
  371. </template><parameter name="message_file_name"><paramtype>std::basic_string&lt; T &gt; const &amp;</paramtype></parameter><description><para>Constructor. Registers event source with name based on the application executable file name in the Application log. If such a registration is already present, it is not overridden. </para></description></constructor>
  372. <constructor specifiers="explicit"><parameter name="message_file_name"><paramtype>filesystem::path const &amp;</paramtype></parameter><description><para>Constructor. Registers event source with name based on the application executable file name in the Application log. If such a registration is already present, it is not overridden. </para></description></constructor>
  373. <constructor specifiers="explicit"><template>
  374. <template-nontype-parameter name="ArgsT"><type>typename...</type></template-nontype-parameter>
  375. </template><parameter name="args"><paramtype>ArgsT... const &amp;</paramtype><description><para>A set of named parameters. </para></description></parameter><description><para>Constructor. Registers event log source with the specified parameters. The following named parameters are supported:</para><para><itemizedlist>
  376. <listitem><para><computeroutput>message_file</computeroutput> - Specifies the file name that contains resources that describe events and categories. This parameter is mandatory unless <computeroutput>registration</computeroutput> is <computeroutput>never</computeroutput>. </para>
  377. </listitem>
  378. <listitem><para><computeroutput>target</computeroutput> - Specifies an UNC path to the remote server to which log records should be sent to. The local machine will be used to process log records, if not specified. </para>
  379. </listitem>
  380. <listitem><para><computeroutput>log_name</computeroutput> - Specifies the log in which the source should be registered. The result of <computeroutput>get_default_log_name</computeroutput> is used, if the parameter is not specified. </para>
  381. </listitem>
  382. <listitem><para><computeroutput>log_source</computeroutput> - Specifies the source name. The result of <computeroutput>get_default_source_name</computeroutput> is used, if the parameter is not specified. </para>
  383. </listitem>
  384. <listitem><para><computeroutput>registration</computeroutput> - Specifies the event source registration mode in the Windows registry. Can have values of the <computeroutput>registration_mode</computeroutput> enum. Default value: <computeroutput>on_demand</computeroutput>.</para>
  385. </listitem>
  386. </itemizedlist>
  387. </para></description></constructor>
  388. <destructor><description><para>Destructor. Unregisters event source. The log source description is not removed from the Windows registry. </para></description></destructor>
  389. <method-group name="public static functions">
  390. <method name="get_default_log_name" specifiers="static"><type>string_type</type><description><para>
  391. </para></description><returns><para>Default log name: Application </para>
  392. </returns></method>
  393. <method name="get_default_source_name" specifiers="static"><type>string_type</type><description><para>
  394. </para></description><returns><para>Default log source name that is based on the application executable file name and the sink name </para>
  395. </returns></method>
  396. </method-group>
  397. </class><class name="basic_simple_event_log_backend"><template>
  398. <template-type-parameter name="CharT"/>
  399. </template><inherit access="public">basic_formatted_sink_backend&lt; CharT, concurrent_feeding &gt;</inherit><purpose>An implementation of a simple logging sink backend that emits events into Windows NT event log. </purpose><description><para>The sink uses Windows NT 5 (Windows 2000) and later event log API to emit events to an event log. The sink acts as an event source in terms of the API, it implements all needed resources and source registration in the Windows registry that is needed for the event delivery.</para><para>The backend performs message text formatting. The composed text is then passed as the first and only string parameter of the event. The resource embedded into the backend describes the event so that the parameter is inserted into the event description text, thus making it visible in the event log.</para><para>The backend allows to customize mapping of application severity levels to the native Windows event types. This allows to write portable code even if OS-specific sinks, such as this one, are used.</para><para><note><para>Since the backend registers itself into Windows registry as the resource file that contains event description, it is important to keep the library binary in a stable place of the filesystem. Otherwise Windows might not be able to load event resources from the library and display events correctly.</para>
  400. </note>
  401. <note><para>It is known that Windows is not able to find event resources in the application executable, which is linked against the static build of the library. Users are advised to use dynamic builds of the library to solve this problem. </para>
  402. </note>
  403. </para></description><typedef name="char_type"><purpose>Character type. </purpose><type>base_type::char_type</type></typedef>
  404. <typedef name="string_type"><purpose>String type to be used as a message text holder. </purpose><type>base_type::string_type</type></typedef>
  405. <typedef name="event_type_mapper_type"><purpose>Mapper type for the event type. </purpose><type><emphasis>unspecified</emphasis></type></typedef>
  406. <method-group name="public member functions">
  407. <method name="set_event_type_mapper"><type>void</type><parameter name="mapper"><paramtype>event_type_mapper_type const &amp;</paramtype></parameter><description><para>The method installs the function object that maps application severity levels to WinAPI event types </para></description></method>
  408. <method name="consume"><type>void</type><parameter name="rec"><paramtype>record_view const &amp;</paramtype></parameter><parameter name="formatted_message"><paramtype>string_type const &amp;</paramtype></parameter><description><para>The method puts the formatted message to the event log </para></description></method>
  409. </method-group>
  410. <constructor><description><para>Default constructor. Registers event source with name based on the application executable file name in the Application log. If such a registration is already present, it is not overridden. </para></description></constructor>
  411. <constructor specifiers="explicit"><template>
  412. <template-nontype-parameter name="ArgsT"><type>typename...</type></template-nontype-parameter>
  413. </template><parameter name="args"><paramtype>ArgsT... const &amp;</paramtype><description><para>A set of named parameters. </para></description></parameter><description><para>Constructor. Registers event log source with the specified parameters. The following named parameters are supported:</para><para><itemizedlist>
  414. <listitem><para><computeroutput>target</computeroutput> - Specifies an UNC path to the remote server which log records should be sent to. The local machine will be used to process log records, if not specified. </para>
  415. </listitem>
  416. <listitem><para><computeroutput>log_name</computeroutput> - Specifies the log in which the source should be registered. The result of <computeroutput>get_default_log_name</computeroutput> is used, if the parameter is not specified. </para>
  417. </listitem>
  418. <listitem><para><computeroutput>log_source</computeroutput> - Specifies the source name. The result of <computeroutput>get_default_source_name</computeroutput> is used, if the parameter is not specified. </para>
  419. </listitem>
  420. <listitem><para><computeroutput>registration</computeroutput> - Specifies the event source registration mode in the Windows registry. Can have values of the <computeroutput>registration_mode</computeroutput> enum. Default value: <computeroutput>on_demand</computeroutput>.</para>
  421. </listitem>
  422. </itemizedlist>
  423. </para></description></constructor>
  424. <destructor><description><para>Destructor. Unregisters event source. The log source description is not removed from the Windows registry. </para></description></destructor>
  425. <method-group name="public static functions">
  426. <method name="get_default_log_name" specifiers="static"><type>string_type</type><description><para>
  427. </para></description><returns><para>Default log name: Application </para>
  428. </returns></method>
  429. <method name="get_default_source_name" specifiers="static"><type>string_type</type><description><para>
  430. </para></description><returns><para>Default log source name that is based on the application executable file name and the sink name </para>
  431. </returns></method>
  432. </method-group>
  433. </class><namespace name="event_log">
  434. <class name="basic_event_composer"><template>
  435. <template-type-parameter name="CharT"/>
  436. </template><purpose>An event composer. </purpose><description><para>This class is a function object that extracts event identifier from the attribute values set and formats insertion strings for the particular event. Each insertion string is formatted with a distinct formatter, which can be created just like regular sinks formatters.</para><para>Before using, the composer must be initialized with the following information: <itemizedlist>
  437. <listitem><para>Event identifier extraction logic. One can use <computeroutput>basic_direct_event_id_mapping</computeroutput> or <computeroutput>basic_custom_event_id_mapping</computeroutput> classes in order to create such extractor and pass it to the composer constructor. </para>
  438. </listitem>
  439. <listitem><para>Event identifiers and insertion string formatters. The composer provides the following syntax to provide this information:</para>
  440. </listitem>
  441. </itemizedlist>
  442. <programlisting language="c++">event_composer comp;
  443. comp[MY_EVENT_ID1] % formatter1 % ... % formatterN;
  444. comp[MY_EVENT_ID2] % formatter1 % ... % formatterN;
  445. ...
  446. </programlisting></para><para>The event identifiers in square brackets are provided by the message compiler generated header (the actual names are specified in the .mc file). The formatters represent the insertion strings that will be used to replace placeholders in event messages, thus the number and the order of the formatters must correspond to the message definition. </para></description><typedef name="char_type"><purpose>Character type. </purpose><type>CharT</type></typedef>
  447. <typedef name="string_type"><purpose>String type to be used as a message text holder. </purpose><type>std::basic_string&lt; char_type &gt;</type></typedef>
  448. <typedef name="event_id_mapper_type"><purpose>Event identifier mapper type. </purpose><type><emphasis>unspecified</emphasis></type></typedef>
  449. <typedef name="formatter_type"><purpose>Type of an insertion composer (a formatter) </purpose><type>basic_formatter&lt; char_type &gt;</type></typedef>
  450. <typedef name="insertion_list"><purpose>Type of the composed insertions list. </purpose><type>std::vector&lt; string_type &gt;</type></typedef>
  451. <method-group name="public member functions">
  452. <method name="swap"><type>void</type><parameter name="that"><paramtype><classname>basic_event_composer</classname> &amp;</paramtype></parameter><description><para>Swaps <computeroutput>*this</computeroutput> and <computeroutput>that</computeroutput> objects. </para></description></method>
  453. <method name="operator[]"><type>event_map_reference</type><parameter name="id"><paramtype>event_id</paramtype><description><para>Event identifier. </para></description></parameter><description><para>Initiates creation of a new event description. The result of the operator can be used to add formatters for insertion strings construction. The returned reference type is implementation detail.</para><para>
  454. </para></description></method>
  455. <method name="operator[]"><type>event_map_reference</type><parameter name="id"><paramtype>int</paramtype><description><para>Event identifier. </para></description></parameter><description><para>Initiates creation of a new event description. The result of the operator can be used to add formatters for insertion strings construction. The returned reference type is implementation detail.</para><para>
  456. </para></description></method>
  457. <method name="operator()" cv="const"><type>event_id</type><parameter name="rec"><paramtype>record_view const &amp;</paramtype><description><para>Log record view </para></description></parameter><parameter name="insertions"><paramtype>insertion_list &amp;</paramtype><description><para>A sequence of formatted insertion strings </para></description></parameter><description><para>Event composition operator. Extracts an event identifier from the attribute values by calling event ID mapper. Then runs all formatters that were registered for the event with the extracted ID. The results of formatting are returned in the <emphasis>insertions</emphasis> parameter.</para><para>
  458. </para></description><returns><para>An event identifier that was extracted from <computeroutput>attributes</computeroutput> </para>
  459. </returns></method>
  460. </method-group>
  461. <constructor specifiers="explicit"><parameter name="id_mapper"><paramtype>event_id_mapper_type const &amp;</paramtype><description><para>An event identifier mapping function that will be used to extract event ID from attribute values </para></description></parameter><description><para>Default constructor. Creates an empty map of events.</para><para>
  462. </para></description></constructor>
  463. <constructor><parameter name="that"><paramtype><classname>basic_event_composer</classname> const &amp;</paramtype></parameter><description><para>Copy constructor. Performs a deep copy of the object. </para></description></constructor>
  464. <destructor><description><para>Destructor </para></description></destructor>
  465. <copy-assignment><type><classname>basic_event_composer</classname> &amp;</type><parameter name="that"><paramtype><classname>basic_event_composer</classname></paramtype></parameter><description><para>Assignment. Provides strong exception guarantee. </para></description></copy-assignment>
  466. </class><class name="custom_event_category_mapping"><template>
  467. <template-type-parameter name="AttributeValueT"><default>int</default></template-type-parameter>
  468. </template><inherit access="public">basic_custom_mapping&lt; event_category, AttributeValueT &gt;</inherit><purpose>Customizable event category mapping. </purpose><description><para>The class allows to setup a custom mapping between an attribute and event categories. The mapping should be initialized similarly to the standard <computeroutput>map</computeroutput> container, by using indexing operator and assignment. </para></description><method-group name="public member functions">
  469. </method-group>
  470. <constructor specifiers="explicit"><parameter name="name"><paramtype>attribute_name const &amp;</paramtype><description><para>Attribute name </para></description></parameter><description><para>Constructor</para><para>
  471. </para></description></constructor>
  472. </class><class name="custom_event_id_mapping"><template>
  473. <template-type-parameter name="AttributeValueT"><default>int</default></template-type-parameter>
  474. </template><inherit access="public">basic_custom_mapping&lt; event_id, AttributeValueT &gt;</inherit><purpose>Customizable event ID mapping. </purpose><description><para>The class allows to setup a custom mapping between an attribute and event identifiers. The mapping should be initialized similarly to the standard <computeroutput>map</computeroutput> container, by using indexing operator and assignment. </para></description><method-group name="public member functions">
  475. </method-group>
  476. <constructor specifiers="explicit"><parameter name="name"><paramtype>attribute_name const &amp;</paramtype><description><para>Attribute name </para></description></parameter><description><para>Constructor</para><para>
  477. </para></description></constructor>
  478. </class><class name="custom_event_type_mapping"><template>
  479. <template-type-parameter name="AttributeValueT"><default>int</default></template-type-parameter>
  480. </template><inherit access="public">basic_custom_mapping&lt; event_type, AttributeValueT &gt;</inherit><purpose>Customizable event type mapping. </purpose><description><para>The class allows to setup a custom mapping between an attribute and native event types. The mapping should be initialized similarly to the standard <computeroutput>map</computeroutput> container, by using indexing operator and assignment. </para></description><method-group name="public member functions">
  481. </method-group>
  482. <constructor specifiers="explicit"><parameter name="name"><paramtype>attribute_name const &amp;</paramtype><description><para>Attribute name </para></description></parameter><description><para>Constructor</para><para>
  483. </para></description></constructor>
  484. </class><class name="direct_event_category_mapping"><template>
  485. <template-type-parameter name="AttributeValueT"><default>int</default></template-type-parameter>
  486. </template><inherit access="public">basic_direct_mapping&lt; event_category, AttributeValueT &gt;</inherit><purpose>Straightforward event category mapping. </purpose><description><para>This type of mapping assumes that attribute with a particular name always provides values that map directly onto the event categories. The mapping simply returns the extracted attribute value converted to the event category. </para></description><method-group name="public member functions">
  487. </method-group>
  488. <constructor specifiers="explicit"><parameter name="name"><paramtype>attribute_name const &amp;</paramtype><description><para>Attribute name </para></description></parameter><description><para>Constructor</para><para>
  489. </para></description></constructor>
  490. </class><class name="direct_event_id_mapping"><template>
  491. <template-type-parameter name="AttributeValueT"><default>int</default></template-type-parameter>
  492. </template><inherit access="public">basic_direct_mapping&lt; event_id, AttributeValueT &gt;</inherit><purpose>Straightforward event ID mapping. </purpose><description><para>This type of mapping assumes that attribute with a particular name always provides values that map directly onto the event identifiers. The mapping simply returns the extracted attribute value converted to the event ID. </para></description><method-group name="public member functions">
  493. </method-group>
  494. <constructor specifiers="explicit"><parameter name="name"><paramtype>attribute_name const &amp;</paramtype><description><para>Attribute name </para></description></parameter><description><para>Constructor</para><para>
  495. </para></description></constructor>
  496. </class><class name="direct_event_type_mapping"><template>
  497. <template-type-parameter name="AttributeValueT"><default>int</default></template-type-parameter>
  498. </template><inherit access="public">basic_direct_mapping&lt; event_type, AttributeValueT &gt;</inherit><purpose>Straightforward event type mapping. </purpose><description><para>This type of mapping assumes that attribute with a particular name always provides values that map directly onto the native event types. The mapping simply returns the extracted attribute value converted to the native event type. </para></description><method-group name="public member functions">
  499. </method-group>
  500. <constructor specifiers="explicit"><parameter name="name"><paramtype>attribute_name const &amp;</paramtype><description><para>Attribute name </para></description></parameter><description><para>Constructor</para><para>
  501. </para></description></constructor>
  502. </class><enum name="registration_mode"><enumvalue name="never"><purpose>Never register event source, even if it's not registered. </purpose></enumvalue><enumvalue name="on_demand"><purpose>Register if the source is not registered yet. </purpose></enumvalue><enumvalue name="forced"><purpose>Register always, event if the source is already registered. </purpose></enumvalue><purpose>Event log source registration modes. </purpose></enum>
  503. <typedef name="event_composer"><purpose>Convenience typedef for narrow-character logging. </purpose><type><classname>basic_event_composer</classname>&lt; char &gt;</type></typedef>
  504. <typedef name="wevent_composer"><purpose>Convenience typedef for wide-character logging. </purpose><type><classname>basic_event_composer</classname>&lt; wchar_t &gt;</type></typedef>
  505. </namespace>
  506. <typedef name="simple_event_log_backend"><purpose>Convenience typedef for narrow-character logging. </purpose><type><classname>basic_simple_event_log_backend</classname>&lt; char &gt;</type></typedef>
  507. <typedef name="event_log_backend"><purpose>Convenience typedef for narrow-character logging. </purpose><type><classname>basic_event_log_backend</classname>&lt; char &gt;</type></typedef>
  508. <typedef name="wsimple_event_log_backend"><purpose>Convenience typedef for wide-character logging. </purpose><type><classname>basic_simple_event_log_backend</classname>&lt; wchar_t &gt;</type></typedef>
  509. <typedef name="wevent_log_backend"><purpose>Convenience typedef for wide-character logging. </purpose><type><classname>basic_event_log_backend</classname>&lt; wchar_t &gt;</type></typedef>
  510. </namespace>
  511. </namespace>
  512. </namespace>
  513. </header>
  514. <header name="boost/log/sinks/event_log_constants.hpp">
  515. <para><para>Andrey Semashev </para>
  516. <para>07.11.2008</para>
  517. The header contains definition of constants related to Windows NT Event Log API. The constants can be used in other places without the event log backend. </para><namespace name="boost">
  518. <namespace name="log">
  519. <namespace name="sinks">
  520. <namespace name="event_log">
  521. <enum name="event_type"><enumvalue name="success"><default>= 0</default><purpose>Equivalent to EVENTLOG_SUCCESS. </purpose></enumvalue><enumvalue name="info"><default>= 4</default><purpose>Equivalent to EVENTLOG_INFORMATION_TYPE. </purpose></enumvalue><enumvalue name="warning"><default>= 2</default><purpose>Equivalent to EVENTLOG_WARNING_TYPE. </purpose></enumvalue><enumvalue name="error"><default>= 1</default><purpose>Equivalent to EVENTLOG_ERROR_TYPE. </purpose></enumvalue><purpose>Windows event types. </purpose></enum>
  522. <typedef name="event_id"><purpose>A tagged integral type that represents event identifier for the Windows API. </purpose><type><emphasis>unspecified</emphasis></type></typedef>
  523. <typedef name="event_category"><purpose>A tagged integral type that represents event category for the Windows API. </purpose><type><emphasis>unspecified</emphasis></type></typedef>
  524. <function name="make_event_id"><type>event_id</type><parameter name="id"><paramtype>unsigned int</paramtype></parameter><description><para>The function constructs event identifier from an integer </para></description></function>
  525. <function name="make_event_category"><type>event_category</type><parameter name="cat"><paramtype>unsigned short</paramtype></parameter><description><para>The function constructs event category from an integer </para></description></function>
  526. <function name="make_event_type"><type>event_type</type><parameter name="lev"><paramtype>unsigned short</paramtype></parameter><description><para>The function constructs log record level from an integer </para></description></function>
  527. </namespace>
  528. </namespace>
  529. </namespace>
  530. </namespace>
  531. </header>
  532. <header name="boost/log/sinks/frontend_requirements.hpp">
  533. <para><para>Andrey Semashev </para>
  534. <para>22.04.2007</para>
  535. The header contains definition of requirement tags that sink backend may declare with regard to frontends. These requirements ensure that a backend will not be used with an incompatible frontend. </para><namespace name="boost">
  536. <namespace name="log">
  537. <namespace name="sinks">
  538. <struct name="combine_requirements"><template>
  539. <template-nontype-parameter name="RequirementsT"><type>typename...</type></template-nontype-parameter>
  540. </template><description><para>The metafunction combines multiple requirement tags into one type. The resulting type will satisfy all specified requirements (i.e. <computeroutput><classname alt="boost::log::sinks::has_requirement">has_requirement</classname></computeroutput> metafunction will return positive result). </para></description></struct><struct name="concurrent_feeding"><inherit access="public">synchronized_feeding</inherit><description><para>The sink backend ensures all needed synchronization, it is capable to handle multithreaded calls </para></description></struct><struct name="flushing"><description><para>The sink backend supports flushing </para></description></struct><struct name="formatted_records"><description><para>The sink backend requires the frontend to perform log record formatting before feeding </para></description></struct><struct name="has_requirement"><template>
  541. <template-type-parameter name="TestedT"/>
  542. <template-type-parameter name="RequiredT"/>
  543. </template><inherit access="public">is_base_of&lt; RequiredT, TestedT &gt;</inherit><description><para>A helper metafunction to check if a requirement is satisfied. The <computeroutput>TestedT</computeroutput> template argument should be the type combining one or several requirements and <computeroutput>RequiredT</computeroutput> is the requirement to test against. The metafunction will yield a positive result if <computeroutput>TestedT</computeroutput> supports <computeroutput>RequiredT</computeroutput>. </para></description></struct><struct name="synchronized_feeding"><description><para>The sink backend expects pre-synchronized calls, all needed synchronization is implemented in the frontend (IOW, only one thread is feeding records to the backend concurrently, but it is possible for several threads to write sequentially). Note that if a frontend supports synchronized record feeding, it will also report capable of concurrent record feeding. </para></description></struct></namespace>
  544. </namespace>
  545. </namespace>
  546. <macro name="BOOST_LOG_COMBINE_REQUIREMENTS_LIMIT"><purpose>The macro specifies the maximum number of requirements that can be combined with the <computeroutput>combine_requirements</computeroutput> metafunction. </purpose></macro>
  547. </header>
  548. <header name="boost/log/sinks/sink.hpp">
  549. <para><para>Andrey Semashev </para>
  550. <para>22.04.2007</para>
  551. The header contains an interface declaration for all sinks. This interface is used by the logging core to feed log records to sinks. </para><namespace name="boost">
  552. <namespace name="log">
  553. <namespace name="sinks">
  554. <class name="sink"><purpose>A base class for a logging sink frontend. </purpose><typedef name="exception_handler_type"><purpose>An exception handler type. </purpose><type><emphasis>unspecified</emphasis></type></typedef>
  555. <method-group name="public member functions">
  556. <method name="will_consume" cv="= 0" specifiers="virtual"><type>bool</type><parameter name="attributes"><paramtype>attribute_value_set const &amp;</paramtype><description><para>A set of attribute values of a logging record </para></description></parameter><description><para>The method returns <computeroutput>true</computeroutput> if no filter is set or the attribute values pass the filter</para><para>
  557. </para></description></method>
  558. <method name="consume" cv="= 0" specifiers="virtual"><type>void</type><parameter name="rec"><paramtype>record_view const &amp;</paramtype><description><para>Logging record to consume </para></description></parameter><description><para>The method puts logging record to the sink</para><para>
  559. </para></description></method>
  560. <method name="try_consume" specifiers="virtual"><type>bool</type><parameter name="rec"><paramtype>record_view const &amp;</paramtype><description><para>Logging record to consume </para></description></parameter><description><para>The method attempts to put logging record to the sink. The method may be used by the core in order to determine the most efficient order of sinks to feed records to in case of heavy contention. Sink implementations may implement try/backoff logic in order to improve overall logging throughput.</para><para>
  561. </para></description><returns><para><computeroutput>true</computeroutput>, if the record was consumed, <computeroutput>false</computeroutput>, if not. </para>
  562. </returns></method>
  563. <method name="flush" cv="= 0" specifiers="virtual"><type>void</type><description><para>The method performs flushing of any internal buffers that may hold log records. The method may take considerable time to complete and may block both the calling thread and threads attempting to put new records into the sink while this call is in progress. </para></description></method>
  564. <method name="is_cross_thread" cv="const noexcept"><type>bool</type><description><para>The method indicates that the sink passes log records between different threads. This information is needed by the logging core to detach log records from all thread-specific resources before passing it to the sink. </para></description></method>
  565. </method-group>
  566. <constructor specifiers="explicit"><parameter name="cross_thread"><paramtype>bool</paramtype></parameter><description><para>Default constructor </para></description></constructor>
  567. <destructor><description><para>Virtual destructor </para></description></destructor>
  568. <constructor cv="= delete"><parameter name=""><paramtype><classname>sink</classname> const &amp;</paramtype></parameter></constructor>
  569. <copy-assignment cv="= delete"><type><classname>sink</classname> &amp;</type><parameter name=""><paramtype><classname>sink</classname> const &amp;</paramtype></parameter></copy-assignment>
  570. </class></namespace>
  571. </namespace>
  572. </namespace>
  573. </header>
  574. <header name="boost/log/sinks/sync_frontend.hpp">
  575. <para><para>Andrey Semashev </para>
  576. <para>14.07.2009</para>
  577. The header contains implementation of synchronous sink frontend. </para><namespace name="boost">
  578. <namespace name="log">
  579. <namespace name="sinks">
  580. <class name="synchronous_sink"><template>
  581. <template-type-parameter name="SinkBackendT"/>
  582. </template><inherit access="public">basic_sink_frontend</inherit><purpose>Synchronous logging sink frontend. </purpose><description><para>The sink frontend serializes threads before passing logging records to the backend </para></description><typedef name="sink_backend_type"><purpose>Sink implementation type. </purpose><type>SinkBackendT</type></typedef>
  583. <typedef name="locked_backend_ptr"><purpose>A pointer type that locks the backend until it's destroyed. </purpose><type>implementation_defined</type></typedef>
  584. <method-group name="public member functions">
  585. <method name="locked_backend"><type>locked_backend_ptr</type><description><para>Locking accessor to the attached backend </para></description></method>
  586. <method name="consume" specifiers="virtual"><type>void</type><parameter name="rec"><paramtype>record_view const &amp;</paramtype></parameter><description><para>Passes the log record to the backend </para></description></method>
  587. <method name="try_consume" specifiers="virtual"><type>bool</type><parameter name="rec"><paramtype>record_view const &amp;</paramtype></parameter><description><para>The method attempts to pass logging record to the backend </para></description></method>
  588. <method name="flush" specifiers="virtual"><type>void</type><description><para>The method performs flushing of any internal buffers that may hold log records. The method may take considerable time to complete and may block both the calling thread and threads attempting to put new records into the sink while this call is in progress. </para></description></method>
  589. </method-group>
  590. <constructor><description><para>Default constructor. Constructs the sink backend instance. Requires the backend to be default-constructible. </para></description></constructor>
  591. <constructor specifiers="explicit"><parameter name="backend"><paramtype>shared_ptr&lt; sink_backend_type &gt; const &amp;</paramtype><description><para>Pointer to the backend instance</para></description></parameter><description><para>Constructor attaches user-constructed backend instance</para><para>
  592. </para></description><requires><para><emphasis>backend</emphasis> is not <computeroutput>NULL</computeroutput>. </para>
  593. </requires></constructor>
  594. <constructor specifiers="explicit"><template>
  595. <template-nontype-parameter name="Args"><type>typename...</type></template-nontype-parameter>
  596. </template><parameter name="args"><paramtype>Args &amp;&amp;...</paramtype></parameter><description><para>Constructor that passes arbitrary named parameters to the interprocess sink backend constructor. Refer to the backend documentation for the list of supported parameters. </para></description></constructor>
  597. </class></namespace>
  598. </namespace>
  599. </namespace>
  600. </header>
  601. <header name="boost/log/sinks/syslog_backend.hpp">
  602. <para><para>Andrey Semashev </para>
  603. <para>08.01.2008</para>
  604. The header contains implementation of a Syslog sink backend along with its setup facilities. </para><namespace name="boost">
  605. <namespace name="log">
  606. <namespace name="sinks">
  607. <class name="syslog_backend"><inherit access="public">basic_formatted_sink_backend&lt; char &gt;</inherit><purpose>An implementation of a syslog sink backend. </purpose><description><para>The backend provides support for the syslog protocol, defined in RFC3164. The backend sends log records to a remote host via UDP. The host name can be specified by calling the <computeroutput>set_target_address</computeroutput> method. By default log records will be sent to localhost:514. The local address can be specified as well, by calling the <computeroutput>set_local_address</computeroutput> method. By default syslog packets will be sent from any local address available.</para><para>It is safe to create several sink backends with the same local addresses - the backends within the process will share the same socket. The same applies to different processes that use the syslog backends to send records from the same socket. However, it is not guaranteed to work if some third party facility is using the socket.</para><para>On systems with native syslog implementation it may be preferable to utilize the POSIX syslog API instead of direct socket management in order to bypass possible security limitations that may be in action. To do so one has to pass the <computeroutput>use_impl = native</computeroutput> to the backend constructor. Note, however, that in that case you will only have one chance to specify syslog facility and process identification string - on the first native syslog backend construction. Other native syslog backends will ignore these parameters. Obviously, the <computeroutput>set_local_address</computeroutput> and <computeroutput>set_target_address</computeroutput> methods have no effect for native backends. Using <computeroutput>use_impl = native</computeroutput> on platforms with no native support for POSIX syslog API will have no effect. </para></description><typedef name="char_type"><purpose>Character type. </purpose><type>base_type::char_type</type></typedef>
  608. <typedef name="string_type"><purpose>String type that is used to pass message test. </purpose><type>base_type::string_type</type></typedef>
  609. <typedef name="severity_mapper_type"><purpose>Syslog severity level mapper type. </purpose><type><emphasis>unspecified</emphasis></type></typedef>
  610. <method-group name="public member functions">
  611. <method name="set_severity_mapper"><type>void</type><parameter name="mapper"><paramtype>severity_mapper_type const &amp;</paramtype></parameter><description><para>The method installs the function object that maps application severity levels to syslog levels </para></description></method>
  612. <method name="set_local_address"><type>void</type><parameter name="addr"><paramtype>std::string const &amp;</paramtype><description><para>The local address </para></description></parameter><parameter name="port"><paramtype>unsigned short</paramtype><default>514</default><description><para>The local port number </para></description></parameter><description><para>The method sets the local host name which log records will be sent from. The host name is resolved to obtain the final IP address.</para><para><note><para>Does not have effect if the backend was constructed to use native syslog API</para>
  613. </note>
  614. </para></description></method>
  615. <method name="set_local_address"><type>void</type><parameter name="addr"><paramtype>boost::asio::ip::address const &amp;</paramtype><description><para>The local address </para></description></parameter><parameter name="port"><paramtype>unsigned short</paramtype><default>514</default><description><para>The local port number </para></description></parameter><description><para>The method sets the local address which log records will be sent from.</para><para><note><para>Does not have effect if the backend was constructed to use native syslog API</para>
  616. </note>
  617. </para></description></method>
  618. <method name="set_target_address"><type>void</type><parameter name="addr"><paramtype>std::string const &amp;</paramtype><description><para>The remote host address </para></description></parameter><parameter name="port"><paramtype>unsigned short</paramtype><default>514</default><description><para>The port number on the remote host </para></description></parameter><description><para>The method sets the remote host name where log records will be sent to. The host name is resolved to obtain the final IP address.</para><para><note><para>Does not have effect if the backend was constructed to use native syslog API</para>
  619. </note>
  620. </para></description></method>
  621. <method name="set_target_address"><type>void</type><parameter name="addr"><paramtype>boost::asio::ip::address const &amp;</paramtype><description><para>The remote host address </para></description></parameter><parameter name="port"><paramtype>unsigned short</paramtype><default>514</default><description><para>The port number on the remote host </para></description></parameter><description><para>The method sets the address of the remote host where log records will be sent to.</para><para><note><para>Does not have effect if the backend was constructed to use native syslog API</para>
  622. </note>
  623. </para></description></method>
  624. <method name="consume"><type>void</type><parameter name="rec"><paramtype>record_view const &amp;</paramtype></parameter><parameter name="formatted_message"><paramtype>string_type const &amp;</paramtype></parameter><description><para>The method passes the formatted message to the syslog API or sends to a syslog server </para></description></method>
  625. </method-group>
  626. <constructor><description><para>Constructor. Creates a UDP socket-based backend with <computeroutput>syslog::user</computeroutput> facility code. IPv4 protocol will be used. </para></description></constructor>
  627. <constructor specifiers="explicit"><template>
  628. <template-nontype-parameter name="ArgsT"><type>typename...</type></template-nontype-parameter>
  629. </template><parameter name="args"><paramtype>ArgsT... const &amp;</paramtype></parameter><description><para>Constructor. Creates a sink backend with the specified named parameters. The following named parameters are supported:</para><para><itemizedlist>
  630. <listitem><para><computeroutput>facility</computeroutput> - Specifies the facility code. If not specified, <computeroutput>syslog::user</computeroutput> will be used. </para>
  631. </listitem>
  632. <listitem><para><computeroutput>use_impl</computeroutput> - Specifies the backend implementation. Can be one of: </para>
  633. </listitem>
  634. <listitem><para><computeroutput>native</computeroutput> - Use the native syslog API, if available. If no native API is available, it is equivalent to <computeroutput>udp_socket_based</computeroutput>. </para>
  635. </listitem>
  636. <listitem><para><computeroutput>udp_socket_based</computeroutput> - Use the UDP socket-based implementation, conforming to RFC3164 protocol specification. This is the default. </para>
  637. </listitem>
  638. <listitem><para><computeroutput>ip_version</computeroutput> - Specifies IP protocol version to use, in case if socket-based implementation is used. Can be either <computeroutput>v4</computeroutput> (the default one) or <computeroutput>v6</computeroutput>. </para>
  639. </listitem>
  640. <listitem><para><computeroutput>ident</computeroutput> - Process identification string. This parameter is only supported by native syslog implementation. </para>
  641. </listitem>
  642. </itemizedlist>
  643. </para></description></constructor>
  644. <destructor><description><para>Destructor </para></description></destructor>
  645. </class><namespace name="syslog">
  646. <class name="custom_severity_mapping"><template>
  647. <template-type-parameter name="AttributeValueT"><default>int</default></template-type-parameter>
  648. </template><inherit access="public">basic_custom_mapping&lt; level, AttributeValueT &gt;</inherit><purpose>Customizable severity level mapping. </purpose><description><para>The class allows to setup a custom mapping between an attribute and Syslog severity levels. The mapping should be initialized similarly to the standard <computeroutput>map</computeroutput> container, by using indexing operator and assignment. </para></description><method-group name="public member functions">
  649. </method-group>
  650. <constructor specifiers="explicit"><parameter name="name"><paramtype>attribute_name const &amp;</paramtype><description><para>Attribute name </para></description></parameter><description><para>Constructor</para><para>
  651. </para></description></constructor>
  652. </class><class name="direct_severity_mapping"><template>
  653. <template-type-parameter name="AttributeValueT"><default>int</default></template-type-parameter>
  654. </template><inherit access="public">basic_direct_mapping&lt; level, AttributeValueT &gt;</inherit><purpose>Straightforward severity level mapping. </purpose><description><para>This type of mapping assumes that attribute with a particular name always provides values that map directly onto the Syslog levels. The mapping simply returns the extracted attribute value converted to the Syslog severity level. </para></description><method-group name="public member functions">
  655. </method-group>
  656. <constructor specifiers="explicit"><parameter name="name"><paramtype>attribute_name const &amp;</paramtype><description><para>Attribute name </para></description></parameter><description><para>Constructor</para><para>
  657. </para></description></constructor>
  658. </class><enum name="impl_types"><enumvalue name="native"><default>= 0</default><purpose>Use native syslog API. </purpose></enumvalue><enumvalue name="udp_socket_based"><default>= 1</default><purpose>Use UDP sockets, according to RFC3164. </purpose></enumvalue><purpose>The enumeration defined the possible implementation types for the syslog backend. </purpose></enum>
  659. </namespace>
  660. <enum name="ip_versions"><enumvalue name="v4"/><enumvalue name="v6"/><purpose>Supported IP protocol versions. </purpose></enum>
  661. </namespace>
  662. </namespace>
  663. </namespace>
  664. </header>
  665. <header name="boost/log/sinks/syslog_constants.hpp">
  666. <para><para>Andrey Semashev </para>
  667. <para>08.01.2008</para>
  668. The header contains definition of constants related to Syslog API. The constants can be used in other places without the Syslog backend. </para><namespace name="boost">
  669. <namespace name="log">
  670. <namespace name="sinks">
  671. <namespace name="syslog">
  672. <enum name="level"><enumvalue name="emergency"><default>= 0</default><purpose>Equivalent to LOG_EMERG in syslog API. </purpose></enumvalue><enumvalue name="alert"><default>= 1</default><purpose>Equivalent to LOG_ALERT in syslog API. </purpose></enumvalue><enumvalue name="critical"><default>= 2</default><purpose>Equivalent to LOG_CRIT in syslog API. </purpose></enumvalue><enumvalue name="error"><default>= 3</default><purpose>Equivalent to LOG_ERROR in syslog API. </purpose></enumvalue><enumvalue name="warning"><default>= 4</default><purpose>Equivalent to LOG_WARNING in syslog API. </purpose></enumvalue><enumvalue name="notice"><default>= 5</default><purpose>Equivalent to LOG_NOTICE in syslog API. </purpose></enumvalue><enumvalue name="info"><default>= 6</default><purpose>Equivalent to LOG_INFO in syslog API. </purpose></enumvalue><enumvalue name="debug"><default>= 7</default><purpose>Equivalent to LOG_DEBUG in syslog API. </purpose></enumvalue><purpose>Syslog record levels. </purpose></enum>
  673. <enum name="facility"><enumvalue name="kernel"><default>= 0 * 8</default><purpose>Kernel messages. </purpose></enumvalue><enumvalue name="user"><default>= 1 * 8</default><purpose>User-level messages. Equivalent to LOG_USER in syslog API. </purpose></enumvalue><enumvalue name="mail"><default>= 2 * 8</default><purpose>Mail system messages. Equivalent to LOG_MAIL in syslog API. </purpose></enumvalue><enumvalue name="daemon"><default>= 3 * 8</default><purpose>System daemons. Equivalent to LOG_DAEMON in syslog API. </purpose></enumvalue><enumvalue name="security0"><default>= 4 * 8</default><purpose>Security/authorization messages. </purpose></enumvalue><enumvalue name="syslogd"><default>= 5 * 8</default><purpose>Messages from the syslogd daemon. Equivalent to LOG_SYSLOG in syslog API. </purpose></enumvalue><enumvalue name="printer"><default>= 6 * 8</default><purpose>Line printer subsystem. Equivalent to LOG_LPR in syslog API. </purpose></enumvalue><enumvalue name="news"><default>= 7 * 8</default><purpose>Network news subsystem. Equivalent to LOG_NEWS in syslog API. </purpose></enumvalue><enumvalue name="uucp"><default>= 8 * 8</default><purpose>Messages from UUCP subsystem. Equivalent to LOG_UUCP in syslog API. </purpose></enumvalue><enumvalue name="clock0"><default>= 9 * 8</default><purpose>Messages from the clock daemon. </purpose></enumvalue><enumvalue name="security1"><default>= 10 * 8</default><purpose>Security/authorization messages. </purpose></enumvalue><enumvalue name="ftp"><default>= 11 * 8</default><purpose>Messages from FTP daemon. </purpose></enumvalue><enumvalue name="ntp"><default>= 12 * 8</default><purpose>Messages from NTP daemon. </purpose></enumvalue><enumvalue name="log_audit"><default>= 13 * 8</default><purpose>Security/authorization messages. </purpose></enumvalue><enumvalue name="log_alert"><default>= 14 * 8</default><purpose>Security/authorization messages. </purpose></enumvalue><enumvalue name="clock1"><default>= 15 * 8</default><purpose>Messages from the clock daemon. </purpose></enumvalue><enumvalue name="local0"><default>= 16 * 8</default><purpose>For local use. Equivalent to LOG_LOCAL0 in syslog API. </purpose></enumvalue><enumvalue name="local1"><default>= 17 * 8</default><purpose>For local use. Equivalent to LOG_LOCAL1 in syslog API. </purpose></enumvalue><enumvalue name="local2"><default>= 18 * 8</default><purpose>For local use. Equivalent to LOG_LOCAL2 in syslog API. </purpose></enumvalue><enumvalue name="local3"><default>= 19 * 8</default><purpose>For local use. Equivalent to LOG_LOCAL3 in syslog API. </purpose></enumvalue><enumvalue name="local4"><default>= 20 * 8</default><purpose>For local use. Equivalent to LOG_LOCAL4 in syslog API. </purpose></enumvalue><enumvalue name="local5"><default>= 21 * 8</default><purpose>For local use. Equivalent to LOG_LOCAL5 in syslog API. </purpose></enumvalue><enumvalue name="local6"><default>= 22 * 8</default><purpose>For local use. Equivalent to LOG_LOCAL6 in syslog API. </purpose></enumvalue><enumvalue name="local7"><default>= 23 * 8</default><purpose>For local use. Equivalent to LOG_LOCAL7 in syslog API. </purpose></enumvalue><purpose>Syslog facility codes. </purpose></enum>
  674. <function name="make_level"><type>level</type><parameter name="lev"><paramtype>int</paramtype></parameter><description><para>The function constructs log record level from an integer </para></description></function>
  675. <function name="make_facility"><type>facility</type><parameter name="fac"><paramtype>int</paramtype></parameter><description><para>The function constructs log source facility from an integer </para></description></function>
  676. </namespace>
  677. </namespace>
  678. </namespace>
  679. </namespace>
  680. </header>
  681. <header name="boost/log/sinks/text_file_backend.hpp">
  682. <para><para>Andrey Semashev </para>
  683. <para>09.06.2009</para>
  684. The header contains implementation of a text file sink backend. </para><namespace name="boost">
  685. <namespace name="log">
  686. <namespace name="sinks">
  687. <class name="text_file_backend"><inherit access="public">basic_formatted_sink_backend&lt; char, combine_requirements&lt; synchronized_feeding, flushing &gt;::type &gt;</inherit><purpose>An implementation of a text file logging sink backend. </purpose><description><para>The sink backend puts formatted log records to a text file. The sink supports file rotation and advanced file control, such as size and file count restriction. </para></description><typedef name="char_type"><purpose>Character type. </purpose><type>base_type::char_type</type></typedef>
  688. <typedef name="string_type"><purpose>String type to be used as a message text holder. </purpose><type>base_type::string_type</type></typedef>
  689. <typedef name="stream_type"><purpose>Stream type. </purpose><type>std::basic_ostream&lt; char_type &gt;</type></typedef>
  690. <typedef name="open_handler_type"><purpose>File open handler. </purpose><type><emphasis>unspecified</emphasis></type></typedef>
  691. <typedef name="close_handler_type"><purpose>File close handler. </purpose><type><emphasis>unspecified</emphasis></type></typedef>
  692. <typedef name="time_based_rotation_predicate"><purpose>Predicate that defines the time-based condition for file rotation. </purpose><type><emphasis>unspecified</emphasis></type></typedef>
  693. <method-group name="public member functions">
  694. <method name="set_file_name_pattern"><type>void</type><template>
  695. <template-type-parameter name="PathT"/>
  696. </template><parameter name="pattern"><paramtype>PathT const &amp;</paramtype><description><para>The name pattern for the file being written. </para></description></parameter><description><para>The method sets the active file name wildcard for the files being written. The wildcard supports date and time injection into the file name.</para><para>
  697. </para></description></method>
  698. <method name="set_target_file_name_pattern"><type>void</type><template>
  699. <template-type-parameter name="PathT"/>
  700. </template><parameter name="pattern"><paramtype>PathT const &amp;</paramtype><description><para>The name pattern for the file being rotated. </para></description></parameter><description><para>The method sets the target file name wildcard for the files being rotated. The wildcard supports date and time injection into the file name.</para><para>This pattern will be used when the log file is being rotated, to rename the just written log file (which has the name according to the pattern in the <computeroutput>file_name</computeroutput> constructor parameter or set by a call to <computeroutput>set_file_name_pattern</computeroutput>), just before passing the file to the file collector.</para><para>
  701. </para></description></method>
  702. <method name="set_open_mode"><type>void</type><parameter name="mode"><paramtype>std::ios_base::openmode</paramtype><description><para>File open mode </para></description></parameter><description><para>The method sets the file open mode</para><para>
  703. </para></description></method>
  704. <method name="set_file_collector"><type>void</type><parameter name="collector"><paramtype>shared_ptr&lt; <classname>file::collector</classname> &gt; const &amp;</paramtype><description><para>The file collector function object </para></description></parameter><description><para>The method sets the log file collector function. The function is called on file rotation and is being passed the written file name.</para><para>
  705. </para></description></method>
  706. <method name="set_open_handler"><type>void</type><parameter name="handler"><paramtype>open_handler_type const &amp;</paramtype><description><para>The file open handler function object </para></description></parameter><description><para>The method sets file opening handler. The handler will be called every time the backend opens a new temporary file. The handler may write a header to the opened file in order to maintain file validity.</para><para>
  707. </para></description></method>
  708. <method name="set_close_handler"><type>void</type><parameter name="handler"><paramtype>close_handler_type const &amp;</paramtype><description><para>The file close handler function object </para></description></parameter><description><para>The method sets file closing handler. The handler will be called every time the backend closes a temporary file. The handler may write a footer to the opened file in order to maintain file validity.</para><para>
  709. </para></description></method>
  710. <method name="set_rotation_size"><type>void</type><parameter name="size"><paramtype>uintmax_t</paramtype><description><para>The maximum file size, in characters. </para></description></parameter><description><para>The method sets maximum file size. When the size is reached, file rotation is performed.</para><para><note><para>The size does not count any possible character translations that may happen in the underlying API. This may result in greater actual sizes of the written files.</para>
  711. </note>
  712. </para></description></method>
  713. <method name="set_time_based_rotation"><type>void</type><parameter name="predicate"><paramtype>time_based_rotation_predicate const &amp;</paramtype><description><para>The predicate that defines the time-based condition for file rotation. If empty, no time-based rotation will take place. </para></description></parameter><description><para>The method sets the predicate that defines the time-based condition for file rotation.</para><para><note><para>The rotation always occurs on writing a log record, so the rotation is not strictly bound to the specified condition.</para>
  714. </note>
  715. </para></description></method>
  716. <method name="enable_final_rotation"><type>void</type><parameter name="enable"><paramtype>bool</paramtype><description><para>The flag indicates whether the final rotation should be performed. </para></description></parameter><description><para>The method allows to enable or disable log file rotation on sink destruction.</para><para>By default the sink backend will rotate the log file, if it's been written to, on destruction.</para><para>
  717. </para></description></method>
  718. <method name="auto_flush"><type>void</type><parameter name="enable"><paramtype>bool</paramtype><default>true</default><description><para>The flag indicates whether the automatic buffer flush should be performed. </para></description></parameter><description><para>Sets the flag to automatically flush write buffers of the file being written after each log record.</para><para>
  719. </para></description></method>
  720. <method name="set_auto_newline_mode"><type>void</type><parameter name="mode"><paramtype>auto_newline_mode</paramtype><description><para>The trailing newline insertion mode. </para></description></parameter><description><para>Selects whether a trailing newline should be automatically inserted after every log record. See <computeroutput>auto_newline_mode</computeroutput> description for the possible modes of operation.</para><para>
  721. </para></description></method>
  722. <method name="get_current_file_name" cv="const"><type>filesystem::path</type><description><para>
  723. </para></description><returns><para>The name of the currently open log file. If no file is open, returns an empty path. </para>
  724. </returns></method>
  725. <method name="scan_for_files"><type>uintmax_t</type><parameter name="method"><paramtype>file::scan_method</paramtype><default>file::scan_matching</default><description><para>File scanning method </para></description></parameter><parameter name="update_counter"><paramtype>bool</paramtype><default>true</default><description><para>If <computeroutput>true</computeroutput> and <emphasis>method</emphasis> is <computeroutput>scan_matching</computeroutput>, the method attempts to update the internal file counter according to the found files. The counter is unaffected otherwise. </para></description></parameter><description><para>Performs scanning of the target directory for log files that may have been left from previous runs of the application. The found files are considered by the file collector as if they were rotated.</para><para>The file scan can be performed in two ways: either all files in the target directory will be considered as log files, or only those files that satisfy the target file name pattern. See documentation on <computeroutput>sinks::file::collector::scan_for_files</computeroutput> for more information.</para><para>
  726. <note><para>The method essentially delegates to the same-named function of the file collector. </para>
  727. </note>
  728. </para></description><requires><para>File collector and the proper file name pattern have already been set.</para>
  729. </requires><returns><para>The number of files found.</para>
  730. </returns></method>
  731. <method name="consume"><type>void</type><parameter name="rec"><paramtype>record_view const &amp;</paramtype></parameter><parameter name="formatted_message"><paramtype>string_type const &amp;</paramtype></parameter><description><para>The method writes the message to the sink </para></description></method>
  732. <method name="flush"><type>void</type><description><para>The method flushes the currently open log file </para></description></method>
  733. <method name="rotate_file"><type>void</type><description><para>The method rotates the file </para></description></method>
  734. </method-group>
  735. <constructor><description><para>Default constructor. The constructed sink backend uses default values of all the parameters. </para></description></constructor>
  736. <constructor specifiers="explicit"><template>
  737. <template-nontype-parameter name="ArgsT"><type>typename...</type></template-nontype-parameter>
  738. </template><parameter name="args"><paramtype>ArgsT... const &amp;</paramtype></parameter><description><para>Constructor. Creates a sink backend with the specified named parameters. The following named parameters are supported:</para><para><itemizedlist>
  739. <listitem><para><computeroutput>file_name</computeroutput> - Specifies the active file name pattern where logs are actually written to. The pattern may contain directory and file name portions, but only the file name may contain placeholders. The backend supports Boost.DateTime placeholders for injecting current time and date into the file name. Also, an additional N placeholder is supported, it will be replaced with an integral increasing file counter. The placeholder may also contain width specification in the printf-compatible form (e.g. %5N). The printed file counter will always be zero-filled. If <computeroutput>file_name</computeroutput> is not specified, pattern "%5N.log" will be used. </para>
  740. </listitem>
  741. <listitem><para><computeroutput>target_file_name</computeroutput> - Specifies the target file name pattern to use to rename the log file on rotation, before passing it to the file collector. The pattern may contain the same placeholders as the <computeroutput>file_name</computeroutput> parameter. By default, no renaming is done, i.e. the written log file keeps its name according to <computeroutput>file_name</computeroutput>. </para>
  742. </listitem>
  743. <listitem><para><computeroutput>open_mode</computeroutput> - File open mode. The mode should be presented in form of mask compatible to <computeroutput>std::ios_base::openmode</computeroutput>. If not specified, <computeroutput>trunc | out</computeroutput> will be used. </para>
  744. </listitem>
  745. <listitem><para><computeroutput>rotation_size</computeroutput> - Specifies the approximate size, in characters written, of the temporary file upon which the file is passed to the file collector. Note the size does not count any possible character conversions that may take place during writing to the file. If not specified, the file won't be rotated upon reaching any size. </para>
  746. </listitem>
  747. <listitem><para><computeroutput>time_based_rotation</computeroutput> - Specifies the predicate for time-based file rotation. No time-based file rotations will be performed, if not specified. </para>
  748. </listitem>
  749. <listitem><para><computeroutput>enable_final_rotation</computeroutput> - Specifies a flag, whether or not perform log file rotation on sink backend destruction. By default, is <computeroutput>true</computeroutput>. </para>
  750. </listitem>
  751. <listitem><para><computeroutput>auto_flush</computeroutput> - Specifies a flag, whether or not to automatically flush the file after each written log record. By default, is <computeroutput>false</computeroutput>. </para>
  752. </listitem>
  753. <listitem><para><computeroutput>auto_newline_mode</computeroutput> - Specifies automatic trailing newline insertion mode. Must be a value of the <computeroutput>auto_newline_mode</computeroutput> enum. By default, is <computeroutput>auto_newline_mode::insert_if_missing</computeroutput>.</para>
  754. </listitem>
  755. </itemizedlist>
  756. <note><para>Read the caution note regarding file name pattern in the <computeroutput>sinks::file::collector::scan_for_files</computeroutput> documentation. </para>
  757. </note>
  758. </para></description></constructor>
  759. <destructor><description><para>Destructor </para></description></destructor>
  760. </class><namespace name="file">
  761. <struct name="collector"><purpose>Base class for file collectors. </purpose><description><para>All file collectors, supported by file sink backends, should inherit this class. </para></description><method-group name="public member functions">
  762. <method name="store_file" cv="= 0" specifiers="virtual"><type>void</type><parameter name="src_path"><paramtype>filesystem::path const &amp;</paramtype><description><para>The name of the file to be stored </para></description></parameter><description><para>The function stores the specified file in the storage. May lead to an older file deletion and a long file moving.</para><para>
  763. </para></description></method>
  764. <method name="scan_for_files" cv="= 0" specifiers="virtual"><type>uintmax_t</type><parameter name="method"><paramtype>scan_method</paramtype><description><para>The method of scanning. If <computeroutput>no_scan</computeroutput> is specified, the call has no effect. </para></description></parameter><parameter name="pattern"><paramtype>filesystem::path const &amp;</paramtype><default>filesystem::path()</default><description><para>The file name pattern if <emphasis>method</emphasis> is <computeroutput>scan_matching</computeroutput>. Otherwise the parameter is not used. </para></description></parameter><parameter name="counter"><paramtype>unsigned int *</paramtype><default>0</default><description><para>If not <computeroutput>NULL</computeroutput> and <emphasis>method</emphasis> is <computeroutput>scan_matching</computeroutput>, the method suggests initial value of a file counter that may be used in the file name pattern. The parameter is not used otherwise. </para></description></parameter><description><para>Scans the target directory for the files that have already been stored. The found files are added to the collector in order to be tracked and erased, if needed.</para><para>The function may scan the directory in two ways: it will either consider every file in the directory a log file, or will only consider files with names that match the specified pattern. The pattern may contain the following placeholders:</para><para><itemizedlist>
  765. <listitem><para>y, Y, m, d - date components, in Boost.DateTime meaning. </para>
  766. </listitem>
  767. <listitem><para>H, M, S, f - time components, in Boost.DateTime meaning. </para>
  768. </listitem>
  769. <listitem><para>N - numeric file counter. May also contain width specification in printf-compatible form (e.g. %5N). The resulting number will always be zero-filled. </para>
  770. </listitem>
  771. <listitem><para>%% - a percent sign</para>
  772. </listitem>
  773. </itemizedlist>
  774. All other placeholders are not supported.</para><para>
  775. <note><para>In case if <emphasis>method</emphasis> is <computeroutput>scan_matching</computeroutput> the effect of this function is highly dependent on the <emphasis>pattern</emphasis> definition. It is recommended to choose patterns with easily distinguished placeholders (i.e. having delimiters between them). Otherwise either some files can be mistakenly found or not found, which in turn may lead to an incorrect file deletion. </para>
  776. </note>
  777. </para></description><returns><para>The number of found files.</para>
  778. </returns></method>
  779. </method-group>
  780. <destructor><description><para>Default constructor</para><para>Virtual destructor </para></description></destructor>
  781. <constructor cv="= delete"><parameter name=""><paramtype><classname>collector</classname> const &amp;</paramtype></parameter></constructor>
  782. <copy-assignment cv="= delete"><type><classname>collector</classname> &amp;</type><parameter name=""><paramtype><classname>collector</classname> const &amp;</paramtype></parameter></copy-assignment>
  783. </struct><class name="rotation_at_time_interval"><description><para>The class represents the time interval of log file rotation. The log file will be rotated after the specified time interval has passed. </para></description><typedef name="result_type"><type>bool</type></typedef>
  784. <method-group name="public member functions">
  785. <method name="operator()" cv="const"><type>bool</type><description><para>Checks if it's time to rotate the file </para></description></method>
  786. </method-group>
  787. <constructor specifiers="explicit"><parameter name="interval"><paramtype>posix_time::time_duration const &amp;</paramtype><description><para>The interval of the rotation, should be no less than 1 second </para></description></parameter><description><para>Creates a rotation time interval of the specified duration</para><para>
  788. </para></description></constructor>
  789. </class><class name="rotation_at_time_point"><description><para>The class represents the time point of log file rotation. One can specify one of three types of time point based rotation:</para><para><itemizedlist>
  790. <listitem><para>rotation takes place every day, at the specified time </para>
  791. </listitem>
  792. <listitem><para>rotation takes place on the specified day of every week, at the specified time </para>
  793. </listitem>
  794. <listitem><para>rotation takes place on the specified day of every month, at the specified time</para>
  795. </listitem>
  796. </itemizedlist>
  797. The time points are considered to be local time. </para></description><typedef name="result_type"><type>bool</type></typedef>
  798. <method-group name="public member functions">
  799. <method name="operator()" cv="const"><type>bool</type><description><para>Checks if it's time to rotate the file </para></description></method>
  800. </method-group>
  801. <constructor specifiers="explicit"><parameter name="hour"><paramtype>unsigned char</paramtype><description><para>The rotation hour, should be within 0 and 23 </para></description></parameter><parameter name="minute"><paramtype>unsigned char</paramtype><description><para>The rotation minute, should be within 0 and 59 </para></description></parameter><parameter name="second"><paramtype>unsigned char</paramtype><description><para>The rotation second, should be within 0 and 59 </para></description></parameter><description><para>Creates a rotation time point of every day at the specified time</para><para>
  802. </para></description></constructor>
  803. <constructor specifiers="explicit"><parameter name="wday"><paramtype>date_time::weekdays</paramtype><description><para>The weekday of the rotation </para></description></parameter><parameter name="hour"><paramtype>unsigned char</paramtype><default>0</default><description><para>The rotation hour, should be within 0 and 23 </para></description></parameter><parameter name="minute"><paramtype>unsigned char</paramtype><default>0</default><description><para>The rotation minute, should be within 0 and 59 </para></description></parameter><parameter name="second"><paramtype>unsigned char</paramtype><default>0</default><description><para>The rotation second, should be within 0 and 59 </para></description></parameter><description><para>Creates a rotation time point of each specified weekday at the specified time</para><para>
  804. </para></description></constructor>
  805. <constructor specifiers="explicit"><parameter name="mday"><paramtype>gregorian::greg_day</paramtype><description><para>The monthday of the rotation, should be within 1 and 31 </para></description></parameter><parameter name="hour"><paramtype>unsigned char</paramtype><default>0</default><description><para>The rotation hour, should be within 0 and 23 </para></description></parameter><parameter name="minute"><paramtype>unsigned char</paramtype><default>0</default><description><para>The rotation minute, should be within 0 and 59 </para></description></parameter><parameter name="second"><paramtype>unsigned char</paramtype><default>0</default><description><para>The rotation second, should be within 0 and 59 </para></description></parameter><description><para>Creates a rotation time point of each specified day of month at the specified time</para><para>
  806. </para></description></constructor>
  807. </class><enum name="scan_method"><enumvalue name="no_scan"><purpose>Don't scan for stored files. </purpose></enumvalue><enumvalue name="scan_matching"><purpose>Scan for files with names matching the specified mask. </purpose></enumvalue><enumvalue name="scan_all"><purpose>Scan for all files in the directory. </purpose></enumvalue><purpose>The enumeration of the stored files scan methods. </purpose></enum>
  808. <function name="make_collector"><type>shared_ptr&lt; <classname>collector</classname> &gt;</type><template>
  809. <template-nontype-parameter name="ArgsT"><type>typename...</type></template-nontype-parameter>
  810. </template><parameter name="args"><paramtype>ArgsT... const &amp;</paramtype></parameter><description><para>The function creates a file collector for the specified target directory. Each target directory is managed by a single file collector, so if this function is called several times for the same directory, it will return a reference to the same file collector. It is safe to use the same collector in different sinks, even in a multithreaded application.</para><para>One can specify certain restrictions for the stored files, such as maximum total size or minimum free space left in the target directory. If any of the specified restrictions is not met, the oldest stored file is deleted. If the same collector is requested more than once with different restrictions, the collector will act according to the most strict combination of all specified restrictions.</para><para>The following named parameters are supported:</para><para><itemizedlist>
  811. <listitem><para><computeroutput>target</computeroutput> - Specifies the target directory for the files being stored in. This parameter is mandatory. </para>
  812. </listitem>
  813. <listitem><para><computeroutput>max_size</computeroutput> - Specifies the maximum total size, in bytes, of stored files that the collector will try not to exceed. If the size exceeds this threshold the oldest file(s) is deleted to free space. Note that the threshold may be exceeded if the size of individual files exceed the <computeroutput>max_size</computeroutput> value. The threshold is not maintained, if not specified. </para>
  814. </listitem>
  815. <listitem><para><computeroutput>min_free_space</computeroutput> - Specifies the minimum free space, in bytes, in the target directory that the collector tries to maintain. If the threshold is exceeded, the oldest file(s) is deleted to free space. The threshold is not maintained, if not specified. </para>
  816. </listitem>
  817. <listitem><para><computeroutput>max_files</computeroutput> - Specifies the maximum number of log files stored. If the number of files exceeds this threshold, the oldest file(s) is deleted to free space. The threshhold is not maintained if not specified.</para>
  818. </listitem>
  819. </itemizedlist>
  820. </para></description><returns><para>The file collector. </para>
  821. </returns></function>
  822. </namespace>
  823. </namespace>
  824. </namespace>
  825. </namespace>
  826. </header>
  827. <header name="boost/log/sinks/text_ipc_message_queue_backend.hpp">
  828. <para><para>Lingxi Li </para>
  829. <para>Andrey Semashev </para>
  830. <para>14.10.2015</para>
  831. The header contains implementation of a text interprocess message queue sink backend along with implementation of a supporting interprocess message queue. </para><namespace name="boost">
  832. <namespace name="log">
  833. <namespace name="sinks">
  834. <class name="text_ipc_message_queue_backend"><template>
  835. <template-type-parameter name="QueueT"/>
  836. </template><inherit access="public">basic_formatted_sink_backend&lt; char, concurrent_feeding &gt;</inherit><purpose>An implementation of a text interprocess message queue sink backend and a supporting interprocess message queue. </purpose><description><para>The sink backend sends formatted log messages to an interprocess message queue which can be extracted by a viewer process. Methods of this class are not thread-safe, unless otherwise specified. </para></description><typedef name="char_type"><purpose>Character type. </purpose><type>base_type::char_type</type></typedef>
  837. <typedef name="string_type"><purpose>String type to be used as a message text holder. </purpose><type>base_type::string_type</type></typedef>
  838. <typedef name="queue_type"><purpose>Interprocess message queue type. </purpose><type>QueueT</type></typedef>
  839. <method-group name="public member functions">
  840. <method name="message_queue" cv="noexcept"><type>queue_type &amp;</type><description><para>The method returns a reference to the managed <computeroutput>queue_type</computeroutput> object.</para><para>
  841. </para></description><returns><para>A reference to the managed <computeroutput>queue_type</computeroutput> object. </para>
  842. </returns></method>
  843. <method name="message_queue" cv="const noexcept"><type>queue_type const &amp;</type><description><para>The method returns a constant reference to the managed <computeroutput>queue_type</computeroutput> object.</para><para>
  844. </para></description><returns><para>A constant reference to the managed <computeroutput>queue_type</computeroutput> object. </para>
  845. </returns></method>
  846. <method name="is_open" cv="const noexcept"><type>bool</type><description><para>Tests whether the object is associated with any message queue. Only when the backend has an associated message queue, will any message be sent.</para><para>
  847. </para></description><returns><para><computeroutput>true</computeroutput> if the object is associated with a message queue, and <computeroutput>false</computeroutput> otherwise. </para>
  848. </returns></method>
  849. <method name="consume"><type>void</type><parameter name=""><paramtype>record_view const &amp;</paramtype></parameter><parameter name="formatted_message"><paramtype>string_type const &amp;</paramtype></parameter><description><para>The method writes the message to the backend. Concurrent calls to this method are allowed. Therefore, the backend may be used with unlocked frontend. <computeroutput>stop_local()</computeroutput> can be used to have a blocked <computeroutput>consume()</computeroutput> call return and prevent future calls to <computeroutput>consume()</computeroutput> from blocking. </para></description></method>
  850. </method-group>
  851. <constructor cv="noexcept"><description><para>Default constructor. The method constructs the backend using the default-constructed interprocess message queue. The queue may need additional setup in order to be able to send messages. </para></description></constructor>
  852. <constructor specifiers="explicit" cv="noexcept"><parameter name="queue"><paramtype>queue_type &amp;&amp;</paramtype></parameter><description><para>Initializing constructor. The method constructs the backend using the provided interprocess message queue. The constructor moves from the provided queue. </para></description></constructor>
  853. <constructor specifiers="explicit"><template>
  854. <template-nontype-parameter name="Args"><type>typename...</type></template-nontype-parameter>
  855. </template><parameter name="args"><paramtype>Args &amp;&amp;...</paramtype></parameter><description><para>Constructor that passes arbitrary named parameters to the interprocess queue constructor. Refer to the queue documentation for the list of supported parameters. </para></description></constructor>
  856. </class></namespace>
  857. </namespace>
  858. </namespace>
  859. </header>
  860. <header name="boost/log/sinks/text_multifile_backend.hpp">
  861. <para><para>Andrey Semashev </para>
  862. <para>09.06.2009</para>
  863. The header contains implementation of a text multi-file sink backend. </para><namespace name="boost">
  864. <namespace name="log">
  865. <namespace name="sinks">
  866. <class name="text_multifile_backend"><inherit access="public">basic_formatted_sink_backend&lt; char &gt;</inherit><purpose>An implementation of a text multiple files logging sink backend. </purpose><description><para>The sink backend puts formatted log records to one of the text files. The particular file is chosen upon each record's attribute values, which allows to distribute records into individual files or to group records related to some entity or process in a separate file. </para></description><typedef name="char_type"><purpose>Character type. </purpose><type>base_type::char_type</type></typedef>
  867. <typedef name="string_type"><purpose>String type to be used as a message text holder. </purpose><type>base_type::string_type</type></typedef>
  868. <typedef name="file_name_composer_type"><purpose>File name composer functor type. </purpose><type><emphasis>unspecified</emphasis></type></typedef>
  869. <method-group name="public member functions">
  870. <method name="set_file_name_composer"><type>void</type><template>
  871. <template-type-parameter name="ComposerT"/>
  872. </template><parameter name="composer"><paramtype>ComposerT const &amp;</paramtype><description><para>File name composer functor </para></description></parameter><description><para>The method sets file name composer functional object. Log record formatters are accepted, too.</para><para>
  873. </para></description></method>
  874. <method name="set_auto_newline_mode"><type>void</type><parameter name="mode"><paramtype>auto_newline_mode</paramtype><description><para>The trailing newline insertion mode. </para></description></parameter><description><para>Selects whether a trailing newline should be automatically inserted after every log record. See <computeroutput>auto_newline_mode</computeroutput> description for the possible modes of operation.</para><para>
  875. </para></description></method>
  876. <method name="consume"><type>void</type><parameter name="rec"><paramtype>record_view const &amp;</paramtype></parameter><parameter name="formatted_message"><paramtype>string_type const &amp;</paramtype></parameter><description><para>The method writes the message to the sink </para></description></method>
  877. </method-group>
  878. <constructor><description><para>Default constructor. The constructed sink backend has no file name composer and thus will not write any files. All other parameters are set to their defaults. </para></description></constructor>
  879. <constructor specifiers="explicit"><template>
  880. <template-nontype-parameter name="ArgsT"><type>typename...</type></template-nontype-parameter>
  881. </template><parameter name="args"><paramtype>ArgsT... const &amp;</paramtype></parameter><description><para>Constructor. Creates a sink backend with the specified named parameters. The following named parameters are supported:</para><para><itemizedlist>
  882. <listitem><para><computeroutput>auto_newline_mode</computeroutput> - Specifies automatic trailing newline insertion mode. Must be a value of the <computeroutput>auto_newline_mode</computeroutput> enum. By default, is <computeroutput>auto_newline_mode::insert_if_missing</computeroutput>. </para>
  883. </listitem>
  884. </itemizedlist>
  885. </para></description></constructor>
  886. <destructor><description><para>Destructor </para></description></destructor>
  887. </class><namespace name="file">
  888. <class name="file_name_composer_adapter"><template>
  889. <template-type-parameter name="FormatterT"/>
  890. </template><description><para>An adapter class that allows to use regular formatters as file name generators. </para></description><typedef name="result_type"><purpose>Functor result type. </purpose><type>filesystem::path</type></typedef>
  891. <typedef name="native_char_type"><purpose>File name character type. </purpose><type>result_type::string_type::value_type</type></typedef>
  892. <typedef name="formatter_type"><purpose>The adopted formatter type. </purpose><type>FormatterT</type></typedef>
  893. <typedef name="stream_type"><purpose>Formatting stream type. </purpose><type>basic_formatting_ostream&lt; native_char_type &gt;</type></typedef>
  894. <method-group name="public member functions">
  895. <method name="operator()" cv="const"><type>result_type</type><parameter name="rec"><paramtype>record_view const &amp;</paramtype></parameter><description><para>The operator generates a file name based on the log record </para></description></method>
  896. </method-group>
  897. <constructor specifiers="explicit"><parameter name="formatter"><paramtype>formatter_type const &amp;</paramtype></parameter><parameter name="loc"><paramtype>std::locale const &amp;</paramtype><default>std::locale()</default></parameter><description><para>Initializing constructor </para></description></constructor>
  898. <constructor><parameter name="that"><paramtype><classname>file_name_composer_adapter</classname> const &amp;</paramtype></parameter><description><para>Copy constructor </para></description></constructor>
  899. <copy-assignment><type><classname>file_name_composer_adapter</classname> &amp;</type><parameter name="that"><paramtype><classname>file_name_composer_adapter</classname> const &amp;</paramtype></parameter><description><para>Assignment </para></description></copy-assignment>
  900. </class><function name="as_file_name_composer"><type><classname>file_name_composer_adapter</classname>&lt; FormatterT &gt;</type><template>
  901. <template-type-parameter name="FormatterT"/>
  902. </template><parameter name="fmt"><paramtype>FormatterT const &amp;</paramtype><description><para>The formatter function object to adopt </para></description></parameter><parameter name="loc"><paramtype>std::locale const &amp;</paramtype><default>std::locale()</default><description><para>The locale to use to character code conversion and formatting </para></description></parameter><description><para>The function adopts a log record formatter into a file name generator</para><para>
  903. </para></description></function>
  904. </namespace>
  905. </namespace>
  906. </namespace>
  907. </namespace>
  908. </header>
  909. <header name="boost/log/sinks/text_ostream_backend.hpp">
  910. <para><para>Andrey Semashev </para>
  911. <para>22.04.2007</para>
  912. The header contains implementation of a text output stream sink backend. </para><namespace name="boost">
  913. <namespace name="log">
  914. <namespace name="sinks">
  915. <class name="basic_text_ostream_backend"><template>
  916. <template-type-parameter name="CharT"/>
  917. </template><inherit access="public">basic_formatted_sink_backend&lt; CharT, combine_requirements&lt; synchronized_feeding, flushing &gt;::type &gt;</inherit><purpose>An implementation of a text output stream logging sink backend. </purpose><description><para>The sink backend puts formatted log records to one or more text streams. </para></description><typedef name="char_type"><purpose>Character type. </purpose><type>base_type::char_type</type></typedef>
  918. <typedef name="string_type"><purpose>String type to be used as a message text holder. </purpose><type>base_type::string_type</type></typedef>
  919. <typedef name="stream_type"><purpose>Output stream type. </purpose><type>std::basic_ostream&lt; char_type &gt;</type></typedef>
  920. <method-group name="public member functions">
  921. <method name="add_stream"><type>void</type><parameter name="strm"><paramtype>shared_ptr&lt; stream_type &gt; const &amp;</paramtype><description><para>Pointer to the stream. Must not be NULL. </para></description></parameter><description><para>The method adds a new stream to the sink.</para><para>
  922. </para></description></method>
  923. <method name="remove_stream"><type>void</type><parameter name="strm"><paramtype>shared_ptr&lt; stream_type &gt; const &amp;</paramtype><description><para>Pointer to the stream. Must not be NULL. </para></description></parameter><description><para>The method removes a stream from the sink. If the stream is not attached to the sink, the method has no effect.</para><para>
  924. </para></description></method>
  925. <method name="auto_flush"><type>void</type><parameter name="enable"><paramtype>bool</paramtype><default>true</default><description><para>The flag indicates whether the automatic buffer flush should be performed. </para></description></parameter><description><para>Sets the flag to automatically flush buffers of all attached streams after each log record.</para><para>
  926. </para></description></method>
  927. <method name="set_auto_newline_mode"><type>void</type><parameter name="mode"><paramtype>auto_newline_mode</paramtype><description><para>The trailing newline insertion mode. </para></description></parameter><description><para>Selects whether a trailing newline should be automatically inserted after every log record. See <computeroutput>auto_newline_mode</computeroutput> description for the possible modes of operation.</para><para>
  928. </para></description></method>
  929. <method name="consume"><type>void</type><parameter name="rec"><paramtype>record_view const &amp;</paramtype></parameter><parameter name="formatted_message"><paramtype>string_type const &amp;</paramtype></parameter><description><para>The method writes the message to the sink. </para></description></method>
  930. <method name="flush"><type>void</type><description><para>The method flushes all attached streams. </para></description></method>
  931. </method-group>
  932. <constructor><description><para>Constructor. No streams attached to the constructed backend, auto flush feature disabled. </para></description></constructor>
  933. <constructor specifiers="explicit"><template>
  934. <template-nontype-parameter name="ArgsT"><type>typename...</type></template-nontype-parameter>
  935. </template><parameter name="args"><paramtype>ArgsT... const &amp;</paramtype></parameter><description><para>Constructor. Creates a sink backend with the specified named parameters. The following named parameters are supported:</para><para><itemizedlist>
  936. <listitem><para><computeroutput>auto_flush</computeroutput> - Specifies a flag, whether or not to automatically flush the attached streams after each written log record. By default, is <computeroutput>false</computeroutput>. </para>
  937. </listitem>
  938. <listitem><para><computeroutput>auto_newline_mode</computeroutput> - Specifies automatic trailing newline insertion mode. Must be a value of the <computeroutput>auto_newline_mode</computeroutput> enum. By default, is <computeroutput>auto_newline_mode::insert_if_missing</computeroutput>. </para>
  939. </listitem>
  940. </itemizedlist>
  941. </para></description></constructor>
  942. <destructor><description><para>Destructor </para></description></destructor>
  943. </class><typedef name="text_ostream_backend"><purpose>Convenience typedef for narrow-character logging. </purpose><type><classname>basic_text_ostream_backend</classname>&lt; char &gt;</type></typedef>
  944. <typedef name="wtext_ostream_backend"><purpose>Convenience typedef for wide-character logging. </purpose><type><classname>basic_text_ostream_backend</classname>&lt; wchar_t &gt;</type></typedef>
  945. </namespace>
  946. </namespace>
  947. </namespace>
  948. </header>
  949. <header name="boost/log/sinks/unbounded_fifo_queue.hpp">
  950. <para><para>Andrey Semashev </para>
  951. <para>24.07.2011</para>
  952. The header contains implementation of unbounded FIFO queueing strategy for the asynchronous sink frontend. </para><namespace name="boost">
  953. <namespace name="log">
  954. <namespace name="sinks">
  955. <class name="unbounded_fifo_queue"><purpose>Unbounded FIFO log record queueing strategy. </purpose><description><para>The <computeroutput><classname alt="boost::log::sinks::unbounded_fifo_queue">unbounded_fifo_queue</classname></computeroutput> class is intended to be used with the <computeroutput><classname alt="boost::log::sinks::asynchronous_sink">asynchronous_sink</classname></computeroutput> frontend as a log record queueing strategy.</para><para>This strategy implements the simplest logic of log record buffering between threads: the queue has no limits and imposes no ordering over the queued elements aside from the order in which they are enqueued. Because of this the queue provides decent performance and scalability, however if sink backends can't consume log records fast enough the queue may grow uncontrollably. When this is an issue, it is recommended to use one of the bounded strategies. </para></description><method-group name="protected member functions">
  956. <method name="enqueue"><type>void</type><parameter name="rec"><paramtype>record_view const &amp;</paramtype></parameter><purpose>Enqueues log record to the queue. </purpose></method>
  957. <method name="try_enqueue"><type>bool</type><parameter name="rec"><paramtype>record_view const &amp;</paramtype></parameter><purpose>Attempts to enqueue log record to the queue. </purpose></method>
  958. <method name="try_dequeue_ready"><type>bool</type><parameter name="rec"><paramtype>record_view &amp;</paramtype></parameter><purpose>Attempts to dequeue a log record ready for processing from the queue, does not block if the queue is empty. </purpose></method>
  959. <method name="try_dequeue"><type>bool</type><parameter name="rec"><paramtype>record_view &amp;</paramtype></parameter><purpose>Attempts to dequeue log record from the queue, does not block if the queue is empty. </purpose></method>
  960. <method name="dequeue_ready"><type>bool</type><parameter name="rec"><paramtype>record_view &amp;</paramtype></parameter><purpose>Dequeues log record from the queue, blocks if the queue is empty. </purpose></method>
  961. <method name="interrupt_dequeue"><type>void</type><purpose>Wakes a thread possibly blocked in the <computeroutput>dequeue</computeroutput> method. </purpose></method>
  962. </method-group>
  963. <constructor><purpose>Default constructor. </purpose></constructor>
  964. <constructor specifiers="explicit"><template>
  965. <template-type-parameter name="ArgsT"/>
  966. </template><parameter name=""><paramtype>ArgsT const &amp;</paramtype></parameter><purpose>Initializing constructor. </purpose></constructor>
  967. </class></namespace>
  968. </namespace>
  969. </namespace>
  970. </header>
  971. <header name="boost/log/sinks/unbounded_ordering_queue.hpp">
  972. <para><para>Andrey Semashev </para>
  973. <para>24.07.2011</para>
  974. The header contains implementation of unbounded ordering record queueing strategy for the asynchronous sink frontend. </para><namespace name="boost">
  975. <namespace name="log">
  976. <namespace name="sinks">
  977. <class name="unbounded_ordering_queue"><template>
  978. <template-type-parameter name="OrderT"/>
  979. </template><purpose>Unbounded ordering log record queueing strategy. </purpose><description><para>The <computeroutput><classname alt="boost::log::sinks::unbounded_ordering_queue">unbounded_ordering_queue</classname></computeroutput> class is intended to be used with the <computeroutput><classname alt="boost::log::sinks::asynchronous_sink">asynchronous_sink</classname></computeroutput> frontend as a log record queueing strategy.</para><para>This strategy provides the following properties to the record queueing mechanism:</para><para><itemizedlist>
  980. <listitem><para>The queue has no size limits. </para>
  981. </listitem>
  982. <listitem><para>The queue has a fixed latency window. This means that each log record put into the queue will normally not be dequeued for a certain period of time. </para>
  983. </listitem>
  984. <listitem><para>The queue performs stable record ordering within the latency window. The ordering predicate can be specified in the <computeroutput>OrderT</computeroutput> template parameter.</para>
  985. </listitem>
  986. </itemizedlist>
  987. Since this queue has no size limits, it may grow uncontrollably if sink backends dequeue log records not fast enough. When this is an issue, it is recommended to use one of the bounded strategies. </para></description><method-group name="public member functions">
  988. <method name="get_ordering_window" cv="const"><type>posix_time::time_duration</type><description><para>Returns ordering window size specified during initialization </para></description></method>
  989. </method-group>
  990. <method-group name="public static functions">
  991. <method name="get_default_ordering_window" specifiers="static"><type>posix_time::time_duration</type><description><para>Returns default ordering window size. The default window size is specific to the operating system thread scheduling mechanism. </para></description></method>
  992. </method-group>
  993. <method-group name="protected member functions">
  994. <method name="enqueue"><type>void</type><parameter name="rec"><paramtype>record_view const &amp;</paramtype></parameter><purpose>Enqueues log record to the queue. </purpose></method>
  995. <method name="try_enqueue"><type>bool</type><parameter name="rec"><paramtype>record_view const &amp;</paramtype></parameter><purpose>Attempts to enqueue log record to the queue. </purpose></method>
  996. <method name="try_dequeue_ready"><type>bool</type><parameter name="rec"><paramtype>record_view &amp;</paramtype></parameter><purpose>Attempts to dequeue a log record ready for processing from the queue, does not block if no log records are ready to be processed. </purpose></method>
  997. <method name="try_dequeue"><type>bool</type><parameter name="rec"><paramtype>record_view &amp;</paramtype></parameter><purpose>Attempts to dequeue log record from the queue, does not block. </purpose></method>
  998. <method name="dequeue_ready"><type>bool</type><parameter name="rec"><paramtype>record_view &amp;</paramtype></parameter><purpose>Dequeues log record from the queue, blocks if no log records are ready to be processed. </purpose></method>
  999. <method name="interrupt_dequeue"><type>void</type><purpose>Wakes a thread possibly blocked in the <computeroutput>dequeue</computeroutput> method. </purpose></method>
  1000. </method-group>
  1001. <constructor specifiers="explicit"><template>
  1002. <template-type-parameter name="ArgsT"/>
  1003. </template><parameter name="args"><paramtype>ArgsT const &amp;</paramtype></parameter><purpose>Initializing constructor. </purpose></constructor>
  1004. <method-group name="private member functions">
  1005. <method name="enqueue_unlocked"><type>void</type><parameter name="rec"><paramtype>record_view const &amp;</paramtype></parameter><purpose>Enqueues a log record. </purpose></method>
  1006. </method-group>
  1007. </class></namespace>
  1008. </namespace>
  1009. </namespace>
  1010. </header>
  1011. <header name="boost/log/sinks/unlocked_frontend.hpp">
  1012. <para><para>Andrey Semashev </para>
  1013. <para>14.07.2009</para>
  1014. The header contains declaration of an unlocked sink frontend. </para><namespace name="boost">
  1015. <namespace name="log">
  1016. <namespace name="sinks">
  1017. <class name="unlocked_sink"><template>
  1018. <template-type-parameter name="SinkBackendT"/>
  1019. </template><inherit access="public">basic_sink_frontend</inherit><purpose>Non-blocking logging sink frontend. </purpose><description><para>The sink frontend does not perform thread synchronization and simply passes logging records to the sink backend. </para></description><typedef name="sink_backend_type"><purpose>Sink implementation type. </purpose><type>SinkBackendT</type></typedef>
  1020. <typedef name="locked_backend_ptr"><purpose>Type of pointer to the backend. </purpose><type>shared_ptr&lt; sink_backend_type &gt;</type></typedef>
  1021. <method-group name="public member functions">
  1022. <method name="locked_backend"><type>locked_backend_ptr</type><description><para>Locking accessor to the attached backend.</para><para><note><para>Does not do any actual locking, provided only for interface consistency with other frontends. </para>
  1023. </note>
  1024. </para></description></method>
  1025. <method name="consume" specifiers="virtual"><type>void</type><parameter name="rec"><paramtype>record_view const &amp;</paramtype></parameter><description><para>Passes the log record to the backend </para></description></method>
  1026. <method name="flush" specifiers="virtual"><type>void</type><description><para>The method performs flushing of any internal buffers that may hold log records. The method may take considerable time to complete and may block both the calling thread and threads attempting to put new records into the sink while this call is in progress. </para></description></method>
  1027. </method-group>
  1028. <constructor><description><para>Default constructor. Constructs the sink backend instance. Requires the backend to be default-constructible. </para></description></constructor>
  1029. <constructor specifiers="explicit"><parameter name="backend"><paramtype>shared_ptr&lt; sink_backend_type &gt; const &amp;</paramtype><description><para>Pointer to the backend instance</para></description></parameter><description><para>Constructor attaches user-constructed backend instance</para><para>
  1030. </para></description><requires><para><emphasis>backend</emphasis> is not <computeroutput>NULL</computeroutput>. </para>
  1031. </requires></constructor>
  1032. <constructor specifiers="explicit"><template>
  1033. <template-nontype-parameter name="Args"><type>typename...</type></template-nontype-parameter>
  1034. </template><parameter name="args"><paramtype>Args &amp;&amp;...</paramtype></parameter><description><para>Constructor that passes arbitrary named parameters to the interprocess sink backend constructor. Refer to the backend documentation for the list of supported parameters. </para></description></constructor>
  1035. </class></namespace>
  1036. </namespace>
  1037. </namespace>
  1038. </header>
  1039. </library-reference>