44 ret =
m_impl->log_close ();
56 std::cerr <<
"Logger::log_open - Implementation already exist"
61 return m_impl->log_open (groups_);
72 return m_impl->log_open (logfname_, groups_, maxsize_);
77log_open (
const std::string& logsvraddr_,
78 const char* logfname_,
90 Connector <RemoteLogger, IPv4Socket> log_connector;
92 log_connector.
open (tv);
94 if (log_connector.
connect (lsp.
get (), addr) < 0) {
103 groups_, maxsize_, reactor_);
149 size_t expected_sz = 0;
165 ret = vsnprintf (bufp, len-1, fmt_, ap2);
168 if (ret == -1 || ret >= len)
171 bufp =
new char [len];
174 ret = vsnprintf (bufp, len-1, fmt_, ap2);
176 if (ret > -1 && ret < len) {
182 bufp =
new char [len];
192 ret = ::vsnprintf (&c, 1, fmt_, ap);
197 expected_sz = ret + 1;
232 std::string empty_str;
AutoPtr is a local implementation of STL's auto_ptr that makes dynamic memory handling a bit easier.
A generic pattern for establishing connection with TCP/IP servers.
Implemention of a Logger as a disk-based file.
An incapsulation of TCP/UDP Internet Protocol socket address structure.
Class IPv4Socket covers domain types AF_INET and AF_UNIX.
static const int TMPBUF_SZ
An abstraction to message logging facility.
A proxy connection class with logging server, assa-logd.
#define ASSA_DECL_SINGLETON(K)
ASSA_DECL_SINGLETON macro inserts static member declarations mandated by the Singleton class.
StdOutLogger implements Logger as standard output.
bool bad() const
Indicates whether there was error during address construction process i.e.
AutoPtr is based on SGI implementation of a auto_ptr template that makes memory handling a little bit...
X * release()
Give up the ownership of the memory.
X * get() const
Get a raw memory pointer without changing ownership status.
virtual int open(const TimeVal &tv_=TimeVal(5.0), ConnectMode mode_=sync, Reactor *r_=(Reactor *) NULL)
Configure Connector.
virtual int connect(SERVICE_HANDLER *sh_, Address &addr_, int protocol_=AF_INET)
Define strategy for establishing connection.
int log_msg(u_long g_, const char *fmt_,...)
Here is an interesting twist introduced by remote logging server:
int log_open(u_long groups_)
Write log messages to standard output.
int log_func(u_long g_, marker_t type_)
std::string m_app_name
Stack of all contexts.
stack< string > m_context
Logger implementation.