libassa  3.5.1
RemoteLogger.h
Go to the documentation of this file.
1 // -*- c++ -*-
2 //------------------------------------------------------------------------------
3 // RemoteLogger.h
4 //------------------------------------------------------------------------------
5 // $Id: RemoteLogger.h,v 1.1 2003/07/25 02:51:47 vlg Exp $
6 //------------------------------------------------------------------------------
7 // Copyright (c) 2003 by Vladislav Grinchenko
8 //
9 // This program is free software; you can redistribute it and/or
10 // modify it under the terms of the GNU General Public License
11 // as published by the Free Software Foundation; either version
12 // 2 of the License, or (at your option) any later version.
13 //------------------------------------------------------------------------------
14 // Created:
15 //------------------------------------------------------------------------------
16 #ifndef LOG_SERVER_H
17 #define LOG_SERVER_H
18 
19 #include "assa/ServiceHandler.h"
20 #include "assa/IPv4Socket.h"
21 #include "assa/Logger_Impl.h"
22 
23 /*******************************************************************************
24  Class
25 *******************************************************************************/
26 
27 namespace ASSA {
28 
29 class Reactor;
30 
38 class RemoteLogger :
39  public Logger_Impl,
40  public ASSA::ServiceHandler<ASSA::IPv4Socket>
41 {
42 public:
43  RemoteLogger ();
44 
47  virtual int open ();
48 
51  virtual int handle_close (int fd_);
52 
55  virtual int log_open (const char* appname_,
56  const char* logfname_,
57  u_long groups_,
58  u_long maxsize_,
59  Reactor* reactor_);
60 
63  virtual int log_close (void);
64 
66  virtual void log_resync (void);
67 
68  virtual int log_msg (Group g_, size_t indent_level_,
69  const string& func_name_,
70  size_t expected_sz_,
71  const char* fmt_, va_list);
72 
73  virtual int log_func (Group g_, size_t indent_level_,
74  const string& func_name_,
75  marker_t type_);
76 
77 private:
80 
81 private:
82  enum state_t { opened, closed };
83  enum msg_t { SIGN_ON = 0, SIGN_OFF, LOG_MSG };
84 
87 
90 };
91 
92 
93 } // @end namespace ASSA
94 
95 #endif /* LOG_SERVER_H */
96 
Class IPv4Socket covers domain types AF_INET and AF_UNIX.
unsigned long u_long
Definition: Logger_Impl.h:41
This abstract class provides generic interface for processing services.
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)
Reactor * m_reactor
Definition: RemoteLogger.h:86
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.
RemoteLogger(const RemoteLogger &)
bool m_recursive_call
If true, recursive call is in progress.
Definition: RemoteLogger.h:89
RemoteLogger & operator=(const RemoteLogger &)
virtual int handle_close(int fd_)
Called by Reactor when we close connection with log_close()
Definition: Acceptor.h:40
marker_t
Definition: LogMask.h:67
Group
Definition: LogMask.h:25