Loading...
Searching...
No Matches
RemoteLogger.h
Go to the documentation of this file.
// -*- c++ -*-
//------------------------------------------------------------------------------
// RemoteLogger.h
//------------------------------------------------------------------------------
// $Id: RemoteLogger.h,v 1.1 2003/07/25 02:51:47 vlg Exp $
//------------------------------------------------------------------------------
// Copyright (c) 2003 by Vladislav Grinchenko
//
// This program is free software; you can redistribute it and/or
// modify it under the terms of the GNU General Public License
// as published by the Free Software Foundation; either version
// 2 of the License, or (at your option) any later version.
//------------------------------------------------------------------------------
// Created:
//------------------------------------------------------------------------------
#ifndef LOG_SERVER_H
#define LOG_SERVER_H
#include "assa/ServiceHandler.h"
#include "assa/IPv4Socket.h"
#include "assa/Logger_Impl.h"
/*******************************************************************************
Class
*******************************************************************************/
namespace ASSA {
class Reactor;
class RemoteLogger :
public Logger_Impl,
public ASSA::ServiceHandler<ASSA::IPv4Socket>
{
public:
RemoteLogger ();
virtual int open ();
virtual int handle_close (int fd_);
virtual int log_open (const char* appname_,
const char* logfname_,
u_long groups_,
u_long maxsize_,
Reactor* reactor_);
virtual int log_close (void);
virtual void log_resync (void);
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_);
private:
RemoteLogger (const RemoteLogger&);
RemoteLogger& operator= (const RemoteLogger&);
private:
enum state_t { opened, closed };
enum msg_t { SIGN_ON = 0, SIGN_OFF, LOG_MSG };
state_t m_state;
Reactor* m_reactor;
bool m_recursive_call;
};
} // @end namespace ASSA
#endif /* LOG_SERVER_H */
IPv4Socket.h
Class IPv4Socket covers domain types AF_INET and AF_UNIX.
Logger_Impl.h
u_long
unsigned long u_long
Definition Logger_Impl.h:41
ServiceHandler.h
This abstract class provides generic interface for processing services.
ASSA::AutoPtrRef
A wrapper class to provide AutoPtr with reference semantics.
Definition AutoPtr.h:32
ASSA::Logger_Impl
Definition Logger_Impl.h:141
ASSA::Reactor
Definition Reactor.h:58
ASSA::RemoteLogger
Definition RemoteLogger.h:41
ASSA::RemoteLogger::operator=
RemoteLogger & operator=(const RemoteLogger &)
ASSA::RemoteLogger::RemoteLogger
RemoteLogger()
Definition RemoteLogger.cpp:30
ASSA::RemoteLogger::open
virtual int open()
Called by Connector upon establishing connection.
Definition RemoteLogger.cpp:39
ASSA::RemoteLogger::log_open
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.
Definition RemoteLogger.cpp:46
ASSA::RemoteLogger::log_msg
virtual int log_msg(Group g_, size_t indent_level_, const string &func_name_, size_t expected_sz_, const char *fmt_, va_list)
Definition RemoteLogger.cpp:125
ASSA::RemoteLogger::state_t
state_t
Definition RemoteLogger.h:82
ASSA::RemoteLogger::closed
@ closed
Definition RemoteLogger.h:82
ASSA::RemoteLogger::opened
@ opened
Definition RemoteLogger.h:82
ASSA::RemoteLogger::m_reactor
Reactor * m_reactor
Definition RemoteLogger.h:86
ASSA::RemoteLogger::log_func
virtual int log_func(Group g_, size_t indent_level_, const string &func_name_, marker_t type_)
Definition RemoteLogger.cpp:175
ASSA::RemoteLogger::log_resync
virtual void log_resync(void)
Flush output buffer.
Definition RemoteLogger.cpp:114
ASSA::RemoteLogger::log_close
virtual int log_close(void)
Close connection to the assa-logd.
Definition RemoteLogger.cpp:89
ASSA::RemoteLogger::RemoteLogger
RemoteLogger(const RemoteLogger &)
ASSA::RemoteLogger::m_recursive_call
bool m_recursive_call
If true, recursive call is in progress.
Definition RemoteLogger.h:89
ASSA::RemoteLogger::m_state
state_t m_state
Definition RemoteLogger.h:85
ASSA::RemoteLogger::handle_close
virtual int handle_close(int fd_)
Called by Reactor when we close connection with log_close()
Definition RemoteLogger.cpp:105
ASSA::RemoteLogger::msg_t
msg_t
Definition RemoteLogger.h:83
ASSA::RemoteLogger::LOG_MSG
@ LOG_MSG
Definition RemoteLogger.h:83
ASSA::RemoteLogger::SIGN_OFF
@ SIGN_OFF
Definition RemoteLogger.h:83
ASSA::RemoteLogger::SIGN_ON
@ SIGN_ON
Definition RemoteLogger.h:83
ASSA::ServiceHandler
Definition ServiceHandler.h:32
ASSA
Definition Acceptor.h:40
ASSA::marker_t
marker_t
Definition LogMask.h:67
ASSA::Group
Group
Definition LogMask.h:25