56 std::cerr <<
"Logger::log_open - Implementation already exist"
77 log_open (
const std::string& logsvraddr_,
78 const char* logfname_,
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.
ASSA_DECL_SINGLETON(Logger)
static const int TMPBUF_SZ
An abstraction to message logging facility.
A proxy connection class with logging server, assa-logd.
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.
Connector is a template class for initialization of communication services.
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.
virtual int log_close(void)=0
virtual int log_msg(Group g_, size_t indent_level_, const string &func_name_, size_t expected_sz_, const char *fmt_, va_list)=0
virtual int log_open(u_long groups_)
Open StdErr Logger.
virtual int log_func(Group g_, size_t indent_level_, const string &func_name_, marker_t type_)=0
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.
Socket & endl(Socket &os_)
endl manipulator.