32 m_recursive_call (false)
47 const char* logfname_,
74 size_t len =
sizeof (maxsize_) +
81 << maxsize_ << appname_ << logfname_ <<
ASSA::flush;
126 size_t indent_level_,
127 const string& func_name_,
142 std::ostringstream os;
146 bool release =
false;
147 char* msgbuf_ptr =
format_msg (expected_sz_, fmt_, msg_list_, release);
148 if (msgbuf_ptr == NULL) {
155 delete [] msgbuf_ptr;
176 size_t indent_level_,
177 const string& func_name_,
190 std::ostringstream os;
193 os << ((type_ ==
FUNC_ENTRY) ?
"---v---\n" :
"---^---\n");
#define Assure_exit(exp_)
Macro that makes program exit if assert fails.
An implementation of Reactor pattern.
A proxy connection class with logging server, assa-logd.
Abstraction of socket data type.
char * format_msg(size_t expected_sz_, const char *fmt_, va_list vap_, bool &release_)
Format and put the message in the buffer.
virtual u_short indent_func_name(ostream &sink_, const string &funcname_, size_t indent_level_, marker_t type_)
bool group_enabled(Group g_) const
u_long m_groups
Enabled groups.
string m_logfname
Log file name.
virtual u_short add_timestamp(ostream &sink_)
bool registerIOHandler(EventHandler *eh_, handler_t fd_, EventType et_=RWE_EVENTS)
Register I/O Event handler with Reactor.
bool removeHandler(EventHandler *eh_, EventType et_=ALL_EVENTS)
Remove Event handler from reactor for either all I/O events or timeout event or both.
virtual int open()
Called by Connector upon establishing connection.
virtual int log_open(const char *appname_, const char *logfname_, u_long groups_, u_long maxsize_, Reactor *reactor_)
Calling results into sending SIGN-ON message.
virtual int log_msg(Group g_, size_t indent_level_, const string &func_name_, size_t expected_sz_, const char *fmt_, va_list)
virtual int log_func(Group g_, size_t indent_level_, const string &func_name_, marker_t type_)
virtual void log_resync(void)
Flush output buffer.
virtual int log_close(void)
Close connection to the assa-logd.
bool m_recursive_call
If true, recursive call is in progress.
virtual int handle_close(int fd_)
Called by Reactor when we close connection with log_close()
ASSA::IPv4Socket & get_stream()
Return referenct to underlying PEER_STREAM.
static size_t xdr_length(const std::string &s_)
Give the true length of the XDR-encoded STL string.
bool turnOptionOff(opt_t opt_)
Disable socket option.
@ nonblocking
Set Socket to a non-blocking mode (O_RDWR|O_NONBLOCK).
@ READ_EVENT
Notify when there will be at least 1 byte available for reading from IO channel without blocking .
Socket & flush(Socket &os_)
flush manipulator.