libassa  3.5.1
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros
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:
78  RemoteLogger (const RemoteLogger&);
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