1 /* $Id: Logging.h,v 1.5 2003/01/15 14:10:28 nan Exp $ */
2 
3 // Copyright (C) 2001, 2002, 2003  $B?@Fn(B $B5H9((B(Kanna Yoshihiro)
4 //
5 // This program is free software; you can redistribute it and/or modify
6 // it under the terms of the GNU General Public License as published by
7 // the Free Software Foundation; either version 2 of the License, or
8 // (at your option) any later version.
9 //
10 // This program is distributed in the hope that it will be useful,
11 // but WITHOUT ANY WARRANTY; without even the implied warranty of
12 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
13 // GNU General Public License for more details.
14 //
15 // You should have received a copy of the GNU General Public License
16 // along with this program; if not, write to the Free Software
17 // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
18 
19 #ifndef _Logging_
20 #define _Logging_
21 
22 #define LOG_COMBALL		0
23 #define LOG_COMTHEPLAYER	1
24 #define LOG_COMCOMPLAYER	2
25 #define LOG_COMMISC		3
26 #define LOG_ACTBALL		4
27 #define LOG_ACTTHEPLAYER	5
28 #define LOG_ACTCOMPLAYER	6
29 #define LOG_ACTMISC		7
30 
31 class Player;
32 class Ball;
33 class ExternalBVData;
34 class ExternalPVData;
35 class ExternalPSData;
36 class ExternalPTData;
37 
38 class Logging {
39 public:
40   ~Logging();
41   static Logging* GetLogging();
42   bool Init();
43 
44   bool Log( long logType, char *logString );
45   bool StartLog();
46   bool LogTime( long logType, struct timeb *tb );
47   bool LogTime( long logType );
48   bool LogBall( long logType, Ball *ball );
49   bool LogPlayer( long logType, Player *player );
50   bool LogSendBVMessage( Ball *ball );
51   bool LogRecvBVMessage( ExternalBVData *bv );
52   bool LogSendPVMessage( Player *player );
53   bool LogRecvPVMessage( ExternalPVData *pv );
54   bool LogSendPSMessage( Player *player );
55   bool LogRecvPSMessage( ExternalPSData *ps );
56   bool LogRecvPTMessage( ExternalPTData *pt );
57 
58 private:
59   Logging();
60 
61   static Logging *m_logging;
62 
63   FILE *m_fp[8];
64 };
65 
66 #endif
67