Merge branch 'fixes' into main/rendor-staging
[ryzomcore.git] / nel / src / net / net_log.cpp
blob2833efe12df5442f3a93f89e54494d14d1e73908
1 // NeL - MMORPG Framework <http://dev.ryzom.com/projects/nel/>
2 // Copyright (C) 2010 Winch Gate Property Limited
3 //
4 // This source file has been modified by the following contributors:
5 // Copyright (C) 2016 Jan BOON (Kaetemi) <jan.boon@kaetemi.be>
6 //
7 // This program is free software: you can redistribute it and/or modify
8 // it under the terms of the GNU Affero General Public License as
9 // published by the Free Software Foundation, either version 3 of the
10 // License, or (at your option) any later version.
12 // This program is distributed in the hope that it will be useful,
13 // but WITHOUT ANY WARRANTY; without even the implied warranty of
14 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15 // GNU Affero General Public License for more details.
17 // You should have received a copy of the GNU Affero General Public License
18 // along with this program. If not, see <http://www.gnu.org/licenses/>.
21 #include "stdnet.h"
23 #include "nel/net/net_log.h"
24 #include "nel/net/unitime.h"
28 using namespace std;
29 using namespace NLMISC;
32 namespace NLNET {
36 // Globals
39 NLMISC::CVariable<bool> VerboseLNETL0("nel","VerboseLNETL0","Enable verbose logging in Network Layer 0 operations",false,0,true);
40 NLMISC::CVariable<bool> VerboseLNETL1("nel","VerboseLNETL1","Enable verbose logging in Network Layer 1 operations",false,0,true);
41 NLMISC::CVariable<bool> VerboseLNETL2("nel","VerboseLNETL2","Enable verbose logging in Network Layer 2 operations",false,0,true);
42 NLMISC::CVariable<bool> VerboseLNETL3("nel","VerboseLNETL3","Enable verbose logging in Network Layer 3 operations",false,0,true);
43 NLMISC::CVariable<bool> VerboseLNETL4("nel","VerboseLNETL4","Enable verbose logging in Network Layer 4 operations",false,0,true);
44 NLMISC::CVariable<bool> VerboseLNETL5("nel","VerboseLNETL5","Enable verbose logging in Network Layer 5 operations",true,0,true);
45 NLMISC::CVariable<bool> VerboseLNETL6("nel","VerboseLNETL6","Enable verbose logging in Network Layer 6 operations",true,0,true);
50 /**************************************************************************
51 ********************* THIS CLASS IS DEPRECATED ****************************
52 **************************************************************************/
59 CNetLog NetLog;
63 * Constructor
65 CNetLog::CNetLog() :
66 CLog()
72 * Log an output transfer (send)
74 void CNetLog::output( const char *srchost, uint8 msgnum,
75 const char *desthost, const char *msgname, uint32 msgsize )
77 /*OLD char line [1024];
78 smprintf( line, 1024, "@@%" NL_I64 "d@%s@%hu@%s@%s@%s@%u@", (CUniTime::Sync?CUniTime::getUniTime():(TTime)0),
79 srchost, (uint16)msgnum, _ProcessName.c_str(), desthost, msgname, msgsize );
81 displayRawNL( line );
83 /* displayRawNL( "@@%" NL_I64 "d@%s@%hu@%s@%s@%s@%u@", (CUniTime::Sync?CUniTime::getUniTime():(TTime)0),
84 srchost, (uint16)msgnum, _ProcessName.c_str(), desthost, msgname, msgsize );
86 displayRawNL( "@@0@%s@%hu@%s@%s@%s@%u@",
87 srchost, (uint16)msgnum, (*_ProcessName).c_str(), desthost, msgname, msgsize );
92 * Log an input transfer (receive)
94 void CNetLog::input( const char *srchost, uint8 msgnum, const char *desthost )
96 /*OLD char line [1024];
97 smprintf( line, 1024, "##%" NL_I64 "d#%s#%hu#%s#%s#", (CUniTime::Sync?CUniTime::getUniTime():(TTime)0),
98 srchost, msgnum, _ProcessName.c_str(), desthost );
99 displayRawNL( line );
101 /* displayRawNL( "##%" NL_I64 "d#%s#%hu#%s#%s#", (CUniTime::Sync?CUniTime::getUniTime():(TTime)0),
102 srchost, msgnum, _ProcessName.c_str(), desthost );
104 displayRawNL( "##0#%s#%hu#%s#%s#",
105 srchost, msgnum, (*_ProcessName).c_str(), desthost );
109 } // NLNET