3 //=============================================================================
7 * @author Carlos O'Ryan <coryan@uci.edu>
9 //=============================================================================
11 #ifndef ACE_LOG_MSG_LOGGER_H
12 #define ACE_LOG_MSG_LOGGER_H
13 #include /**/ "ace/pre.h"
15 #include "ace/Log_Msg_Backend.h"
17 #if !defined (ACE_LACKS_PRAGMA_ONCE)
19 #endif /* ACE_LACKS_PRAGMA_ONCE */
21 #include "ace/Default_Constants.h"
23 // IPC conduit between sender and client daemon. This should be
24 // included in the ACE_Log_Msg class, but due to "order of include"
25 // problems it can't be...
26 #if (ACE_HAS_STREAM_LOG_MSG_IPC == 1)
27 # include "ace/SPIPE_Connector.h"
28 ACE_BEGIN_VERSIONED_NAMESPACE_DECL
29 typedef ACE_SPIPE_Stream ACE_LOG_MSG_IPC_STREAM
;
30 typedef ACE_SPIPE_Connector ACE_LOG_MSG_IPC_CONNECTOR
;
31 typedef ACE_SPIPE_Addr ACE_LOG_MSG_IPC_ADDR
;
32 ACE_END_VERSIONED_NAMESPACE_DECL
34 # include "ace/SOCK_Connector.h"
35 ACE_BEGIN_VERSIONED_NAMESPACE_DECL
36 typedef ACE_SOCK_Stream ACE_LOG_MSG_IPC_STREAM
;
37 typedef ACE_SOCK_Connector ACE_LOG_MSG_IPC_CONNECTOR
;
38 typedef ACE_INET_Addr ACE_LOG_MSG_IPC_ADDR
;
39 ACE_END_VERSIONED_NAMESPACE_DECL
40 #endif /* ACE_HAS_STREAM_PIPES */
42 ACE_BEGIN_VERSIONED_NAMESPACE_DECL
44 /// Defines the interfaces for ACE_Log_Msg backend.
46 * Implement an ACE_Log_Msg_Backend that logs to a remote logging
49 class ACE_Export ACE_Log_Msg_IPC
: public ACE_Log_Msg_Backend
53 ACE_Log_Msg_IPC () = default;
56 ~ACE_Log_Msg_IPC () override
;
58 /// Open a new connection
59 int open (const ACE_TCHAR
*logger_key
) override
;
62 * Reset the backend. When changing the logging destination the
63 * backend may need to properly disconnect from the remote logging
64 * daemon and reclaim some local resources. But we try to reduce
65 * the number of local allocations/deallocations.
67 int reset () override
;
69 int close () override
;
70 ssize_t
log (ACE_Log_Record
&log_record
) override
;
72 ACE_ALLOC_HOOK_DECLARE
;
75 ACE_LOG_MSG_IPC_STREAM message_queue_
;
78 ACE_END_VERSIONED_NAMESPACE_DECL
80 #include /**/ "ace/post.h"
81 #endif /* ACE_LOG_MSG_H */